User Tools

Site Tools


democap:behavior_ecbtogglevisibility

ECBToggleVisibility

Behavior adding support to toggle visibility of element and to reposition it. Positions element in front of HMD, hand point-at or custom origin matrix at fixed distance facing the actor. Optionally the up axis can be locked.

Instance Counts

This behavior can be used only once on an element.

Element Class Properties

Element class properties have the prefix toggleVisibility..

lockUpAxis

Look-up axis to use or null. Aligns object up axis with look-up axis if not null. Used for example on VR mirrors.

  • Full name: toggleVisibility.lockUpAxis
  • Type: 3-component float vector
  • Default Value: null
  • Example (*.deeclass)
    <vector name='toggleVisibility.lockUpAxis' x='0' y='1' z='0'/>

pivot

Pivot position to use or null. Object is shown at the pivot position and rotated until in the desired position. Used for example on teleporting to show actor orientation if teleported.

  • Full name: toggleVisibility.pivot
  • Type: 3-component float vector
  • Default Value: null
  • Example (*.deeclass)
    <vector name='toggleVisibility.pivot' x='0' y='0.2' z='0'/>

rotation

Rotation in degrees to use or null.

  • Full name: toggleVisibility.rotation
  • Type: 3-component float vector
  • Default Value: (0, 0, 0)
  • Example (*.deeclass)
    <vector name='toggleVisibility.rotation' x='90' y='0' z='0'/>

distance

Distance to pivot position.

  • Full name: toggleVisibility.distance
  • Type: float
  • Default Value: 0.5
  • Restriction: At least 0
  • Example (*.deeclass)
    <float name='toggleVisibility.distance'>0.5</float>

lockZRotation

Lock Z-rotation. Aligns Z-axis rotation of object with user camera tilting. Used for example on VR menu.

  • Full name: toggleVisibility.lockZRotation
  • Type: boolean
  • Default Value: false
  • Example (*.deeclass)
    <boolean name='toggleVisibility.lockZRotation'>false</boolean>

scaleWithActor

Scale with actor scale. Applies actor scaling to behavior parameters like pivot position and distance. Used for example on VR menu.

  • Full name: toggleVisibility.scaleWithActor
  • Type: boolean
  • Default Value: false
  • Example (*.deeclass)
    <boolean name='toggleVisibility.scaleWithActor'>false</boolean>

Events

This behavior has no events.

Conversation Commands

This behavior adds no conversation commands.

Conversation Conditions

This behavior adds no conversation conditions.

Behavior Tree Actions

This behavior adds no behavior tree actions.

Behavior Tree Conditions

This behavior adds no behavior tree conditions.

Required Behaviors

This behavior requires no other behaviors.

Optional Behaviors

This behavior does not support optional behaviors.

API Documentation

Since DEMoCap Version 1.3

Use Cases

  • Allow user to show object in front of actor.

Element Class Example

class MyElement extends BehaviorElementClass
  public var ECBToggleVisibility toggleVisibility
  func new()
    toggleVisibility = ECBToggleVisibility.new(this, component)
  end
end

Behavior Factory

Using element class supporting adding behaviors the behavior can be added like this (again create an example which creates a valid element class):

<?xml version='1.0' encoding='UTF-8'?>
<elementClass name='MyClass' class='GenericBehaviorElement'>
  <behavior type='ECBToggleVisibility'>
    <!-- set element properties. omit property prefix if used inside behavior tag -->
    <vector name='.lockUpAxis' x='0' y='1' z='0'/>
  </behavior>
</elementClass>

Live Examples

You could leave a comment if you were logged in.
democap/behavior_ecbtogglevisibility.txt · Last modified: 2025/03/22 18:15 by dragonlord