User Tools

Site Tools


dragengine:modules:dragonscript:behavior_vrhandpointedat

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_vrhandpointedat [2025/03/13 17:18] dragonlorddragengine:modules:dragonscript:behavior_vrhandpointedat [2025/05/04 13:48] (current) – [vrHandPointedAt.check] dragonlord
Line 30: Line 30:
  
 ===== handStopsPointingAt ===== ===== handStopsPointingAt =====
 +
 +Hand stops pointing at element.
 +
 +====== Behavior Tree Actions ======
 +
 +This behavior adds these behavior tree actions if behavior tree is present.
 +
 +===== vrHandPointedAt.check =====
 +
 +Check one or more vr hand pointed-at parameters. Action succeeds if all parameter value matches their respective vr hand pointed-at parameter otherwise action fails. This action is typically used as first action in a sequence to run the sequence only if a vr hand pointed-at parameter matches (or not).
 +
 +^Parameter^Value^Description^
 +|count|integer|Count of vr hands pointing at element equals integer value|
 +|count.not|integer|Count of vr hands pointing at element does not equal integer value|
 +|count.less|integer|Count of vr hands pointing at element is less than integer value|
 +|count.greater|integer|Count of vr hands pointing at element is greater than integer value|
 +|player|''true'', ''false''|Player is pointing at element|
 +|wait| |If present action returns BTResult.running instead of BTResult.failed to wait until the checks are all fulfilled|
 +
 +This is an example of using this action:
 +<code xml>
 +<sequence>
 +  <action name='vrHandPointedAt.check'>
 +    <parameter name='player'>true</parameter>
 +  </action>
 +  <!-- actions here run only if player is pointing at element -->
 +</sequence>
 +</code>
 +
 +====== Behavior Tree Conditions ======
 +
 +This behavior adds these behavior tree conditions if behavior tree is present.
 +
 +===== vrHandPointedAt.check =====
 +
 +Check one or more vr hand pointed-at parameters. Conditions returns true if all parameter value match their respective vr hand pointed-at parameter. This condition is typically used to run an action or sequence of actions as long as vr hand pointed-at conditions are true.
 +
 +^Parameter^Value^Description^
 +|vrHandPointedAt.count|integer|Count of vr hands pointing at element equals integer value|
 +|vrHandPointedAt.count.not|integer|Count of vr hands pointing at element does not equal integer value|
 +|vrHandPointedAt.count.less|integer|Count of vr hands pointing at element is less than integer value|
 +|vrHandPointedAt.count.greater|integer|Count of vr hands pointing at element is greater than integer value|
 +|vrHandPointedAt.player|''true'', ''false''|Player is pointing at element|
 +
 +This is an example of using this condition:
 +<code xml>
 +<action name='myAction' id='doing something'>
 +  <parameter name='vrHandPointedAt.player'>true</parameter>
 +  <condition>vrHandPointedAt.check</condition>
 +</action>
 +</code>
 +
 +====== State Machine Actions ======
 +
 +Same as [[#behavior_tree_actions|Behavior Tree Actions]].
 +
 +====== State Machine Conditions ======
 +
 +Same as [[#behavior_tree_conditions|Behavior Tree Conditions]].
 +
 +====== State Machine Events ======
 +
 +This behavior sends these state machine events. If behavior has non-empty identifier replace ''occupier'' with ''occupier(id)''.
 +
 +===== vrHandPointedAt.start =====
 +
 +Hand starts pointing at element.
 +
 +===== vrHandPointedAt.stop =====
  
 Hand stops pointing at element. Hand stops pointing at element.
Line 39: Line 108:
 ====== Optional Behaviors ====== ====== Optional Behaviors ======
  
-This behavior does not support optional behaviors.+  * [[behavior_behaviortree|ECBehaviorBehaviorTree]]: Add actions and conditions for behavior trees to use. 
 +  * [[behavior_statemachine|ECBehaviorStateMachine]]: Add actions and conditions for state machine to use and events to send to the state machine.
  
 ====== Persistency ====== ====== Persistency ======
Line 46: Line 116:
  
 ====== API Documentation ====== ====== API Documentation ======
 +
 #@LinkApiDocDEDS2_HTML~classDragengine_1_1Scenery_1_1ECBehaviorVRHandPointedAt.html,ECBehaviorVRHandPointedAt~@#. #@LinkApiDocDEDS2_HTML~classDragengine_1_1Scenery_1_1ECBehaviorVRHandPointedAt.html,ECBehaviorVRHandPointedAt~@#.
  
Line 78: Line 149:
 <elementClass name='MyClass' class='GenericBehaviorElement'> <elementClass name='MyClass' class='GenericBehaviorElement'>
   <behavior type='ECBehaviorVRHandPointedAt'>   <behavior type='ECBehaviorVRHandPointedAt'>
 +    <!-- optional: use behavior tree with id instead of empty string -->
 +    <string name='behaviorTree'>second</string>
 +    
 +    <!-- optional: use state machine with id instead of empty string -->
 +    <string name='stateMachine'>second</string>
 +    
     <!-- set element properties. omit property prefix if used inside behavior tag -->     <!-- set element properties. omit property prefix if used inside behavior tag -->
     <string name='.name'>value</string>     <string name='.name'>value</string>
dragengine/modules/dragonscript/behavior_vrhandpointedat.1741886282.txt.gz · Last modified: 2025/03/13 17:18 by dragonlord