Start Page » DEMoCap: Drag[en]gine Motion Capture » XML Element Classes » ECBColliderPhysics
Behavior controlling physics parameter of controllers. Element class sets if colliders should be set to dynamic physics response or kinematic physics response. User can change this behavior for example when constructing own objects.
This behavior takes care of enabling/disabling the physics behavior on an array of ECBehaviorCollider depending on the current playback/recording state. During recording physics behavior is enabled. Otherwise physics is disabled. If the user enabled live physics then physics will be also enabled outside recording unless playing back.
Furthermore this behavior copies component bones to physics bones upon switching states to ensure the result is correct.
The weight of the entire element can be set. This is used as the total mass of all colliders. The mass of each collider is scaled uniformly to match the desired value.
This behavior can be used only once on an element.
Element class properties have the prefix colliderPhysics.
.
Enable physics while recording.
colliderPhysics.usePhysics
false
<boolean name='colliderPhysics.usePhysics'>false</boolean>
Enable physics while not recording, playing back nor preparing to capture. Basically this means while setting up scenes and object properties.
colliderPhysics.livePhysics
false
<boolean name='colliderPhysics.livePhysics'>false</boolean>
Physically reacts to actor touching object with any part of his body. Disable to unintentionally move or tip over objects the actor just has to grab to interact with.
colliderPhysics.touchActor
true
<boolean name='colliderPhysics.touchActor'>true</boolean>
Use local gravity defined by gravity
instea of world gravity.
colliderPhysics.useLocalGravity
false
<boolean name='colliderPhysics.useLocalGravity'>false</boolean>
Gravity to use instead of world gravity if useLocalGravity
is enabled.
colliderPhysics.gravity
(0, 0, 0)
<vector name='colliderPhysics.gravity' x='0' y='0' z='0'/>
Mass in kg of object. Mass is split across all dynamic object bones relative to their mass distribution set in the rig resource.
colliderPhysics.weight
1
0
<float name='colliderPhysics.weight'>1</float>
Actor can grab physics bones of object.
colliderPhysics.canGrabActor
true
<boolean name='colliderPhysics.canGrabActor'>true</boolean>
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 requires no other behaviors.
Since DEMoCap Version 1.3
class MyElement extends BehaviorElementClass public var ECBehaviorComponent component public var ECBehaviorCollider collider public var ECBBehaviorGuiPanels guiPanels public var ECBCapturedAnimations capturedAnimations public var ECBColliderPhysics colliderPhysics func new() component = ECBehaviorComponent.new(this, null) collider = ECBehaviorCollider.new(this, component) guiPanels = ECBBehaviorGuiPanels.new(this) capturedAnimations = ECBCapturedAnimations.new(this, guiPanels, component, collider) colliderPhysics = ECBColliderPhysics.new(this, guiPanels, collider) colliderPhysics.capturedAnimations = capturedAnimations 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='ECBBehaviorGuiPanels'/> <behavior type='ECBCapturedAnimations'/> <behavior type='ECBColliderPhysics'> <!-- 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 --> <boolean name='.touchActor'>false</boolean> </behavior> </elementClass>