Package jsim.collision
Class BoxCollider
java.lang.Object
jsim.collision.ColliderShape
jsim.collision.BoxCollider
Axis-aligned-in-body-space box centred at the body's local origin.
Half-extents are the distances from the centre to each face.
-
Nested Class Summary
Nested classes/interfaces inherited from class jsim.collision.ColliderShape
ColliderShape.Type -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionBoxCollider(double halfX, double halfY, double halfZ) Create a box collider with the given half-extents. -
Method Summary
Modifier and TypeMethodDescriptionvoidcomputeAABB(edu.wpi.first.math.geometry.Pose3d pose, double[] out) Compute the world-space AABB of this shape given the body's pose.getType()The shape type of this collider.
-
Field Details
-
halfX
public final double halfXHalf-extents along each body-local axis (metres). -
halfY
public final double halfYHalf-extents along each body-local axis (metres). -
halfZ
public final double halfZHalf-extents along each body-local axis (metres).
-
-
Constructor Details
-
BoxCollider
public BoxCollider(double halfX, double halfY, double halfZ) Create a box collider with the given half-extents.- Parameters:
halfX- half-extent along the body-local X axis (metres)halfY- half-extent along the body-local Y axis (metres)halfZ- half-extent along the body-local Z axis (metres)
-
-
Method Details
-
getType
Description copied from class:ColliderShapeThe shape type of this collider.- Specified by:
getTypein classColliderShape- Returns:
- this shape's type tag
-
computeAABB
public void computeAABB(edu.wpi.first.math.geometry.Pose3d pose, double[] out) Description copied from class:ColliderShapeCompute the world-space AABB of this shape given the body's pose.- Specified by:
computeAABBin classColliderShape- Parameters:
pose- world-space pose of the body (position in metres, orientation as quaternion)out- receives [minX, minY, minZ, maxX, maxY, maxZ] in metres
-