This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | |||
dragengine:modules:dragonscript:behavior_vrhandlaserpointer [2024/03/14 16:51] – dragonlord | dragengine: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 /// | + | Additional named controllers can be added if required. The default particle emitter used is '' |
* 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 | + | Element class properties have the prefix |
===== 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 | + | 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 |
- | Hence to set for example the particle emitter of the right hand use the element class property | + | Hence to set for example the particle emitter of the right hand use the element class property |
===== 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.controllerLength" | + | * Full name: '' |
* Type: string | * Type: string | ||
- | * Default Value: | + | * Default Value: |
* Example (*.deeclass): | * Example (*.deeclass): | ||
===== 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.controllerIntensity" | + | * Full name: '' |
* Type: string | * Type: string | ||
- | * Default Value: | + | * Default Value: |
* Example (*.deeclass): | * Example (*.deeclass): | ||
===== 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.controllerRed" | + | * Full name: '' |
* Type: string | * Type: string | ||
- | * Default Value: | + | * Default Value: |
* Example (*.deeclass): | * Example (*.deeclass): | ||
===== 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.controllerGreen" | + | * Full name: '' |
* Type: string | * Type: string | ||
- | * Default Value: | + | * Default Value: |
* Example (*.deeclass): | * Example (*.deeclass): | ||
===== 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.controllerBlue" | + | * Full name: '' |
* Type: string | * Type: string | ||
- | * Default Value: | + | * Default Value: |
* Example (*.deeclass): | * Example (*.deeclass): | ||
===== length ===== | ===== length ===== | ||
Length in meters of laser pointer. | Length in meters of laser pointer. | ||
- | * Full name: "vrHandLaserPointer.length" | + | * Full name: '' |
* Type: float | * Type: float | ||
- | * Restrictions: | + | * Restrictions: |
- | * Default Value: 10 | + | * Default Value: |
* Example (*.deeclass): | * Example (*.deeclass): | ||
===== 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.intensity" | + | * Full name: '' |
* Type: float | * Type: float | ||
- | * Restrictions: | + | * Restrictions: |
- | * Default Value: 0.4 | + | * Default Value: |
* Example (*.deeclass): | * Example (*.deeclass): | ||
===== color ===== | ===== color ===== | ||
Color of laser pointer. | Color of laser pointer. | ||
- | * Full name: "vrHandLaserPointer.color" | + | * Full name: '' |
- | * Type: color | + | * Type: 3-component |
- | * Default Value: | + | * Default Value: |
* Example (*.deeclass): | * Example (*.deeclass): | ||
+ | |||
+ | ====== 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: | ||
# | # | ||
- | Since DragonScript Module Version | + | Since DragonScript Module Version |
====== Use Cases ====== | ====== Use Cases ====== | ||
Line 173: | Line 174: | ||
The # | The # | ||
+ | |||
+ | ====== Behavior Factory ====== | ||
+ | |||
+ | Using element class supporting adding behaviors the behavior can be added like this: | ||
+ | <code xml> | ||
+ | <?xml version=' | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | <string name=' | ||
+ | </ | ||
+ | < | ||
+ | <string name=' | ||
+ | </ | ||
+ | |||
+ | < | ||
+ | <!-- required: use vr hand point at with id --> | ||
+ | <string name=' | ||
+ | |||
+ | <!-- set element properties. omit property prefix if used inside behavior tag --> | ||
+ | <string name=' | ||
+ | </ | ||
+ | |||
+ | < | ||
+ | <string name=' | ||
+ | </ | ||
+ | </ | ||
+ | </ | ||
====== Live Examples ====== | ====== Live Examples ====== | ||
* [[https:// | * [[https:// |