public class PhysicsGhostObject extends PhysicsCollisionObject
From Bullet manual:
btGhostObject is a special btCollisionObject, useful for fast localized
collision queries.
| Modifier and Type | Field and Description |
|---|---|
protected boolean |
locationDirty |
protected com.jme3.math.Quaternion |
tmp_inverseWorldRotation |
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, objectId| Modifier | Constructor and Description |
|---|---|
protected |
PhysicsGhostObject()
No-argument constructor needed by SavableClassUtil.
|
|
PhysicsGhostObject(CollisionShape shape)
Instantiate an object with the specified collision shape.
|
|
PhysicsGhostObject(com.jme3.scene.Spatial child,
CollisionShape shape) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
buildObject()
Create the configured object in Bullet.
|
void |
destroy()
Has no effect.
|
float |
getCcdMotionThreshold()
Read the continuous collision detection (CCD) motion threshold for this
object.
|
float |
getCcdSquareMotionThreshold()
Read the CCD square motion threshold for this object.
|
float |
getCcdSweptSphereRadius()
Read the radius of the sphere used for continuous collision detection
(CCD).
|
PhysicsCollisionObject |
getOverlapping(int index)
Access an overlapping collision object by its position in the list.
|
int |
getOverlappingCount()
Count how many collision objects this object overlaps.
|
java.util.List<PhysicsCollisionObject> |
getOverlappingObjects()
Access a list of overlapping objects.
|
protected void |
getOverlappingObjects(long objectId) |
com.jme3.math.Vector3f |
getPhysicsLocation()
Copy the location of this object's center.
|
com.jme3.math.Vector3f |
getPhysicsLocation(com.jme3.math.Vector3f trans)
Copy the location of this object's center.
|
com.jme3.math.Quaternion |
getPhysicsRotation()
Copy this object's orientation to a quaternion.
|
com.jme3.math.Quaternion |
getPhysicsRotation(com.jme3.math.Quaternion rot)
Copy this object's orientation to a quaternion.
|
com.jme3.math.Matrix3f |
getPhysicsRotationMatrix()
Copy this object's orientation to a matrix.
|
com.jme3.math.Matrix3f |
getPhysicsRotationMatrix(com.jme3.math.Matrix3f rot)
Copy this object's orientation to a matrix.
|
void |
read(com.jme3.export.JmeImporter e)
De-serialize this object from the specified importer, for example when
loading from a J3O file.
|
void |
setCcdMotionThreshold(float threshold)
Alter the amount of motion required to trigger continuous collision
detection (CCD).
|
void |
setCcdSweptSphereRadius(float radius)
Alter the continuous collision detection (CCD) swept sphere radius for
this object.
|
void |
setCollisionShape(CollisionShape collisionShape)
Apply the specified CollisionShape to this object.
|
void |
setPhysicsLocation(com.jme3.math.Vector3f location)
Directly alter the location of this object's center.
|
void |
setPhysicsRotation(com.jme3.math.Matrix3f rotation)
Directly alter this object's orientation.
|
void |
setPhysicsRotation(com.jme3.math.Quaternion rotation)
Directly alter this object's orientation.
|
void |
write(com.jme3.export.JmeExporter e)
Serialize this object, for example when saving to a J3O file.
|
addCollideWithGroup, attachCollisionShape, finalize, finalizeNative, getCollideWithGroups, getCollisionFlags, getCollisionGroup, getCollisionShape, getDeactivationTime, getObjectId, getUserObject, initUserPointer, isContactResponse, removeCollideWithGroup, setCollideWithGroups, setCollisionFlags, setCollisionGroup, setUserObjectprotected boolean locationDirty
protected final com.jme3.math.Quaternion tmp_inverseWorldRotation
protected PhysicsGhostObject()
public PhysicsGhostObject(CollisionShape shape)
shape - the desired shape (not null, alias created)public PhysicsGhostObject(com.jme3.scene.Spatial child,
CollisionShape shape)
protected void buildObject()
public void setCollisionShape(CollisionShape collisionShape)
setCollisionShape in class PhysicsCollisionObjectcollisionShape - the shape to apply (not null, alias created)public void setPhysicsLocation(com.jme3.math.Vector3f location)
location - the desired location (in physics-space coordinates, not
null, unaffected)public void setPhysicsRotation(com.jme3.math.Matrix3f rotation)
rotation - the desired orientation (a rotation matrix in
physics-space coordinates, not null, unaffected)public void setPhysicsRotation(com.jme3.math.Quaternion rotation)
rotation - the desired orientation (quaternion, not null,
unaffected)public com.jme3.math.Vector3f getPhysicsLocation(com.jme3.math.Vector3f trans)
trans - storage for the result (modified if not null)public com.jme3.math.Quaternion getPhysicsRotation(com.jme3.math.Quaternion rot)
rot - storage for the result (modified if not null)public com.jme3.math.Matrix3f getPhysicsRotationMatrix(com.jme3.math.Matrix3f rot)
rot - storage for the result (modified if not null)public com.jme3.math.Vector3f getPhysicsLocation()
public com.jme3.math.Quaternion getPhysicsRotation()
public com.jme3.math.Matrix3f getPhysicsRotationMatrix()
public void destroy()
public java.util.List<PhysicsCollisionObject> getOverlappingObjects()
protected void getOverlappingObjects(long objectId)
public int getOverlappingCount()
public PhysicsCollisionObject getOverlapping(int index)
index - which list position (≥0, <count)public void setCcdSweptSphereRadius(float radius)
radius - (≥0)public void setCcdMotionThreshold(float threshold)
This addresses the issue of fast objects passing through other objects with no collision detected.
threshold - the desired threshold value (squared velocity, >0) or
zero to disable CCD (default=0)public float getCcdSweptSphereRadius()
public float getCcdMotionThreshold()
public float getCcdSquareMotionThreshold()
public void write(com.jme3.export.JmeExporter e)
throws java.io.IOException
write in interface com.jme3.export.Savablewrite in class PhysicsCollisionObjecte - exporter (not null)java.io.IOException - from exporterpublic void read(com.jme3.export.JmeImporter e)
throws java.io.IOException
read in interface com.jme3.export.Savableread in class PhysicsCollisionObjecte - importer (not null)java.io.IOException - from importer