Class ChildCollisionShape
java.lang.Object
com.jme3.bullet.collision.shapes.infos.ChildCollisionShape
An element in a CompoundCollisionShape, consisting of a (non-compound) base
shape, offset and rotated with respect to its parent.
Despite its name, it is not a subtype of CollisionShape!
-
Field Summary
-
Constructor Summary
ConstructorDescriptionChildCollisionShape
(Vector3f offset, CollisionShape shape) Instantiate a child without any rotation.ChildCollisionShape
(Vector3f offset, Matrix3f rotation, CollisionShape shape) Instantiate a child for use in a compound shape. -
Method Summary
Modifier and TypeMethodDescriptioncopyOffset
(Vector3f storeResult) Copy the translation in the parent's coordinate system.copyRotation
(Quaternion storeResult) Copy the rotation in the parent's coordinate system.copyRotationMatrix
(Matrix3f storeResult) Copy the rotation in the parent's coordinate system.copyTransform
(Transform storeResult) Copy the Transform relative to the parent's coordinate system.getShape()
Access the base shape.void
setTransform
(Vector3f offset, Matrix3f rotation) Alter the child's coordinate transform copy.Attempt to divide this child into 2 children.
-
Field Details
-
logger
message logger for this class
-
-
Constructor Details
-
ChildCollisionShape
Instantiate a child for use in a compound shape.- Parameters:
offset
- the desired translation in the parent's coordinate system (not null, unaffected)rotation
- the desired rotation in the parent's coordinate system (not null, unaffected)shape
- the base shape (not null, not a compound shape, alias created)
-
ChildCollisionShape
Instantiate a child without any rotation.- Parameters:
offset
- the desired translation in the parent's coordinate system (not null, unaffected)shape
- the base shape (not null, not a compound shape, alias created)
-
-
Method Details
-
copyOffset
Copy the translation in the parent's coordinate system.- Parameters:
storeResult
- storage for the result (modified if not null)- Returns:
- a translation vector (either storeResult or a new vector, not null)
-
copyRotation
Copy the rotation in the parent's coordinate system.- Parameters:
storeResult
- storage for the result (modified if not null)- Returns:
- a Quaternion (either storeResult or a new Quaternion, not null)
-
copyRotationMatrix
Copy the rotation in the parent's coordinate system.- Parameters:
storeResult
- storage for the result (modified if not null)- Returns:
- a rotation matrix (either storeResult or a new matrix, not null)
-
copyTransform
Copy the Transform relative to the parent's coordinate system.- Parameters:
storeResult
- storage for the result (modified if not null)- Returns:
- a Transform with scale=1 (either storeResult or a new instance, not null)
-
getShape
Access the base shape.- Returns:
- the pre-existing shape (not null)
-
setTransform
Alter the child's coordinate transform copy. For internal use only.- Parameters:
offset
- the desired translation relative to the parent (not null, unaffected)rotation
- the desired rotation relative to the parent (not null, unaffected)- See Also:
-
split
Attempt to divide this child into 2 children. The base shape must be splittable.- Parameters:
parentTriangle
- a triangle that defines the splitting plane (in parent's shape coordinates, not null, unaffected)- Returns:
- a pair of children, the first element on the triangle's minus side and the 2nd element on its plus side; either element may be null, indicating an empty child
-