User Tools

Site Tools


dragengine:modules:dragonscript:behavior_vrhandpointat

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_vrhandpointat [2021/11/04 19:17] – created dragonlorddragengine:modules:dragonscript:behavior_vrhandpointat [2025/03/12 22:39] (current) dragonlord
Line 25: Line 25:
 ====== Element Class Properties ====== ====== Element Class Properties ======
  
-Element class properties have the prefix **vrHandPointAt.** or **vrHandPointAt(id).** if id is not empty.+Element class properties have the prefix ''vrHandPointAt.'' or ''vrHandPointAt(id).'' if id is not empty.
  
 ===== range ===== ===== range =====
 Range in meters to test for objects supporting to be pointed at. Range in meters to test for objects supporting to be pointed at.
-  * Full name: "vrHandPointAt.rangeor "vrHandPointAt(id).range"+  * Full name: ''vrHandPointAt.range'' or ''vrHandPointAt(id).range''
   * Type: float   * Type: float
-  * Restrictions: Large than or equal to +  * Restrictions: At least 
-  * Default Value: 2+  * Default Value: ''2''
   * Example (*.deeclass): <code xml><float name='vrHandPointAt(right).range'>3.5</float></code>   * Example (*.deeclass): <code xml><float name='vrHandPointAt(right).range'>3.5</float></code>
  
 ===== origin ===== ===== origin =====
 Test origin relative to hand controller coordinate system. Test origin relative to hand controller coordinate system.
-  * Full name: "vrHandPointAt.originor "vrHandPointAt(id).origin" +  * Full name: ''vrHandPointAt.origin'' or ''vrHandPointAt(id).origin'' 
-  * Type: vector +  * Type: 3-component vector 
-  * Default value: //(0, 0, 0)// +  * Default value: ''(0, 0, 0)'' 
-  * Example (*.deeclass): <code xml><vector name='vrHand(left).origin' x='0' y='0.1' z='0.2'/></code>+  * Example (*.deeclass): <code xml><vector name='vrHandPointAt(left).origin' x='0' y='0.1' z='0.2'/></code>
  
 ===== rotation ===== ===== rotation =====
 Test rotation in degrees relative to hand controller coordinate system. Test rotation in degrees relative to hand controller coordinate system.
-  * Full name: "vrHandPointAt.rotationor "vrHandPointAt(id).rotation" +  * Full name: ''vrHandPointAt.rotation'' or ''vrHandPointAt(id).rotation'' 
-  * Type: vector +  * Type: 3-component vector 
-  * Default value: //(0, 0, 0)// +  * Default value: ''(0, 0, 0)'' 
-  * Example (*.deeclass): <code xml><vector name='vrHand(left).rotation' x='45' y='0' z='0'/></code>+  * Example (*.deeclass): <code xml><vector name='vrHandPointAt(left).rotation' x='45' y='0' z='0'/></code>
  
 ===== bone ===== ===== bone =====
 Name of bone in controller model to attach to or empty string to attach to the controller itself. Name of bone in controller model to attach to or empty string to attach to the controller itself.
-  * Full name: "vrHandPointAt.boneor "vrHandPointAt(id).bone"+  * Full name: ''vrHandPointAt.bone'' or ''vrHandPointAt(id).bone''
   * Type: string   * Type: string
-  * Default Value: //""//+  * Default Value: empty string
   * Example (*.deeclass): <code xml><string name='vrHandPointAt(right).bone'>indexFinger</string></code>   * Example (*.deeclass): <code xml><string name='vrHandPointAt(right).bone'>indexFinger</string></code>
  
Line 66: Line 66:
 ====== Persistency ====== ====== Persistency ======
  
-Saves these parameters: +This behavior does support element class to be persistable (setPersistable).
-  * Range +
-  * Test origin +
-  * Test rotation+
  
 ====== API Documentation ====== ====== API Documentation ======
  
-[[https://developer.dragondreams.ch/docs/dragonscript/scriptapi/latest/classDragengine_1_1Scenery_1_1ECBehaviorVRHand.html|ECBehaviorVRHand]].+#@LinkApiDocDEDS2_HTML~classDragengine_1_1Scenery_1_1ECBehaviorVRHand.html,ECBehaviorVRHand~@#.
  
-Since DragonScript Module Version **1.7**+Since DragonScript Module Version ''1.7''
  
 ====== Use Cases ====== ====== Use Cases ======
Line 118: Line 115:
 </code> </code>
  
-The [[https://developer.dragondreams.ch/docs/dragonscript/scriptapi/latest/classDragengine_1_1Scenery_1_1BaseVRActorClass.html|BaseVRActorClass]] provides full VR support including ECBehaviorVRHandPointAt for both hands.+The #@LinkApiDocDEDS2_HTML~classDragengine_1_1Scenery_1_1BaseVRActorClass.html,BaseVRActorClass~@# provides full VR support including ECBehaviorVRHandPointAt for both hands. 
 + 
 +====== 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'> 
 +    <!-- required: use vr hand with id. --> 
 +    <string name='vrHand'>right</string> 
 +     
 +    <!-- optional: set collision filter. default value '1:0 1 2' which means 
 +                   category BaseGameApp.CollisionFilterBit.dynamic 
 +                   filter BaseGameApp.CollisionFilterBit.geometry, 
 +                          BaseGameApp.CollisionFilterBit.dynamic, 
 +                          BaseGameApp.CollisionFilterBit.actor. 
 +                   format is '', 'category' or 'category:filter' where category and filter 
 +                   are a list of bits to set. --> 
 +    <string name='collisionFilter'>6:0 1 2 3 5</string> 
 +     
 +    <!-- set element properties. omit property prefix if used inside behavior tag --> 
 +    <string name='.name'>value</string> 
 +  </behavior> 
 +   
 +  <behavior type='ECBehaviorVRHandPointAt' id='left'> 
 +    ... 
 +  </behavior> 
 +</elementClass> 
 +</code>
  
 ====== Live Examples ====== ====== Live Examples ======
  
   * [[https://github.com/LordOfDragons/deexamples|DEExamples Repository]]: ExampleVR project.   * [[https://github.com/LordOfDragons/deexamples|DEExamples Repository]]: ExampleVR project.
dragengine/modules/dragonscript/behavior_vrhandpointat.1636053449.txt.gz · Last modified: 2021/11/04 19:17 by dragonlord