Class PhysicsJoint

java.lang.Object
com.jme3.bullet.joints.PhysicsJoint
All Implemented Interfaces:
com.jme3.export.Savable
Direct Known Subclasses:
ConeJoint, HingeJoint, Point2PointJoint, SixDofJoint, SliderJoint

public abstract class PhysicsJoint extends Object implements com.jme3.export.Savable

PhysicsJoint - Basic Physics Joint

Author:
normenhansen
  • Field Details

    • constraint

      protected com.bulletphysics.dynamics.constraintsolver.TypedConstraint constraint
    • nodeA

      protected PhysicsRigidBody nodeA
    • nodeB

      protected PhysicsRigidBody nodeB
    • pivotA

      protected com.jme3.math.Vector3f pivotA
    • pivotB

      protected com.jme3.math.Vector3f pivotB
    • collisionBetweenLinkedBodys

      protected boolean collisionBetweenLinkedBodys
  • Constructor Details

    • PhysicsJoint

      protected PhysicsJoint()
    • PhysicsJoint

      public PhysicsJoint(PhysicsRigidBody nodeA, PhysicsRigidBody nodeB, com.jme3.math.Vector3f pivotA, com.jme3.math.Vector3f pivotB)
      Parameters:
      nodeA - the body for the A end (not null, alias created)
      nodeB - the body for the B end (not null, alias created)
      pivotA - local translation of the joint connection point in node A
      pivotB - local translation of the joint connection point in node B
  • Method Details

    • getAppliedImpulse

      public float getAppliedImpulse()
    • getObjectId

      public com.bulletphysics.dynamics.constraintsolver.TypedConstraint getObjectId()
      Returns:
      the constraint
    • isCollisionBetweenLinkedBodys

      public boolean isCollisionBetweenLinkedBodys()
      Returns:
      the collisionBetweenLinkedBodys
    • setCollisionBetweenLinkedBodys

      public void setCollisionBetweenLinkedBodys(boolean collisionBetweenLinkedBodies)
      toggles collisions between linked bodies
      joint has to be removed from and added to PhysicsSpace to apply this.
      Parameters:
      collisionBetweenLinkedBodies - set to false to have no collisions between linked bodies
    • getBodyA

      public PhysicsRigidBody getBodyA()
    • getBodyB

      public PhysicsRigidBody getBodyB()
    • getPivotA

      public com.jme3.math.Vector3f getPivotA()
    • getPivotB

      public com.jme3.math.Vector3f getPivotB()
    • destroy

      public void destroy()
      destroys this joint and removes it from its connected PhysicsRigidBody's joint lists
    • write

      public void write(com.jme3.export.JmeExporter ex) throws IOException
      Specified by:
      write in interface com.jme3.export.Savable
      Throws:
      IOException
    • read

      public void read(com.jme3.export.JmeImporter im) throws IOException
      Specified by:
      read in interface com.jme3.export.Savable
      Throws:
      IOException