Table of Contents

, ,

Start Page » DEMoCap: Drag[en]gine Motion Capture » XML Element Classes » ECBColliderPhysics

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.

Instance Counts

This behavior can be used only once on an element.

Element Class Properties

Element class properties have the prefix colliderPhysics..

usePhysics

Enable physics while recording.

livePhysics

Enable physics while not recording, playing back nor preparing to capture. Basically this means while setting up scenes and object properties.

touchActor

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.

useLocalGravity

Use local gravity defined by gravity instea of world gravity.

gravity

Gravity to use instead of world gravity if useLocalGravity is enabled.

weight

Mass in kg of object. Mass is split across all dynamic object bones relative to their mass distribution set in the rig resource.

canGrabActor

Actor can grab physics bones of object.

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

API Documentation

Since DEMoCap Version 1.3

Use Cases

Element Class Example

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

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='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>

Live Examples