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 [2024/03/14 16:51] dragonlorddragengine:modules:dragonscript:behavior_vrhandlaserpointer [2025/03/12 22:36] (current) dragonlord
Line 22: Line 22:
   * blue: Blue color component of beam.   * blue: Blue color component of beam.
  
-Additional named controllers can be added if required. The default particle emitter used is ///shareddata/particles/laserpointer/laserpointer.depemit//. This particle emitter defines the controller ranges like this:+Additional named controllers can be added if required. The default particle emitter used is ''/shareddata/particles/laserpointer/laserpointer.depemit''. This particle emitter defines the controller ranges like this:
   * length: Between 0m to 10m.   * length: Between 0m to 10m.
   * intensity: Between 0 to 1. The beam skin uses camera adapted intensity hence 1 represents full bright intensits compared to camera upper intensity.   * intensity: Between 0 to 1. The beam skin uses camera adapted intensity hence 1 represents full bright intensits compared to camera upper intensity.
Line 37: Line 37:
 ====== Element Class Properties ====== ====== Element Class Properties ======
  
-Element class properties have the prefix **vrHandLaserPointer.** or **vrHandLaserPointer(id).** if id is not empty.+Element class properties have the prefix ''vrHandLaserPointer.'' or ''vrHandLaserPointer(id).'' if id is not empty.
  
 ===== particleEmitter.* ===== ===== particleEmitter.* =====
-This behavior adds a child [[behavior_particleemitter|ECBehaviorParticleEmitter]] to the element class to show the laser pointer in the game world. The child behavior has the identifier "vrHandLaserPointeror "vrHandLaserPointer(id)". The child behavior has the element class property prefix "vrHandLaserPointer.particleEmitter.or "vrHandLaserPointer(id).particleEmitter.".+This behavior adds a child [[behavior_particleemitter|ECBehaviorParticleEmitter]] to the element class to show the laser pointer in the game world. The child behavior has the identifier ''vrHandLaserPointer'' or ''vrHandLaserPointer(id)''. The child behavior has the element class property prefix ''vrHandLaserPointer.particleEmitter.'' or ''vrHandLaserPointer(id).particleEmitter.'' .
  
-Hence to set for example the particle emitter of the right hand use the element class property "vrHandLaserPointer(right).particleEmitter.path"+Hence to set for example the particle emitter of the right hand use the element class property ''vrHandLaserPointer(right).particleEmitter.path'' .
  
 ===== controllerLength ===== ===== controllerLength =====
 Name of particle emitter controller to update with laserpointer length or empty string if not used. Name of particle emitter controller to update with laserpointer length or empty string if not used.
-  * Full name: "vrHandLaserPointer.controllerLengthor "vrHandLaserPointer(id).controllerLength"+  * Full name: ''vrHandLaserPointer.controllerLength'' or ''vrHandLaserPointer(id).controllerLength''
   * Type: string   * Type: string
-  * Default Value: //"length"//+  * Default Value: ''length''
   * Example (*.deeclass): <code xml><string name='vrHandLaserPointer(right).controllerLength'>length</string></code>   * Example (*.deeclass): <code xml><string name='vrHandLaserPointer(right).controllerLength'>length</string></code>
  
 ===== controllerIntensity ===== ===== controllerIntensity =====
 Name of particle emitter controller to update with laserpointer intensity or empty string if not used. Name of particle emitter controller to update with laserpointer intensity or empty string if not used.
-  * Full name: "vrHandLaserPointer.controllerIntensityor "vrHandLaserPointer(id).controllerIntensity"+  * Full name: ''vrHandLaserPointer.controllerIntensity'' or ''vrHandLaserPointer(id).controllerIntensity''
   * Type: string   * Type: string
-  * Default Value: //"intensity"//+  * Default Value: ''intensity''
   * Example (*.deeclass): <code xml><string name='vrHandLaserPointer(right).controllerIntensity'>intensity</string></code>   * Example (*.deeclass): <code xml><string name='vrHandLaserPointer(right).controllerIntensity'>intensity</string></code>
  
 ===== controllerRed ===== ===== controllerRed =====
 Name of particle emitter controller to update with laserpointer red color component or empty string if not used. Name of particle emitter controller to update with laserpointer red color component or empty string if not used.
-  * Full name: "vrHandLaserPointer.controllerRedor "vrHandLaserPointer(id).controllerRed"+  * Full name: ''vrHandLaserPointer.controllerRed'' or ''vrHandLaserPointer(id).controllerRed''
   * Type: string   * Type: string
-  * Default Value: //"red"//+  * Default Value: ''red''
   * Example (*.deeclass): <code xml><string name='vrHandLaserPointer(right).controllerRed'>red</string></code>   * Example (*.deeclass): <code xml><string name='vrHandLaserPointer(right).controllerRed'>red</string></code>
  
 ===== controllerGreen ===== ===== controllerGreen =====
 Name of particle emitter controller to update with laserpointer green color component or empty string if not used. Name of particle emitter controller to update with laserpointer green color component or empty string if not used.
-  * Full name: "vrHandLaserPointer.controllerGreenor "vrHandLaserPointer(id).controllerGreen"+  * Full name: ''vrHandLaserPointer.controllerGreen'' or ''vrHandLaserPointer(id).controllerGreen''
   * Type: string   * Type: string
-  * Default Value: //"green"//+  * Default Value: ''green''
   * Example (*.deeclass): <code xml><string name='vrHandLaserPointer(right).controllerGreen'>green</string></code>   * Example (*.deeclass): <code xml><string name='vrHandLaserPointer(right).controllerGreen'>green</string></code>
  
 ===== controllerBlue ===== ===== controllerBlue =====
 Name of particle emitter controller to update with laserpointer blue color component or empty string if not used. Name of particle emitter controller to update with laserpointer blue color component or empty string if not used.
