User Tools

Site Tools


dragengine:modules:dragonscript:behavior_forcefield

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
dragengine:modules:dragonscript:behavior_forcefield [2025/05/04 13:41] – [forceField.check] dragonlorddragengine:modules:dragonscript:behavior_forcefield [2026/10/09 17:05] (current) – dragonlord
Line 20: Line 20:
 ====== Element Class Properties ====== ====== Element Class Properties ======
 Element class properties have the prefix ''forceField.'' or ''forceField({id}).'' if id is not empty. Element class properties have the prefix ''forceField.'' or ''forceField({id}).'' if id is not empty.
- 
-===== influenceArea ===== 
-Set influence area. Geometry touching this shape is affected by this force field. 
-  * Full name: ''forceField.influenceArea'' or ''forceField({id}).influenceArea'' 
-  * Type: string (shape format). See "Shape List Encoding" in CodecPropertyString. 
-  * Default Value: empty string 
-  * Example (*.deeclass) <code xml><string name='forceField.influenceArea'>box:position,0,0.5,0:extends,2,1,0.5</string></code> 
- 
-===== radius ===== 
-Set falloff radius. Geometry inside this distance from the border is faded out gradually. 
-  * Full name: ''forceField.radius'' or ''forceField({id}).radius'' 
-  * Type: float 
-  * Default Value: ''1'' 
-  * Restriction: At least ''0'' 
-  * Example (*.deeclass) <code xml><float name='forceField.radius'>2</float></code> 
- 
-===== exponent ===== 
-Set falloff exponent. Shape of the fading out applied due to radius. Value of ''1'' represents linear fading. Values less than 1 fade of stronger near the border. Values greater than 1 fade of stronger near the inner border. 
-  * Full name: ''forceField.exponent'' or ''forceField({id}).exponent'' 
-  * Type: float 
-  * Default Value: 1 
-  * Restriction: At least 0 
-  * Example (*.deeclass) <code xml><float name='forceField.exponent'>0.5</float></code> 
- 
-===== fieldType ===== 
-Set field type. 
-  * Full name: ''forceField.fieldType'' or ''forceField({id}).fieldType'' 
-  * Type: enumeration 
-  * <WRAP>Allowed Values: 
-^Value^Description^ 
-|''radial''|Force is applied radial from the center.| 
-|''linear''|Force is applied along the force direction.| 
-|''vortex''|Force is applied vortex like swirling around.| 
-</WRAP> 
-  * Default Value: ''radial'' 
-  * Example (*.deeclass) <code xml><string name='forceField.fieldType'>linear</string></code> 
  
 ===== applicationType ===== ===== applicationType =====
Line 70: Line 34:
   * Default Value: ''direct''   * Default Value: ''direct''
   * Example (*.deeclass) <code xml><string name='forceField.applicationType'>mass</string></code>   * Example (*.deeclass) <code xml><string name='forceField.applicationType'>mass</string></code>
 +
 +===== bone =====
 +Set bone to attach resource to. If empty string attach to collider.
 +  * Full name: ''forceField.bone'' or ''forceField({id}).bone''
 +  * Type: string
 +  * Default Value: empty string
 +  * Example (*.deeclass) <code xml><string name='forceField.bone'>attach</string></code>
  
 ===== direction ===== ===== direction =====
Line 78: Line 49:
   * Example (*.deeclass) <code xml><vector name='forceField.direction' x='0' y='1' z='0'/></code>   * Example (*.deeclass) <code xml><vector name='forceField.direction' x='0' y='1' z='0'/></code>
  
