User Tools

Site Tools


democap:behavior_ecbhighlightpointedat

ECBHighlightPointedAt

Behavior adding support to highlight element if pointed at by the user. Uses ECBehaviorOutline to do the highlighting in response to ECBehaviorVRHandPointedAt events.

Instance Counts

This behavior can be used only once on an element.

Element Class Properties

Element class properties have the prefix highlightPointedAt..

outline(highlightPointedAt).*

Set properties of ECBehaviorOutline behavior added by this behavior. use property prefix myBehavior.outline(highlightPointedAt). for these properties.

Sets these default values:

  • myBehavior.outline(highlightPointedAt).skin = /content/materials/outline/outlinePointAt.deskin'

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

Optional Behaviors

This behavior does not support optional behaviors.

API Documentation

Since DEMoCap Version 1.3

Use Cases

  • Highlight object if pointed at by actor.

Element Class Example

class MyElement extends BehaviorElementClass
  public var ECBehaviorComponent component
  public var ECBehaviorCollider collider
  public var ECBehaviorVRHandPointedAt vrHandPointedAt
  public var ECBHighlightPointedAt highlightPointedAt
  func new()
    component = ECBehaviorComponent.new(this, null)
    collider = ECBehaviorCollider.new(this, component)
    vrHandPointedAt = ECBehaviorVRHandPointedAt.new(this)
    highlightPointedAt = ECBHighlightPointedAt.new(this, component, collider, vrHandPointedAt)
  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='ECBehaviorComponent'/>
  <behavior type='ECBehaviorCollider'/>
  <behavior type='ECBehaviorVRHandPointedAt'/>
 
  <behavior type='ECBHighlightPointedAt'>
    <!-- optional: use component with id instead of empty string -->
    <string name='component'>second</string>
 
    <!-- set element properties. omit property prefix if used inside behavior tag -->
    <string name='.outline(highlightPointedAt).skin'>/content/materials/outline/outlinePointAt.deskin</string>
  </behavior>
</elementClass>

Live Examples

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