User Tools

Site Tools


dragengine:modules:dragonscript:behavior_vrhandaction

Differences

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

Link to this comparison view

Next revision
Previous revision
dragengine:modules:dragonscript:behavior_vrhandaction [2022/03/02 20:57] – created dragonlorddragengine:modules:dragonscript:behavior_vrhandaction [2025/03/13 17:17] (current) dragonlord
Line 1: Line 1:
 {{tag>dragonscript behavior}} {{tag>dragonscript behavior}}
 <WRAP youarehere> <WRAP youarehere>
-[[:start|Start Page]] >> [[main|DragonScript Scripting Language]] >> [[abstractions#behavior_elementsquick_and_easy_development|Behavior Elements: Quick and Easy Development]] >> **ECBehaviorVRHandAction**+[[:start|Start Page]] >> [[main|DragonScript Scripting Language]] >> [[dragengine:modules:dragonscript:abstractions|Abstraction Layers: How you want to build your Game]] >> [[dragengine:modules:dragonscript:behavior_elements|Behavior Elements]] >> **ECBehaviorVRHandAction**
 </WRAP> </WRAP>
  
Line 11: Line 11:
 Behavior adding Action support to VR hands. Behavior adding Action support to VR hands.
  
-Allows instance of [[https://developer.dragondreams.ch/docs/dragonscript/scriptapi/latest/classDragengine_1_1Scenery_1_1BaseVRHandAction.html|BaseVRHandAction]] to be assigned to actor VR hands. During thinking the Action is called.+Allows instance of #@LinkApiDocDEDS2_HTML~classDragengine_1_1Scenery_1_1BaseVRHandAction.html,BaseVRHandAction~@# to be assigned to actor VR hands. During thinking the Action is called.
  
-Actions allow actors to perform a specific, well defined and enclosed action like interacting with an object for each hand separately. These actions run after the main actor action as provided by [[https://developer.dragondreams.ch/docs/dragonscript/scriptapi/latest/classDragengine_1_1Scenery_1_1ECBehaviorActorAIAction.html|ECBehaviorActorAIAction]]. VR hand actions are typically  nly suitable for the player.+Actions allow actors to perform a specific, well defined and enclosed action like interacting with an object for each hand separately. These actions run after the main actor action as provided by #@LinkApiDocDEDS2_HTML~classDragengine_1_1Scenery_1_1ECBehaviorActorAIAction.html,ECBehaviorActorAIAction~@#. VR hand actions are typically  nly suitable for the player.
  
 ====== Instance Counts ====== ====== Instance Counts ======
Line 21: Line 21:
 ====== Element Class Properties ====== ====== Element Class Properties ======
  
-Element class properties have the prefix **vrHandAction.** or **vrHandAction(id).** if id is not empty.+Element class properties have the prefix ''vrHandAction.'' or ''vrHandAction(id).'' if id is not empty.
  
 Thie behavior adds no element class properties. Thie behavior adds no element class properties.
  
-Using this behavior in code you should call ECBehaviorVRHandAction.setActionFactory() to set the factory creating the initial action for the hand to use. By default an instance of [[https://developer.dragondreams.ch/docs/dragonscript/scriptapi/latest/classDragengine_1_1Scenery_1_1BaseVRHandAction.html|BaseVRHandAction]] is used.+Using this behavior in code you should call ECBehaviorVRHandAction.setActionFactory() to set the factory creating the initial action for the hand to use. By default an instance of #@LinkApiDocDEDS2_HTML~classDragengine_1_1Scenery_1_1BaseVRHandAction.html,BaseVRHandAction~@# is used
 + 
 +====== Events ====== 
 + 
 +This behavior has no events.
  
 ====== Required Behaviors ====== ====== Required Behaviors ======
Line 37: Line 41:
 ====== Persistency ====== ====== Persistency ======
  
-Saves these parameters: +This behavior does support element class to be persistable (setPersistable).
-  * Active Action+
  
 ====== API Documentation ====== ====== API Documentation ======
  
-[[https://developer.dragondreams.ch/docs/dragonscript/scriptapi/latest/classDragengine_1_1Scenery_1_1ECBehaviorVRHandAction.html|ECBehaviorVRHandAction]].+#@LinkApiDocDEDS2_HTML~classDragengine_1_1Scenery_1_1ECBehaviorVRHandAction.html,ECBehaviorVRHandAction~@#.
  
-Since DragonScript Module Version **1.10**+Since DragonScript Module Version ''1.10''
  
 ====== Use Cases ====== ====== Use Cases ======
Line 52: Line 55:
 ====== Element Class Example ====== ====== Element Class Example ======
  
-The [[https://developer.dragondreams.ch/docs/dragonscript/scriptapi/latest/classDragengine_1_1Scenery_1_1BaseVRActorClass.html|BaseVRActorClass]] provides support for right and left hand actions. See BaseVRActorClass.getVRRightHandAction() and BaseVRActorClass.getVRLeftHandAction() to get access to the behaviors on class side and BaseVRActor.getVRRightHandAction() and BaseVRActor.getVRLeftHandAction() to access the behavior instance on actor instance side.+The #@LinkApiDocDEDS2_HTML~classDragengine_1_1Scenery_1_1BaseVRActorClass.html,BaseVRActorClass~@# provides support for right and left hand actions. See BaseVRActorClass.getVRRightHandAction() and BaseVRActorClass.getVRLeftHandAction() to get access to the behaviors on class side and BaseVRActor.getVRRightHandAction() and BaseVRActor.getVRLeftHandAction() to access the behavior instance on actor instance side.
  
 The following example creates an element class adding the action elements manually. The following example creates an element class adding the action elements manually.
Line 134: Line 137:
   end   end
 end end
 +</code>
 +
 +====== Behavior Factory ======
 +
 +Using element class supporting adding behaviors the behavior can be added like this:
 +<code xml>
 +<?xml version='1.0' encoding='UTF-8'?>
 +<elementClass name='MyClass' class='GenericBehaviorElement'>
 +  <behavior type='ECBehaviorVRPlayspace'/>
 +  <behavior type='ECBehaviorVRHand' id='right'/>
 +  <behavior type='ECBehaviorVRHand' id='left'/>
 +  <behavior type='ECBehaviorVRHandPointAt' id='right'>
 +    <string name='vrHand'>right</string>
 +  </behavior>
 +  <behavior type='ECBehaviorVRHandPointAt' id='left'>
 +    <string name='vrHand'>left</string>
 +  </behavior>
 +  
 +  <behavior type='ECBehaviorVRHandAction' id='right'>
 +    <!-- required: use vr hand with id. -->
 +    <string name='vrHand'>right</string>
 +    
 +    <!-- set element properties. omit property prefix if used inside behavior tag -->
 +    <string name='.name'>value</string>
 +  </behavior>
 +  
 +  <behavior type='ECBehaviorVRHandAction' id='left'>
 +    ...
 +  </behavior>
 +</elementClass>
 </code> </code>
  
dragengine/modules/dragonscript/behavior_vrhandaction.1646254666.txt.gz · Last modified: 2022/03/02 20:57 by dragonlord