-===== force ===== +===== collisionFilter ===== 
-Set force in newton. Negative force reverse direction. + 
-  * Full name: ''forceField.force'' or ''forceField({id}).force''+Set [[gamedev:collisionfiltering|collision filter]]. Filter bits are defined using a list of names mapped to collision filter bit indices using BaseGameApp.getCollisionFilterMap().  
 +  * Full name: ''collider.collisionFilter'' 
 +  * Type: string. Format can be ''category:filter'' or ''category'' where category and filter can be ''bit1 bit2 ... bitN'' with bit names looked up using the collision filter map. If only category is used filter is the same. 
 +  * Default Value: ''forceField:geometry dynamic actor actorAI particle'' 
 +  * Example (*.deeclass) <code xml><string name='collider.collisionFilter'>forceField:geometry dynamic actor actorAI particle trigger</string></code> 
 + 
 +===== enabled ===== 
 +Set force field enabled. 
 +  * Full name: ''forceField.enabled'' or ''forceField({id}).enabled'' 
 +  * Type: boolean 
 +  * Default Value: true 
 +  * Example (*.deeclass) <code xml><boolean name='forceField.enabled'>false</boolean></code> 
 + 
 +===== exponent ===== 
 +Set falloff exponent. Shape of the fading out applied due to radius. Value of ''1'' represents linear fading. Values less than 1 fade of stronger near the border. Values greater than 1 fade of stronger near the inner border. 
 +  * Full name: ''forceField.exponent'' or ''forceField({id}).exponent''
   * Type: float   * Type: float
   * Default Value: 1   * Default Value: 1
-  * Example (*.deeclass) <code xml><float name='forceField.force'>50</float></code>+  * Restriction: At least 0 
 +  * Example (*.deeclass) <code xml><float name='forceField.exponent'>0.5</float></code> 
 + 
 +===== fieldType ===== 
 +Set field type. 
 +  * Full name: ''forceField.fieldType'' or ''forceField({id}).fieldType'' 
 +  * Type: enumeration 
 +  * <WRAP>Allowed Values: 
 +^Value^Description^ 
 +|''radial''|Force is applied radial from the center.| 
 +|''linear''|Force is applied along the force direction.| 
 +|''vortex''|Force is applied vortex like swirling around.| 
 +</WRAP> 
 +  * Default Value: ''radial'' 
 +  * Example (*.deeclass) <code xml><string name='forceField.fieldType'>linear</string></code>
  
 ===== fluctuationDirection ===== ===== fluctuationDirection =====
Line 99: Line 99:
   * Example (*.deeclass) <code xml><float name='forceField.fluctuationForce'>20</float></code>   * Example (*.deeclass) <code xml><float name='forceField.fluctuationForce'>20</float></code>
  
-===== enabled ===== +===== force ===== 
-Set force field enabled. +Set force in newton. Negative force reverse direction. 
-  * Full name: ''forceField.enabled'' or ''forceField({id}).enabled'' +  * Full name: ''forceField.force'' or ''forceField({id}).force'' 
-  * Type: boolean +  * Type: float 
-  * Default Value: true +  * Default Value: 1 
-  * Example (*.deeclass) <code xml><boolean name='forceField.enabled'>false</boolean></code>+  * Example (*.deeclass) <code xml><float name='forceField.force'>50</float></code>
  
-===== shape ===== +===== influenceArea ===== 
-Set shape from which the force originates. If not set force originates from origin position. +Set influence area. Geometry touching this shape is affected by this force field. 
-  * Full name: ''forceField.shape'' or ''forceField({id}).shape''+  * Full name: ''forceField.influenceArea'' or ''forceField({id}).influenceArea''
   * Type: string (shape format). See "Shape List Encoding" in CodecPropertyString.   * Type: string (shape format). See "Shape List Encoding" in CodecPropertyString.
   * Default Value: empty string   * Default Value: empty string
-  * Example (*.deeclass) <code xml><string name='forceField.shape'>box:position,0,0.5,0:extends,2,1,0.5</string></code>+  * Example (*.deeclass) <code xml><string name='forceField.influenceArea'>box:position,0,0.5,0:extends,2,1,0.5</string></code> 
 + 
 +===== orientation ===== 
 +Set orientation to attach resource to collider in degrees. 
 +  * Full name: ''forceField.orientation'' or ''forceField({id}).orientation'' 
 +  * Type: 3-component float vector 
 +  * Default Value: (0,0,0) 
 +  * Example (*.deeclass) <code xml><vector name='forceField.orientation' x='30' y='0' z='0'/></code>
  
 ===== position ===== ===== position =====
