Module groPhysics

Class PhysicsModel

All Implemented Interfaces:
Manageable, PersistenceCapable, Shareable, UserFields, XObject, Map, Serializable

public class PhysicsModel extends Node
See Also:
  • Field Details

    • dynamicWorld

      protected com.bulletphysics.dynamics.DynamicsWorld dynamicWorld
    • debugText

      public boolean debugText
    • utils

      public final PhysicsUtils utils
    • $TYPE

      public static final Node.NType $TYPE
    • debugText$FIELD

      public static final Node.NType.Field debugText$FIELD
    • massObjects$FIELD

      public static final Node.NType.Field massObjects$FIELD
  • Constructor Details

    • PhysicsModel

      public PhysicsModel()
  • Method Details

    • init

      protected void init()
    • initVisitor

      public void initVisitor()
    • addGround

      protected void addGround(float size, float depth)
    • add

      public void add(Object o)
    • add

      public void add(String name, Object o)
    • add

      public void add(Object o, float mass)
    • add

      public void add(String name, Object o, float mass)
    • remove

      public void remove(Object o)
    • setMass

      public void setMass(Object o, float mass)
    • updateReference

      public void updateReference(String name, Object o)
    • getMass

      public float getMass(Object o)
    • addDeferred

      protected void addDeferred(MassObject m)
    • updatePosition

      protected void updatePosition(MassObject m)
    • createCylinder

      protected com.bulletphysics.dynamics.RigidBody createCylinder(MassObject mo, Object o, float l, float r)
    • join

      protected void join(FlexNode flexNode, MassObject massObject, com.bulletphysics.dynamics.RigidBody body)
    • joinToBodyFrame

      protected void joinToBodyFrame(FlexNode flexNode, com.bulletphysics.linearmath.Transform jointFrame, com.bulletphysics.dynamics.RigidBody body, com.bulletphysics.dynamics.RigidBody parentBody)
    • joinToParent

      protected void joinToParent(FlexNode flexNode, FlexNode parentFlexNode, com.bulletphysics.dynamics.RigidBody body, com.bulletphysics.dynamics.RigidBody parentBody)
    • getNodeName

      public String getNodeName(Node n)
    • step

      public void step()
      perform a default 0.1s time step
    • step

      public void step(float stepTime)
      perform a time step
    • isActive

      public boolean isActive()
      true if any objects are still moving
    • activeCount

      public int activeCount()
      returns the number of objects are still moving
    • clear

      public void clear()
    • getPreviousFlexNode

      public FlexNode getPreviousFlexNode(Node node)
      Find the previous FlexNode in the current branch returns null if nothing is found
      Returns:
      FlexNode
    • getParentFlexNode

      public FlexNode getParentFlexNode(Node node)
      Find the previous FlexNode in the tree by searching the branch first, then hierarchically through it's parents returns null if nothing is found
      Returns:
      FlexNode
    • getPreviousMassObject

      public MassObject getPreviousMassObject(Node node)
      Find the previous FlexNode in the current branch returns null if nothing is found
      Returns:
      MassObject
    • getParentMassObject

      public MassObject getParentMassObject(Node node)
      Find the previous FlexNode in the tree by searching the branch first, then hierarchically through it's parents returns null if nothing is found
      Returns:
      MassObject
    • getNTypeImpl

      protected Node.NType getNTypeImpl()
      Description copied from class: Node
      This method returns the Node.NType which describes the managed fields of the class of this node. This method has to be implemented in every concrete subclass.
      Overrides:
      getNTypeImpl in class Node
      Returns:
      type describing the managed fields of the class of this node
    • newInstance

      protected Node newInstance()
      Description copied from class: Node
      This method returns a new instance of the class of this node. This method has to be implemented in every concrete subclass.
      Overrides:
      newInstance in class Node
      Returns:
      new instance of class of this node
    • isDebugText

      public boolean isDebugText()
    • setDebugText

      public void setDebugText(boolean value)
    • getMassObjects

      public ArrayList<MassObject> getMassObjects()
    • setMassObjects

      public void setMassObjects(ArrayList<MassObject> value)