Start Page » DEMoCap: Drag[en]gine Motion Capture » XML Element Classes » ECBGrabbedEnableCamera
Behavior adding support to enable camera if grabbed by actor.
This element behavior can be present multiple times in a BehaviorElement. In this case use a unique identifier to distinguish the individual behavior instances.
Element class properties have the prefix grabbedEnableCamera. or grabbedEnableCamera({id}). if id is not empty.
This behavior has no events.
This behavior adds no conversation commands.
This behavior adds no conversation conditions.
This behavior adds no behavior tree actions.
This behavior adds no behavior tree conditions.
This behavior does not support optional behaviors.
Since DEMoCap Version 1.3
class MyElement extends BehaviorElementClass
public var ECBehaviorComponent component
public var ECBehaviorCollider collider
public var ECBehaviorGrabSpot grabSpot
public var ECBehaviorCamera camera
public var ECBehaviorDynamicSkin dynamicSkin
public var ECBehaviorRenderablePanel renderablePanel
public var ECBRenderableCamera renderableCamera
public var ECBGrabbedEnableCamera grabbedEnableCamera
func new()
component = ECBehaviorComponent.new(this)
collider = ECBehaviorCollider.new(this, component)
grabSpot = ECBehaviorGrabSpot.new(this, collider)
grabSpot.getAttachTouchCollider().getPosition().setVector(Vector.new(0, 0, 0.1))
camera = ECBehaviorCamera.new(this, camera)
dynamicSkin = ECBehaviorDynamicSkin.new(this, component)
renderablePanel = ECBehaviorRenderablePanel.new(this, dynamicSkin)
renderablePanel.getRenderable().setValue("board")
renderablePanel.getSize().setPoint(Point.new(512, 256))
renderablePanel.getGuiTheme().setPath("/content/ui/adboard.guitheme.xml")
renderableCamera = ECBRenderableCamera.new(this, renderablePanel, camera)
grabbedEnableCamera = ECBGrabbedEnableCamera.new(this, grabSpot, renderableCamera)
end
end
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='ECBehaviorGrabSpot'/> <behavior type='ECBehaviorCamera'/> <behavior type='ECBehaviorDynamicSkin'/> <behavior type='ECBehaviorRenderablePanel'> <string name='.renderable'>board</string> </behavior> <behavior type='ECBRenderableCamera'/> <behavior type='ECBGrabbedEnableCamera'> <!-- optional: use grab spot with id instead of empty string --> <string name='grabSpot'>second</string> </behavior> <!-- for adding multiple behaviors use unique identifiers --> <behavior type='ECBGrabbedEnableCamera' id='second'/> </elementClass>