Interface PhysicsControl

All Superinterfaces:
Control, Savable
All Known Implementing Classes:
AbstractPhysicsControl, BetterCharacterControl, CharacterControl, DacConfiguration, DacLinks, DynamicAnimControl, GhostControl, KinematicRagdollControl, RigidBodyControl, VehicleControl

public interface PhysicsControl extends Control
An interface for a scene-graph control that links a physics object to a Spatial.

This interface is shared between JBullet and Native Bullet.

  • Method Details

    • setPhysicsSpace

      void setPhysicsSpace(PhysicsSpace space)
      If enabled, add this control's physics object to the specified physics space. In not enabled, alter where the object would be added. The object is removed from any other space it's currently in.
      Parameters:
      space - where to add, or null to simply remove
    • getPhysicsSpace

      PhysicsSpace getPhysicsSpace()
      Access the physics space to which the object is (or would be) added.
      Returns:
      the pre-existing space, or null for none
    • setEnabled

      void setEnabled(boolean state)
      Enable or disable this control.

      The physics object is removed from its physics space when the control is disabled. When the control is enabled again, the physics object is moved to the current location of the spatial and then added to the physics space.

      Parameters:
      state - true→enable the control, false→disable it
    • isEnabled

      boolean isEnabled()
      Test whether this control is enabled.
      Returns:
      true if enabled, otherwise false