-  * Full name: "vrHandLaserPointer.controllerBlueor "vrHandLaserPointer(id).controllerBlue"+  * Full name: ''vrHandLaserPointer.controllerBlue'' or ''vrHandLaserPointer(id).controllerBlue''
   * Type: string   * Type: string
-  * Default Value: //"blue"//+  * Default Value: ''blue''
   * Example (*.deeclass): <code xml><string name='vrHandLaserPointer(right).controllerBlue'>blue</string></code>   * Example (*.deeclass): <code xml><string name='vrHandLaserPointer(right).controllerBlue'>blue</string></code>
  
 ===== length ===== ===== length =====
 Length in meters of laser pointer. Length in meters of laser pointer.
-  * Full name: "vrHandLaserPointer.lengthor "vrHandLaserPointer(id).length"+  * Full name: ''vrHandLaserPointer.length'' or ''vrHandLaserPointer(id).length''
   * Type: float   * Type: float
-  * Restrictions: Greater than or equal to +  * Restrictions: At least 
-  * Default Value: 10+  * Default Value: ''10''
   * Example (*.deeclass): <code xml><float name='vrHandLaserPointer(right).length'>15</float></code>   * Example (*.deeclass): <code xml><float name='vrHandLaserPointer(right).length'>15</float></code>
  
 ===== intensity ===== ===== intensity =====
 Intensity of laser pointer. The actual intensity used depends on the particle emitter. Usually particle emitters use camera adapted intensity which maps an intensity of 1 to the camera upper intensity. Intensity of laser pointer. The actual intensity used depends on the particle emitter. Usually particle emitters use camera adapted intensity which maps an intensity of 1 to the camera upper intensity.
-  * Full name: "vrHandLaserPointer.intensityor "vrHandLaserPointer(id).intensity"+  * Full name: ''vrHandLaserPointer.intensity'' or ''vrHandLaserPointer(id).intensity''
   * Type: float   * Type: float
-  * Restrictions: Greater than or equal to +  * Restrictions: At least 
-  * Default Value: 0.4+  * Default Value: ''0.4''
   * Example (*.deeclass): <code xml><float name='vrHandLaserPointer(right).intensity'>0.8</float></code>   * Example (*.deeclass): <code xml><float name='vrHandLaserPointer(right).intensity'>0.8</float></code>
  
 ===== color ===== ===== color =====
 Color of laser pointer. Color of laser pointer.
-  * Full name: "vrHandLaserPointer.coloror "vrHandLaserPointer(id).color" +  * Full name: ''vrHandLaserPointer.color'' or ''vrHandLaserPointer(id).color'' 
-  * Type: color +  * Type: 3-component color 
-  * Default Value: //(0, 1, 1)//+  * Default Value: ''(0, 1, 1)''
   * Example (*.deeclass): <code xml><color name='vrHandLaserPointer(right).color' r='1' g='1' b='0'/></code>   * Example (*.deeclass): <code xml><color name='vrHandLaserPointer(right).color' r='1' g='1' b='0'/></code>
 +
 +====== Events ======
 +
 +This behavior has no events.
  
 ====== Required Behaviors ====== ====== Required Behaviors ======
Line 112: Line 116:
 ====== Persistency ====== ====== Persistency ======
  
-Saves these parameters: +This behavior does support element class to be persistable (setPersistable).
-  * Length +
-  * Intensity +
-  * Color+
  
 ====== API Documentation ====== ====== API Documentation ======
Line 121: Line 122:
 #@LinkApiDocDEDS2_HTML~classDragengine_1_1Scenery_1_1ECBehaviorVRHandLaserPointer.html,ECBehaviorVRHandLaserPointer~@#. #@LinkApiDocDEDS2_HTML~classDragengine_1_1Scenery_1_1ECBehaviorVRHandLaserPointer.html,ECBehaviorVRHandLaserPointer~@#.
  
-Since DragonScript Module Version **1.7**+Since DragonScript Module Version ''1.7''
  
 ====== Use Cases ====== ====== Use Cases ======
Line 173: Line 174:
  
 The #@LinkApiDocDEDS2_HTML~classDragengine_1_1Scenery_1_1BaseVRActorClass.html,BaseVRActorClass~@# provides full VR support including ECBehaviorVRHandLaserPointer for both hands. The #@LinkApiDocDEDS2_HTML~classDragengine_1_1Scenery_1_1BaseVRActorClass.html,BaseVRActorClass~@# provides full VR support including ECBehaviorVRHandLaserPointer 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'>
 +    <string name='vrHand'>right</string>
 +  </behavior>
 +  <behavior type='ECBehaviorVRHandPointAt' id='left'>
 +    <string name='vrHand'>left</string>
 +  </behavior>
 + 
 +  <behavior type='ECBehaviorVRHandLaserPointer' id='right'>
 +    <!-- required: use vr hand point at with id -->
 +    <string name='vrHandPointAt'>right</string>
 + 
 +    <!-- set element properties. omit property prefix if used inside behavior tag -->
 +    <string name='.name'>value</string>
 +  </behavior>
 + 
 +  <behavior type='ECBehaviorVRHandLaserPointer' id='left'>
 +    <string name='vrHandPointAt'>left</string>
 +  </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_vrhandlaserpointer.txt · Last modified: 2025/03/12 22:36 by dragonlord