User Tools

Site Tools


dragengine:modules:dragonscript:behavior_grabber

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_grabber [2025/05/11 13:27] – [grabber.set] dragonlorddragengine:modules:dragonscript:behavior_grabber [2026/10/09 16:35] (current) – dragonlord
Line 24: Line 24:
 Element class properties have the prefix ''grabber.'' or ''grabber(id).'' if id is not empty. Element class properties have the prefix ''grabber.'' or ''grabber(id).'' if id is not empty.
  
-===== shape ===== +===== bone ===== 
-Shape of collider used to detect grab spots. +Name of bone to attach to or empty string to attach to the parent element. 
-  * Full name: ''grabber.shape'' or ''grabber(id).shape'' +  * Full name: ''grabber.bone'' or ''grabber(id).bone'' 
-  * Type: string (shape format). See "Shape List Encoding" in CodecPropertyString.+  * Type: string
   * Default Value: empty string   * Default Value: empty string
-  * Example (*.deeclass): <code xml><string name='grabber(right).shape'>box:extends,0.1,0.1,0.1</string></code>+  * Example (*.deeclass): <code xml><string name='grabber(right).bone'>attach hand.r</string></code> 
 + 
 +===== 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: ''trigger:dynamic'' 
 +  * Example (*.deeclass) <code xml><string name='collider.collisionFilter'>trigger:dynamic particle</string></code>
  
 ===== position ===== ===== position =====
Line 45: Line 53:
   * Example (*.deeclass): <code xml><vector name='grabber(right).rotation' x='-45' y='0' z='0'/></code>   * Example (*.deeclass): <code xml><vector name='grabber(right).rotation' x='-45' y='0' z='0'/></code>
  
-===== bone ===== +===== shape ===== 
-Name of bone to attach to or empty string to attach to the parent element. +Shape of collider used to detect grab spots. 
-  * Full name: ''grabber.bone'' or ''grabber(id).bone'' +  * Full name: ''grabber.shape'' or ''grabber(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='grabber(right).bone'>attach hand.r</string></code>+  * Example (*.deeclass): <code xml><string name='grabber(right).shape'>box:extends,0.1,0.1,0.1</string></code>
  
 ====== Events ====== ====== Events ======
Line 103: Line 111:
 |release| |Release grab spot if grabbing one.| |release| |Release grab spot if grabbing one.|
 |interactElement.assign|string|Assign grab spot element to [[behavior_interactelement|ECBehaviorInteractElement]] with identifier matching value string. Action fails if no element is grabbed or interact element behavior is absent| |interactElement.assign|string|Assign grab spot element to [[behavior_interactelement|ECBehaviorInteractElement]] with identifier matching value string. Action fails if no element is grabbed or interact element behavior is absent|
 +|interact|string|Interact with grab spot. If element is absent action fails. Runs interaction with name value. If interaction with name value is absent fails action. If interaction returns false fails action. Otherwise action succeeds.|
 +|interact.parameters|string|Optional parameters to use with ''interaction''.|
  
 This is an example of using this action: This is an example of using this action:
Line 118: Line 128:
 |enabled|''true'', ''false''|Grabber is enabled| |enabled|''true'', ''false''|Grabber is enabled|
 |grabbing|''true'', ''false''|Grabber is grabbing a grab spot| |grabbing|''true'', ''false''|Grabber is grabbing a grab spot|
 +|interact.name|string|Name of interaction|
 +|interact.has|''true'', ''false''|Has grab spot and interaction with name ''interaction.name'' is present|
 +|interact.query|''true'', ''false''|Interact with grab spot and test result. Condition is true if grab spot is present, interaction with name ''interaction.name'' is present and interaction returns true. It is recommended to use here only interactions without side effects (hence query interactions).|
 +|interact.parameters|string|Optional parameters to use with ''interaction.query''.|
 |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 141: Line 155:
 |grabber.enabled|''true'', ''false''|Grabber is enabled| |grabber.enabled|''true'', ''false''|Grabber is enabled|
 |grabber.grabbing|''true'', ''false''|Grabber is grabbing a grab spot| |grabber.grabbing|''true'', ''false''|Grabber is grabbing a grab spot|
 +|grabber.interact.name|string|Name of interaction|
 +|grabber.interact.has|''true'', ''false''|Has grab spot and interaction with name ''interaction.name'' is present|
 +|grabber.interact.query|''true'', ''false''|Interact with grab spot and test result. Condition is true if grab spot is present, interaction with name ''interaction.name'' is present and interaction returns true. It is recommended to use here only interactions without side effects (hence query interactions).|
 +|grabber.interact.parameters|string|Optional parameters to use with ''interaction.query''.|
  
 This is an example of using this condition: This is an example of using this condition:
Line 254: Line 272:
     <!-- optional: use vr hand with id instead of empty string -->     <!-- optional: use vr hand with id instead of empty string -->
     <string name='vrHand'>right</string>     <string name='vrHand'>right</string>
-     
-    <!-- optional: set collision filter. default value '4:1' which means 
-                   category BaseGameApp.CollisionFilterBit.trigger 
-                   filter BaseGameApp.CollisionFilterBit.dynamic. 
-                   format is '', 'category' or 'category:filter' where category and filter 
-                   are a list of bits to set. --> 
-    <string name='collisionFilter'>4:1 2</string> 
          
     <!-- optional: use behavior tree with id instead of empty string -->     <!-- optional: use behavior tree with id instead of empty string -->
dragengine/modules/dragonscript/behavior_grabber.1746970032.txt.gz · Last modified: by dragonlord