Package jsim.collision
Class PlaneCollider
java.lang.Object
jsim.collision.ColliderShape
jsim.collision.PlaneCollider
Infinite half-space collider.
The plane is defined in the body's local frame as: n·p = d, where n is the outward normal and d is the signed distance from the body's local origin. For a floor at Z=0 with normal pointing up, use normal (0,0,1) and offset 0.
PlaneColliders must be attached to RigidBodyFlags.STATIC bodies.
They produce an AABB that covers the entire simulation volume.
-
Nested Class Summary
Nested classes/interfaces inherited from class jsim.collision.ColliderShape
ColliderShape.Type -
Field Summary
FieldsModifier and TypeFieldDescriptionfinal doubleOutward normal in body-local space (should be unit length).final doubleOutward normal in body-local space (should be unit length).final doubleOutward normal in body-local space (should be unit length).final doubleSigned distance from the body origin to the plane surface along the normal. -
Constructor Summary
ConstructorsConstructorDescriptionPlaneCollider(double nx, double ny, double nz, double offset) Create an infinite half-space plane collider. -
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
-
nx
public final double nxOutward normal in body-local space (should be unit length). -
ny
public final double nyOutward normal in body-local space (should be unit length). -
nz
public final double nzOutward normal in body-local space (should be unit length). -
offset
public final double offsetSigned distance from the body origin to the plane surface along the normal.
-
-
Constructor Details
-
PlaneCollider
public PlaneCollider(double nx, double ny, double nz, double offset) Create an infinite half-space plane collider.- Parameters:
nx- outward normal X component (will be normalized)ny- outward normal Y componentnz- outward normal Z componentoffset- signed distance from the body origin to the plane surface along the normal
-
-
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
-