Interface PhysicsControl

All Superinterfaces:
com.jme3.scene.control.Control, com.jme3.export.Savable
All Known Implementing Classes:
AbstractPhysicsControl, BetterCharacterControl, CharacterControl, DacConfiguration, DacLinks, DynamicAnimControl, GhostControl, JoinedBodyControl, RigidBodyControl, SoftBodyControl, VehicleControl

public interface PhysicsControl extends com.jme3.scene.control.Control
An interface for a scene-graph control that links physics object(s) to a Spatial.
  • Method Summary

    Modifier and Type
    Method
    Description
    Access the PhysicsSpace to which the physics objects are (or would be) added.
    boolean
    Test whether this control is enabled.
    void
    setEnabled(boolean state)
    Enable or disable this control.
    void
    If this control is enabled, add its physics objects to the specified PhysicsSpace.

    Methods inherited from interface com.jme3.scene.control.Control

    cloneForSpatial, render, setSpatial, update

    Methods inherited from interface com.jme3.export.Savable

    read, write
  • Method Details

    • getPhysicsSpace

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

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

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

      The physics objects are removed from its PhysicsSpace when the control is disabled. When the control is enabled again, the physics objects are moved to the current location of the Spatial and then added to the PhysicsSpace.

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

      void setPhysicsSpace(PhysicsSpace space)
      If this control is enabled, add its physics objects to the specified PhysicsSpace. If not enabled, alter where the objects would be added. The objects are removed from any other space they're currently in.
      Parameters:
      space - where to add, or null to simply remove