User Tools

Site Tools


dragengine:modules:dragonscript:behavior_colliderai

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_colliderai [2025/05/09 14:08] – dragonlorddragengine:modules:dragonscript:behavior_colliderai [2026/10/12 02:53] (current) – [State Machine Events] dragonlord
Line 24: Line 24:
 ====== Element Class Properties ====== ====== Element Class Properties ======
 Element class properties have the prefix ''colliderAI.'' . Element class properties have the prefix ''colliderAI.'' .
 +
 +===== collisionFilter =====
 +
 +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: ''actorAI:geometry dynamic actorAI trigger''
 +  * Example (*.deeclass) <code xml><string name='collider.collisionFilter'>actorAI:geometry dynamic actorAI trigger particle</string></code>
  
 ====== Events ====== ====== Events ======
Line 50: Line 58:
  
 ^Parameter^Value^Description^ ^Parameter^Value^Description^
 +|collisionFilter.filter.set|string|Set named [[gamedev:collisionfiltering|collision filter]] filter mask bit.|
 +|collisionFilter.filter.clear|string|Clear named [[gamedev:collisionfiltering|collision filter]] filter mask bit.|
 |enabled|''true'', ''false''|Enable collider| |enabled|''true'', ''false''|Enable collider|
 |gravity|vector3|Set gravity| |gravity|vector3|Set gravity|
-|gravity.apply| |Apply gravity to linear velocity of collider| 
 |shape|''humanoid''|Set collider shape. Requires additional parameters| |shape|''humanoid''|Set collider shape. Requires additional parameters|
 |shape.radius|float|Set radius in meters of humanoid shape| |shape.radius|float|Set radius in meters of humanoid shape|
 |shape.height|float|Set height in meters of humanoid shape| |shape.height|float|Set height in meters of humanoid shape|
-|geometryFromCollider| |Set element position and orientation from collider| 
-|stop.turning| |Clear angular velocity of collider| 
-|stop.moving| |Clear linear velocity of collider| 
  
 This is an example of using this action: This is an example of using this action:
Line 66: Line 72:
   <parameter name='shape.radius'>0.3</parameter>   <parameter name='shape.radius'>0.3</parameter>
   <parameter name='shape.height'>1.8</parameter>   <parameter name='shape.height'>1.8</parameter>
 +</action>
 +</code>
 +
 +===== colliderAI.update =====
 +
 +Update collider ai.
 +
 +^Parameter^Value^Description^
 +|gravity.apply| |Apply gravity to linear velocity of collider|
 +|geometryFromCollider| |Set element position and orientation from collider|
 +|stop.turning| |Clear angular velocity of collider|
 +|stop.moving| |Clear linear velocity of collider|
 +
 +This is an example of using this action:
 +<code xml>
 +<action name='colliderAI.set'>
 +  <parameter name='gravity.apply'/>
 +</action>
 +</code>
 +
 +===== colliderAI.collision =====
 +
 +Handle collisions.
 +
 +^Parameter^Value^Description^
 +|stop| |Stop collider from moving. Prevents any further collision in this frame update.|
 +|sliding| |Applies sliding collision response|
 +
 +This is an example of using this action:
 +<code xml>
 +<action name='colliderAI.collision'>
 +  <parameter name='sliding'/>
 </action> </action>
 </code> </code>
Line 75: Line 113:
 ^Parameter^Value^Description^ ^Parameter^Value^Description^
 |enabled|''true'', ''false''|Collider is enabled| |enabled|''true'', ''false''|Collider is enabled|
 +|hitElement| |Collider has been hit and it is owned by a BehaviorElement. Using [[behavior_statemachine#eventelementupdate|eventParameter.update]] or [[behavior_statemachine#eventelementcheck|eventParameter.check]] is valid.|
 |wait| |If present action returns BTResult.running instead of BTResult.failed to wait until the checks are all fulfilled| |wait| |If present action returns BTResult.running instead of BTResult.failed to wait until the checks are all fulfilled|
  
Line 97: Line 136:
 ^Parameter^Value^Description^ ^Parameter^Value^Description^
 |colliderAI.enabled|''true'', ''false''|Collider is enabled| |colliderAI.enabled|''true'', ''false''|Collider is enabled|
 +|colliderAI.hitElement| |Collider has been hit and it is owned by a BehaviorElement. Using [[behavior_statemachine#eventelementupdate|eventParameter.update]] or [[behavior_statemachine#eventelementcheck|eventParameter.check]] is valid.|
  
 This is an example of using this condition: This is an example of using this condition:
Line 116: Line 156:
 ====== State Machine Events ====== ====== State Machine Events ======
  
-This behavior sends no state machine events.+This behavior does not send events to state machine. 
 + 
 +BAAStateMachine and BAAVRHandStateMachine though does send ''collisionResponse'' if this behavior hit something. Use [[behavior_statemachine#eventelementupdate|eventParameter.update]] or [[behavior_statemachine#eventelementcheck|eventParameter.check]] to work with the element.
  
 ====== Required Behaviors ====== ====== Required Behaviors ======
Line 169: Line 211:
      
   <behavior type='ECBehaviorColliderAI'>   <behavior type='ECBehaviorColliderAI'>
-    <!-- optional: set collision filter. default value '3:0 1 2 3 4' which means 
-                   category BaseGameApp.CollisionFilterBit.actorAI 
-                   filter BaseGameApp.CollisionFilterBit.geometry, 
-                          BaseGameApp.CollisionFilterBit.dynamic, 
-                          BaseGameApp.CollisionFilterBit.actorAI, 
-                          BaseGameApp.CollisionFilterBit.trigger. 
-                   format is '', 'category' or 'category:filter' where category and filter 
-                   are a list of bits to set. --> 
-    <string name='collisionFilter'>3:0 1 2 3 4</string> 
-     
     <!-- optional: use behavior tree with id instead of empty string -->     <!-- optional: use behavior tree with id instead of empty string -->
     <string name='behaviorTree'>second</string>     <string name='behaviorTree'>second</string>
dragengine/modules/dragonscript/behavior_colliderai.1746799697.txt.gz · Last modified: by dragonlord