Line 120: Line 127:
   * Example (*.deeclass) <code xml><vector name='forceField.position' x='0' y='0' z='0.1'/></code>   * Example (*.deeclass) <code xml><vector name='forceField.position' x='0' y='0' z='0.1'/></code>
  
-===== orientation ===== +===== radius ===== 
-Set orientation to attach resource to collider in degrees. +Set falloff radius. Geometry inside this distance from the border is faded out gradually. 
-  * Full name: ''forceField.orientation'' or ''forceField({id}).orientation'' +  * Full name: ''forceField.radius'' or ''forceField({id}).radius'' 
-  * Type: 3-component float vector +  * Type: float 
-  * Default Value: (0,0,0) +  * Default Value: ''1'' 
-  * Example (*.deeclass) <code xml><vector name='forceField.orientation' x='30' y='0' z='0'/></code>+  * Restriction: At least ''0'' 
 +  * Example (*.deeclass) <code xml><float name='forceField.radius'>2</float></code>
  
-===== bone ===== +===== shape ===== 
-Set bone to attach resource to. If empty string attach to collider. +Set shape from which the force originates. If not set force originates from origin position. 
-  * Full name: ''forceField.bone'' or ''forceField({id}).bone'' +  * Full name: ''forceField.shape'' or ''forceField({id}).shape'' 
-  * Type: string+  * Type: string (shape format). See "Shape List Encoding" in CodecPropertyString.
   * Default Value: empty string   * Default Value: empty string
-  * Example (*.deeclass) <code xml><string name='forceField.bone'>attach</string></code>+  * Example (*.deeclass) <code xml><string name='forceField.shape'>box:position,0,0.5,0:extends,2,1,0.5</string></code>
  
 ===== trigger ===== ===== trigger =====
Line 284: Line 292:
      
   <behavior type='ECBehaviorForceField'>   <behavior type='ECBehaviorForceField'>
-    <!-- optional: set collision filter. default value '6:0 1 2 3 5' which means 
-                   category BaseGameApp.CollisionFilterBit.forceField 
-                   filter BaseGameApp.CollisionFilterBit.geometry, 
-                          BaseGameApp.CollisionFilterBit.dynamic, 
-                          BaseGameApp.CollisionFilterBit.actor, 
-                          BaseGameApp.CollisionFilterBit.actorAI, 
-                          BaseGameApp.CollisionFilterBit.particle. 
-                   format is '', 'category' or 'category:filter' where category and filter 
-                   are a list of bits to set. --> 
-    <string name='collisionFilter'>6:0 1 2 3 5</string> 
-     
     <!-- optional: use BaseGameApp trigger table. game can add more     <!-- optional: use BaseGameApp trigger table. game can add more
                    supported values. default value is 'default' -->                    supported values. default value is 'default' -->
Line 306: Line 303:
     <string name='trigger.synchronize'>other</string>     <string name='trigger.synchronize'>other</string>
          
-    <!-- optional: use behavior tree with id instead of empty string --> +    <!-- optional: add behavior trees. default adds all behavior trees. --> 
-    <string name='behaviorTree'>second</string>+    <list name='behaviorTrees'> 
 +      <string/> <!-- add behavior with empty identifier --> 
 +      <string>default</string> <!-- add behavior with 'default' identifier --> 
 +    </list>
          
-    <!-- optional: use state machine with id instead of empty string --> +    <!-- optional: add state machines. default adds all state machines. --> 
-    <string name='stateMachine'>second</string>+    <list name='stateMachines'> 
 +      <string/> <!-- add behavior with empty identifier --> 
 +      <string>default</string> <!-- add behavior with 'default' identifier --> 
 +    </list>
          
     <!-- set element properties. omit property prefix if used inside behavior tag -->     <!-- set element properties. omit property prefix if used inside behavior tag -->
dragengine/modules/dragonscript/behavior_forcefield.1746366091.txt.gz · Last modified: by dragonlord