com.jme3.bullet.objects
Class PhysicsGhostObject

java.lang.Object
  extended by com.jme3.bullet.collision.PhysicsCollisionObject
      extended by com.jme3.bullet.objects.PhysicsGhostObject
All Implemented Interfaces:
Savable
Direct Known Subclasses:
GhostControl

public class PhysicsGhostObject
extends PhysicsCollisionObject

From Bullet manual:
GhostObject can keep track of all objects that are overlapping. By default, this overlap is based on the AABB. This is useful for creating a character controller, collision sensors/triggers, explosions etc.


Field Summary
protected  boolean locationDirty
           
protected  Quaternion tmp_inverseWorldRotation
           
 
Fields inherited from class com.jme3.bullet.collision.PhysicsCollisionObject
COLLISION_GROUP_01, COLLISION_GROUP_02, COLLISION_GROUP_03, COLLISION_GROUP_04, COLLISION_GROUP_05, COLLISION_GROUP_06, COLLISION_GROUP_07, COLLISION_GROUP_08, COLLISION_GROUP_09, COLLISION_GROUP_10, COLLISION_GROUP_11, COLLISION_GROUP_12, COLLISION_GROUP_13, COLLISION_GROUP_14, COLLISION_GROUP_15, COLLISION_GROUP_16, COLLISION_GROUP_NONE, collisionGroup, collisionGroupsMask, collisionShape, debugArrow, debugArrowGeom, debugMaterialBlue, debugMaterialGreen, debugMaterialRed, debugMaterialYellow, debugShape, objectId
 
Constructor Summary
PhysicsGhostObject()
           
PhysicsGhostObject(CollisionShape shape)
           
PhysicsGhostObject(Spatial child, CollisionShape shape)
           
 
Method Summary
protected  void buildObject()
           
 void destroy()
          destroys this PhysicsGhostNode and removes it from memory
 float getCcdMotionThreshold()
           
 float getCcdSquareMotionThreshold()
           
 float getCcdSweptSphereRadius()
           
 PhysicsCollisionObject getOverlapping(int index)
           
 int getOverlappingCount()
           
 java.util.List<PhysicsCollisionObject> getOverlappingObjects()
          Another Object is overlapping with this GhostNode, if and if only there CollisionShapes overlaps.
protected  void getOverlappingObjects(long objectId)
           
 Vector3f getPhysicsLocation()
           
 Vector3f getPhysicsLocation(Vector3f trans)
           
 Quaternion getPhysicsRotation()
           
 Quaternion getPhysicsRotation(Quaternion rot)
           
 Matrix3f getPhysicsRotationMatrix()
           
 Matrix3f getPhysicsRotationMatrix(Matrix3f rot)
           
 void read(JmeImporter e)
           
 void setCcdMotionThreshold(float threshold)
           
 void setCcdSweptSphereRadius(float radius)
           
 void setCollisionShape(CollisionShape collisionShape)
          Sets a CollisionShape to this physics object, note that the object should not be in the physics space when adding a new collision shape as it is rebuilt on the physics side.
 void setPhysicsLocation(Vector3f location)
          Sets the physics object location
 void setPhysicsRotation(Matrix3f rotation)
          Sets the physics object rotation
 void setPhysicsRotation(Quaternion rotation)
          Sets the physics object rotation
 void write(JmeExporter e)
           
 
Methods inherited from class com.jme3.bullet.collision.PhysicsCollisionObject
addCollideWithGroup, attachCollisionShape, attachDebugShape, attachDebugShape, attachDebugShape, createDebugShape, debugShape, detachDebugShape, finalize, finalizeNative, getCollideWithGroups, getCollisionGroup, getCollisionShape, getDebugShape, getObjectId, getUserObject, initUserPointer, removeCollideWithGroup, setCollideWithGroups, setCollisionGroup, setUserObject, updateDebugShape
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

locationDirty

protected boolean locationDirty

tmp_inverseWorldRotation

protected final Quaternion tmp_inverseWorldRotation
Constructor Detail

PhysicsGhostObject

public PhysicsGhostObject()

PhysicsGhostObject

public PhysicsGhostObject(CollisionShape shape)

PhysicsGhostObject

public PhysicsGhostObject(Spatial child,
                          CollisionShape shape)
Method Detail

buildObject

protected void buildObject()

setCollisionShape

public void setCollisionShape(CollisionShape collisionShape)
Description copied from class: PhysicsCollisionObject
Sets a CollisionShape to this physics object, note that the object should not be in the physics space when adding a new collision shape as it is rebuilt on the physics side.

Overrides:
setCollisionShape in class PhysicsCollisionObject
Parameters:
collisionShape - the CollisionShape to set

setPhysicsLocation

public void setPhysicsLocation(Vector3f location)
Sets the physics object location

Parameters:
location - the location of the actual physics object

setPhysicsRotation

public void setPhysicsRotation(Matrix3f rotation)
Sets the physics object rotation

Parameters:
rotation - the rotation of the actual physics object

setPhysicsRotation

public void setPhysicsRotation(Quaternion rotation)
Sets the physics object rotation

Parameters:
rotation - the rotation of the actual physics object

getPhysicsLocation

public Vector3f getPhysicsLocation(Vector3f trans)
Returns:
the physicsLocation

getPhysicsRotation

public Quaternion getPhysicsRotation(Quaternion rot)
Returns:
the physicsLocation

getPhysicsRotationMatrix

public Matrix3f getPhysicsRotationMatrix(Matrix3f rot)
Returns:
the physicsLocation

getPhysicsLocation

public Vector3f getPhysicsLocation()
Returns:
the physicsLocation

getPhysicsRotation

public Quaternion getPhysicsRotation()
Returns:
the physicsLocation

getPhysicsRotationMatrix

public Matrix3f getPhysicsRotationMatrix()

destroy

public void destroy()
destroys this PhysicsGhostNode and removes it from memory


getOverlappingObjects

public java.util.List<PhysicsCollisionObject> getOverlappingObjects()
Another Object is overlapping with this GhostNode, if and if only there CollisionShapes overlaps. They could be both regular PhysicsRigidBodys or PhysicsGhostObjects.

Returns:
All CollisionObjects overlapping with this GhostNode.

getOverlappingObjects

protected void getOverlappingObjects(long objectId)

getOverlappingCount

public int getOverlappingCount()
Returns:
With how many other CollisionObjects this GhostNode is currently overlapping.

getOverlapping

public PhysicsCollisionObject getOverlapping(int index)
Parameters:
index - The index of the overlapping Node to retrieve.
Returns:
The Overlapping CollisionObject at the given index.

setCcdSweptSphereRadius

public void setCcdSweptSphereRadius(float radius)

setCcdMotionThreshold

public void setCcdMotionThreshold(float threshold)

getCcdSweptSphereRadius

public float getCcdSweptSphereRadius()

getCcdMotionThreshold

public float getCcdMotionThreshold()

getCcdSquareMotionThreshold

public float getCcdSquareMotionThreshold()

write

public void write(JmeExporter e)
           throws java.io.IOException
Specified by:
write in interface Savable
Overrides:
write in class PhysicsCollisionObject
Throws:
java.io.IOException

read

public void read(JmeImporter e)
          throws java.io.IOException
Specified by:
read in interface Savable
Overrides:
read in class PhysicsCollisionObject
Throws:
java.io.IOException