User Tools

Site Tools


dragengine:modules:dragonscript:behavior_vrhandlaserpointer

Differences

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

Link to this comparison view

Both sides previous revisionPrevious revision
dragengine:modules:dragonscript:behavior_vrhandlaserpointer [2025/03/13 17:17] dragonlorddragengine:modules:dragonscript:behavior_vrhandlaserpointer [2025/05/14 10:44] (current) dragonlord
Line 105: Line 105:
  
 This behavior has no events. This behavior has no events.
 +
 +====== Behavior Tree Actions ======
 +
 +This behavior adds these behavior tree actions if behavior tree is present. If behavior has non-empty identifier replace ''vrHandLaserPointer'' with ''vrHandLaserPointer(id)''.
 +
 +===== vrHandLaserPointer.set =====
 +
 +Set one or more VR hand laser pointer parameters.
 +
 +^Parameter^Value^Description^
 +|length|float|Length of beam in meters|
 +|intensity|float|Intensity of beam|
 +|color|color|Color of beam|
 +
 +This is an example of using this action:
 +<code xml>
 +<action name='vrHandLaserPointer.set'>
 +  <parameter name='color'>1 0 0</parameter>
 +</action>
 +</code>
 +
 +===== vrHandLaserPointer.check =====
 +
 +Check one or more VR hand laser pointer parameters. Action succeeds if all parameter value matches their respective VR hand laser pointer parameter otherwise action fails. This action is typically used as first action in a sequence to run the sequence only if a VR hand laser pointer parameter matches (or not).
 +
 +^Parameter^Value^Description^
 +|length.less|float|Length of beam is less than value meters|
 +|length.greater|float|Length of beam is greater than value meters|
 +|intensity.less|float|Intensity of beam is less than value meters|
 +|intensity.greater|float|Intensity of beam is greater than value meters|
 +|color.red.less|float|Red color of beam is less than value|
 +|color.red.greater|float|Red color of beam is greater than value|
 +|color.green.less|float|Green color of beam is less than value|
 +|color.green.greater|float|Green color of beam is greater than value|
 +|color.blue.less|float|Blue color of beam is less than value|
 +|color.blue.greater|float|Blue color of beam is greater than value|
 +|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='vrHandLaserPointer.check'>
 +    <parameter name='intensity.less'>0.5</parameter>
 +  </action>
 +  <!-- actions here run only if intensity of beam is less than 50% -->
 +</sequence>
 +</code>
 +
 +====== Behavior Tree Conditions ======
 +
 +This behavior adds these behavior tree conditions if behavior tree is present. If behavior has non-empty identifier replace ''vrHandLaserPointer'' with ''vrHandLaserPointer(id)''.
 +
 +===== vrHandLaserPointer.check =====
 +
 +Check one or more VR hand laser pointer parameters. Conditions returns true if all parameter value match their respective VR hand laser pointer parameter. This condition is typically used to run an action or sequence of actions as long as VR hand laser pointer conditions are true.
 +
 +^Parameter^Value^Description^
 +|vrHandLaserPointer.length.less|float|Length of beam is less than value meters|
 +|vrHandLaserPointer.length.greater|float|Length of beam is greater than value meters|
 +|vrHandLaserPointer.intensity.less|float|Intensity of beam is less than value meters|
 +|vrHandLaserPointer.intensity.greater|float|Intensity of beam is greater than value meters|
 +|vrHandLaserPointer.color.red.less|float|Red color of beam is less than value|
 +|vrHandLaserPointer.color.red.greater|float|Red color of beam is greater than value|
 +|vrHandLaserPointer.color.green.less|float|Green color of beam is less than value|
 +|vrHandLaserPointer.color.green.greater|float|Green color of beam is greater than value|
 +|vrHandLaserPointer.color.blue.less|float|Blue color of beam is less than value|
 +|vrHandLaserPointer.color.blue.greater|float|Blue color of beam is greater than value|
 +
 +This is an example of using this condition:
 +<code xml>
 +<action name='myAction' id='doing something'>
 +  <parameter name='vrHandLaserPointer.intensity.less'>0.5</parameter>
 +  <condition>vrHandLaserPointer.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 no state machine events.
  
 ====== Required Behaviors ====== ====== Required Behaviors ======
Line 112: Line 199:
 ====== 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 189: Line 277:
   <behavior type='ECBehaviorVRHandPointAt' id='left'>   <behavior type='ECBehaviorVRHandPointAt' id='left'>
     <string name='vrHand'>left</string>     <string name='vrHand'>left</string>
 +    
 +    <!-- optional: add behavior trees. default adds all behavior trees. -->
 +    <list name='behaviorTrees'>
 +      <string/> <!-- add behavior with empty identifier -->
 +      <string>default</string> <!-- add behavior with 'default' identifier -->
 +    </list>
 +    
 +    <!-- optional: add state machines. default adds all state machines. -->
 +    <list name='stateMachines'>
 +      <string/> <!-- add behavior with empty identifier -->
 +      <string>default</string> <!-- add behavior with 'default' identifier -->
 +    </list>
   </behavior>   </behavior>
    
dragengine/modules/dragonscript/behavior_vrhandlaserpointer.txt · Last modified: 2025/05/14 10:44 by dragonlord