Class ManifoldPoints
btManifoldPoint class.
Based on PhysicsCollisionEvent.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic longCreate a manifold point (for testing) that will never be freed.static floatgetAppliedImpulse(long manifoldPointId) Return the applied impulse of the specified point (native field: m_appliedImpulse).static floatgetAppliedImpulseLateral1(long manifoldPointId) Return the applied lateral impulse #1 of the specified point (native field: m_appliedImpulseLateral1).static floatgetAppliedImpulseLateral2(long manifoldPointId) Return the applied lateral impulse #2 of the specified point (native field: m_appliedImpulseLateral2).static floatgetCombinedFriction(long manifoldPointId) Return the combined friction of the specified point, which is the product of the collision-object frictions (native field: m_combinedFriction).static floatgetCombinedRestitution(long manifoldPointId) Return the combined restitution of the specified point, which is the product of the collision-object restitutions (native field: m_combinedRestitution).static floatgetCombinedRollingFriction(long manifoldPointId) Return the combined rolling friction of the specified point (native field: m_combinedRollingFriction).static floatgetCombinedSpinningFriction(long manifoldPointId) Return the combined spinning friction of the specified point (native field: m_combinedSpinningFriction).static floatgetContactMotion1(long manifoldPointId) Return the contact motion #1 of the specified point (native field: m_contactMotion1).static floatgetContactMotion2(long manifoldPointId) Return the contact motion #2 of the specified point (native field: m_contactMotion2).static floatgetDistance1(long manifoldPointId) Return the separation distance of the specified point (native field: m_distance1).static intgetFlags(long manifoldPointId) Return the flags of the specified point (native field: m_contactPointFlags).static intgetIndex0(long manifoldPointId) Return the triangle index from the shape of object A at the specified point of contact (native field: m_index0).static intgetIndex1(long manifoldPointId) Return the triangle index from the shape of object B at the specified point of contact (native field: m_index1).static voidgetLateralFrictionDir1(long manifoldPointId, Vector3f storeVector) Determine the lateral friction direction #1 of the specified point (native field: m_lateralFrictionDir1).static voidgetLateralFrictionDir2(long manifoldPointId, Vector3f storeVector) Determine the lateral friction direction #2 of the specified point (native field: m_lateralFrictionDir2).static intgetLifeTime(long manifoldPointId) Return the lifetime of the specified point (native name: m_lifeTime).static voidgetLocalPointA(long manifoldPointId, Vector3f storeVector) Determine the location of the specified point in the local coordinates of object A (native name: m_localPointA).static voidgetLocalPointB(long manifoldPointId, Vector3f storeVector) Determine the location of the specified point in the local coordinates of object B (native name: m_localPointB).static voidgetNormalWorldOnB(long manifoldPointId, Vector3f storeVector) Determine the normal on object B of the specified point in physics-space coordinates (native name: m_normalWorldOnB).static intgetPartId0(long manifoldPointId) Return the part index from the shape of object A at the specified point of contact (native field: m_partId0).static intgetPartId1(long manifoldPointId) Return the part index from the shape of object B at the specified point of contact (native field: m_partId1).static voidgetPositionWorldOnA(long manifoldPointId, Vector3f storeVector) Determine the location of the specified point on object A in physics-space coordinates (native field: m_positionWorldOnA).static voidgetPositionWorldOnADp(long manifoldPointId, Vec3d storeVector) Determine the location of the specified point on object A in physics-space coordinates (native field: m_positionWorldOnA).static voidgetPositionWorldOnB(long manifoldPointId, Vector3f storeVector) Determine the location of the specified point on object B in physics-space coordinates (native field: m_positionWorldOnB).static voidgetPositionWorldOnBDp(long manifoldPointId, Vec3d storeVector) Determine the location of the specified point on object B in physics-space coordinates (native field: m_positionWorldOnB).static booleanDetermine how many points are used to calculate the area of the convex hull of a contact point.static voidsetAppliedImpulse(long manifoldPointId, float impulse) Alter the applied impulse of the specified point (native field: m_appliedImpulse).static voidsetAppliedImpulseLateral1(long manifoldPointId, float impulse) Alter the applied lateral impulse #1 of the specified point (native field: m_appliedImpulseLateral1).static voidsetAppliedImpulseLateral2(long manifoldPointId, float impulse) Alter the applied lateral impulse #2 of the specified point (native field: m_appliedImpulseLateral2).static voidsetCombinedFriction(long manifoldPointId, float friction) Alter the combined friction of the specified point (native field: m_combinedFriction).static voidsetCombinedRestitution(long manifoldPointId, float restitution) Alter the combined restitution of the specified point (native field: m_combinedRestitution).static voidsetCombinedRollingFriction(long manifoldPointId, float friction) Alter the combined rolling friction of the specified point (native field: m_combinedRollingFriction).static voidsetCombinedSpinningFriction(long manifoldPointId, float friction) Alter the combined spinning friction of the specified point (native field: m_combinedSpinningFriction).static voidsetContactCalcArea3Points(boolean setting) Alter the number of points used to calculate the area of the convex hull of a contact point.static voidsetContactMotion1(long manifoldPointId, float motion) Alter the contact motion #1 of the specified point (native field: m_contactMotion1).static voidsetContactMotion2(long manifoldPointId, float motion) Alter the contact motion #2 of the specified point (native field: m_contactMotion2).static voidsetDistance1(long manifoldPointId, float distance) Alter the separation distance of the specified point (native field: m_distance1).static voidsetFlags(long manifoldPointId, int bitmask) Alter the flags of the specified point (native field: m_contactPointFlags).static voidsetLateralFrictionDir1(long manifoldPointId, Vector3f direction) Alter the lateral friction direction #1 of the specified point (native field: m_lateralFrictionDir1).static voidsetLateralFrictionDir2(long manifoldPointId, Vector3f direction) Alter the lateral friction direction #2 of the specified point (native field: m_lateralFrictionDir2).static voidsetLocalPointA(long manifoldPointId, Vector3f locationVector) Alter the location of the specified point in the local coordinates of object A (native name: m_localPointA).static voidsetLocalPointB(long manifoldPointId, Vector3f locationVector) Alter the location of the specified point in the local coordinates of object B (native name: m_localPointB).static voidsetNormalWorldOnB(long manifoldPointId, Vector3f normalVector) Alter the normal on object B of the specified point in physics-space coordinates (native name: m_normalWorldOnB).static voidsetPositionWorldOnA(long manifoldPointId, Vector3f locationVector) Alter the location of the specified point on object A in physics-space coordinates (native field: m_positionWorldOnA).static voidsetPositionWorldOnB(long manifoldPointId, Vector3f locationVector) Alter the location of the specified point on object B in physics-space coordinates (native field: m_positionWorldOnB).
-
Field Details
-
logger
message logger for this class
-
-
Method Details
-
createTestPoint
public static long createTestPoint()Create a manifold point (for testing) that will never be freed. For internal use only.- Returns:
- the native ID of a new
btManifoldPoint(not zero)
-
getAppliedImpulse
public static float getAppliedImpulse(long manifoldPointId) Return the applied impulse of the specified point (native field: m_appliedImpulse).- Parameters:
manifoldPointId- the native ID of thebtManifoldPoint(not zero)- Returns:
- the impulse calculated during the previous simulation step, or zero if the WarmStart bit is cleared in the solver mode
-
getAppliedImpulseLateral1
public static float getAppliedImpulseLateral1(long manifoldPointId) Return the applied lateral impulse #1 of the specified point (native field: m_appliedImpulseLateral1).- Parameters:
manifoldPointId- the native ID of thebtManifoldPoint(not zero)- Returns:
- the impulse
-
getAppliedImpulseLateral2
public static float getAppliedImpulseLateral2(long manifoldPointId) Return the applied lateral impulse #2 of the specified point (native field: m_appliedImpulseLateral2).- Parameters:
manifoldPointId- the native ID of thebtManifoldPoint(not zero)- Returns:
- the impulse
-
getCombinedFriction
public static float getCombinedFriction(long manifoldPointId) Return the combined friction of the specified point, which is the product of the collision-object frictions (native field: m_combinedFriction).- Parameters:
manifoldPointId- the native ID of thebtManifoldPoint(not zero)- Returns:
- the friction product
-
getCombinedRestitution
public static float getCombinedRestitution(long manifoldPointId) Return the combined restitution of the specified point, which is the product of the collision-object restitutions (native field: m_combinedRestitution).- Parameters:
manifoldPointId- the native ID of thebtManifoldPoint(not zero)- Returns:
- the restitution product
-
getCombinedRollingFriction
public static float getCombinedRollingFriction(long manifoldPointId) Return the combined rolling friction of the specified point (native field: m_combinedRollingFriction).- Parameters:
manifoldPointId- the native ID of thebtManifoldPoint(not zero)- Returns:
- the combined friction
-
getCombinedSpinningFriction
public static float getCombinedSpinningFriction(long manifoldPointId) Return the combined spinning friction of the specified point (native field: m_combinedSpinningFriction).- Parameters:
manifoldPointId- the native ID of thebtManifoldPoint(not zero)- Returns:
- the combined friction
-
getContactMotion1
public static float getContactMotion1(long manifoldPointId) Return the contact motion #1 of the specified point (native field: m_contactMotion1).- Parameters:
manifoldPointId- the native ID of thebtManifoldPoint(not zero)- Returns:
- the motion
-
getContactMotion2
public static float getContactMotion2(long manifoldPointId) Return the contact motion #2 of the specified point (native field: m_contactMotion2).- Parameters:
manifoldPointId- the native ID of thebtManifoldPoint(not zero)- Returns:
- the motion
-
getDistance1
public static float getDistance1(long manifoldPointId) Return the separation distance of the specified point (native field: m_distance1). This is the negative of the penetration depth.- Parameters:
manifoldPointId- the native ID of thebtManifoldPoint(not zero)- Returns:
- the distance (in physics-space units)
-
getFlags
public static int getFlags(long manifoldPointId) Return the flags of the specified point (native field: m_contactPointFlags).- Parameters:
manifoldPointId- the native ID of thebtManifoldPoint(not zero)- Returns:
- a bitmask
- See Also:
-
getIndex0
public static int getIndex0(long manifoldPointId) Return the triangle index from the shape of object A at the specified point of contact (native field: m_index0).If shape is convex, the index is undefined.
If shape is a CompoundCollisionShape, the index identifies a child shape.
If the shape is a GImpactCollisionShape or MeshCollisionShape, the index identifies a triangle in an IndexedMesh.
If the shape is a HeightfieldCollisionShape, the index indicates a grid column.
- Parameters:
manifoldPointId- the native ID of thebtManifoldPoint(not zero)- Returns:
- the index of the collision-shape triangle (≥0) or -1 if undefined
-
getIndex1
public static int getIndex1(long manifoldPointId) Return the triangle index from the shape of object B at the specified point of contact (native field: m_index1).If shape is convex, the index is undefined.
If shape is a CompoundCollisionShape, the index identifies a child shape.
If the shape is a GImpactCollisionShape or MeshCollisionShape, the index identifies a triangle in an IndexedMesh.
If the shape is a HeightfieldCollisionShape, the index indicates a grid column.
- Parameters:
manifoldPointId- the native ID of thebtManifoldPoint(not zero)- Returns:
- the index of the collision-shape triangle (≥0) or -1 if undefined
-
getLateralFrictionDir1
Determine the lateral friction direction #1 of the specified point (native field: m_lateralFrictionDir1).- Parameters:
manifoldPointId- the native ID of thebtManifoldPoint(not zero)storeVector- storage for the result (not null, modified)
-
getLateralFrictionDir2
Determine the lateral friction direction #2 of the specified point (native field: m_lateralFrictionDir2).- Parameters:
manifoldPointId- the native ID of thebtManifoldPoint(not zero)storeVector- storage for the result (not null, modified)
-
getLifeTime
public static int getLifeTime(long manifoldPointId) Return the lifetime of the specified point (native name: m_lifeTime).- Parameters:
manifoldPointId- the native ID of thebtManifoldPoint(not zero)- Returns:
- the duration (in simulation steps, ≥0)
-
getLocalPointA
Determine the location of the specified point in the local coordinates of object A (native name: m_localPointA).- Parameters:
manifoldPointId- the native ID of thebtManifoldPoint(not zero)storeVector- storage for the result (not null, modified)
-
getLocalPointB
Determine the location of the specified point in the local coordinates of object B (native name: m_localPointB).- Parameters:
manifoldPointId- the native ID of thebtManifoldPoint(not zero)storeVector- storage for the result (not null, modified)
-
getNormalWorldOnB
Determine the normal on object B of the specified point in physics-space coordinates (native name: m_normalWorldOnB).- Parameters:
manifoldPointId- the native ID of thebtManifoldPoint(not zero)storeVector- storage for the result (not null, modified)
-
getPartId0
public static int getPartId0(long manifoldPointId) Return the part index from the shape of object A at the specified point of contact (native field: m_partId0).If the shape is compound or convex, the index is undefined.
If the shape is a GImpactCollisionShape or MeshCollisionShape, the index identifies an IndexedMesh.
If the shape is a HeightfieldCollisionShape, the index identifies a grid row.
- Parameters:
manifoldPointId- the native ID of thebtManifoldPoint(not zero)- Returns:
- the index of the collision-shape part (≥0) or -1 if undefined
-
getPartId1
public static int getPartId1(long manifoldPointId) Return the part index from the shape of object B at the specified point of contact (native field: m_partId1).If the shape is compound or convex, the index is undefined.
If the shape is a GImpactCollisionShape or MeshCollisionShape, the index identifies an IndexedMesh.
If the shape is a HeightfieldCollisionShape, the index identifies a grid row.
- Parameters:
manifoldPointId- the native ID of thebtManifoldPoint(not zero)- Returns:
- the index of the collision-shape part (≥0) or -1 if undefined
-
getPositionWorldOnA
Determine the location of the specified point on object A in physics-space coordinates (native field: m_positionWorldOnA).- Parameters:
manifoldPointId- the native ID of thebtManifoldPoint(not zero)storeVector- storage for the result (not null, modified)
-
getPositionWorldOnADp
Determine the location of the specified point on object A in physics-space coordinates (native field: m_positionWorldOnA).- Parameters:
manifoldPointId- the native ID of thebtManifoldPoint(not zero)storeVector- storage for the result (not null, modified)
-
getPositionWorldOnB
Determine the location of the specified point on object B in physics-space coordinates (native field: m_positionWorldOnB).- Parameters:
manifoldPointId- the native ID of thebtManifoldPoint(not zero)storeVector- storage for the result (modified if not null)
-
getPositionWorldOnBDp
Determine the location of the specified point on object B in physics-space coordinates (native field: m_positionWorldOnB).- Parameters:
manifoldPointId- the native ID of thebtManifoldPoint(not zero)storeVector- storage for the result (modified if not null)
-
isContactCalcArea3Points
public static boolean isContactCalcArea3Points()Determine how many points are used to calculate the area of the convex hull of a contact point.- Returns:
- true if using 3 points (faster), false if using 4 points (more accurate)
-
setAppliedImpulse
public static void setAppliedImpulse(long manifoldPointId, float impulse) Alter the applied impulse of the specified point (native field: m_appliedImpulse).- Parameters:
manifoldPointId- the native ID of thebtManifoldPoint(not zero)impulse- the desired impulse
-
setAppliedImpulseLateral1
public static void setAppliedImpulseLateral1(long manifoldPointId, float impulse) Alter the applied lateral impulse #1 of the specified point (native field: m_appliedImpulseLateral1).- Parameters:
manifoldPointId- the native ID of thebtManifoldPoint(not zero)impulse- the desired impulse
-
setAppliedImpulseLateral2
public static void setAppliedImpulseLateral2(long manifoldPointId, float impulse) Alter the applied lateral impulse #2 of the specified point (native field: m_appliedImpulseLateral2).- Parameters:
manifoldPointId- the native ID of thebtManifoldPoint(not zero)impulse- the desired impulse
-
setCombinedFriction
public static void setCombinedFriction(long manifoldPointId, float friction) Alter the combined friction of the specified point (native field: m_combinedFriction).- Parameters:
manifoldPointId- the native ID of thebtManifoldPoint(not zero)friction- the desired friction
-
setCombinedRestitution
public static void setCombinedRestitution(long manifoldPointId, float restitution) Alter the combined restitution of the specified point (native field: m_combinedRestitution).- Parameters:
manifoldPointId- the native ID of thebtManifoldPoint(not zero)restitution- the desired restitution
-
setCombinedRollingFriction
public static void setCombinedRollingFriction(long manifoldPointId, float friction) Alter the combined rolling friction of the specified point (native field: m_combinedRollingFriction).- Parameters:
manifoldPointId- the native ID of thebtManifoldPoint(not zero)friction- the desired friction
-
setCombinedSpinningFriction
public static void setCombinedSpinningFriction(long manifoldPointId, float friction) Alter the combined spinning friction of the specified point (native field: m_combinedSpinningFriction).- Parameters:
manifoldPointId- the native ID of thebtManifoldPoint(not zero)friction- the combined friction
-
setContactCalcArea3Points
public static void setContactCalcArea3Points(boolean setting) Alter the number of points used to calculate the area of the convex hull of a contact point.- Parameters:
setting- true to use 3 points (faster), false to use 4 points (more accurate) (default=true)
-
setContactMotion1
public static void setContactMotion1(long manifoldPointId, float motion) Alter the contact motion #1 of the specified point (native field: m_contactMotion1).- Parameters:
manifoldPointId- the native ID of thebtManifoldPoint(not zero)motion- the desired motion
-
setContactMotion2
public static void setContactMotion2(long manifoldPointId, float motion) Alter the contact motion #2 of the specified point (native field: m_contactMotion2).- Parameters:
manifoldPointId- the native ID of thebtManifoldPoint(not zero)motion- the desired motion
-
setDistance1
public static void setDistance1(long manifoldPointId, float distance) Alter the separation distance of the specified point (native field: m_distance1). This is the negative of the penetration depth.- Parameters:
manifoldPointId- the native ID of thebtManifoldPoint(not zero)distance- the desired distance (in physics-space units)
-
setFlags
public static void setFlags(long manifoldPointId, int bitmask) Alter the flags of the specified point (native field: m_contactPointFlags).- Parameters:
manifoldPointId- the native ID of thebtManifoldPoint(not zero)bitmask- the desired bitmask- See Also:
-
setLateralFrictionDir1
Alter the lateral friction direction #1 of the specified point (native field: m_lateralFrictionDir1).- Parameters:
manifoldPointId- the native ID of thebtManifoldPoint(not zero)direction- the desired direction (in physics-space coordinates, not null, unaffected)
-
setLateralFrictionDir2
Alter the lateral friction direction #2 of the specified point (native field: m_lateralFrictionDir2).- Parameters:
manifoldPointId- the native ID of thebtManifoldPoint(not zero)direction- the desired direction (in physics-space coordinates, not null, unaffected)
-
setLocalPointA
Alter the location of the specified point in the local coordinates of object A (native name: m_localPointA).- Parameters:
manifoldPointId- the native ID of thebtManifoldPoint(not zero)locationVector- the desired location (not null, unaffected)
-
setLocalPointB
Alter the location of the specified point in the local coordinates of object B (native name: m_localPointB).- Parameters:
manifoldPointId- the native ID of thebtManifoldPoint(not zero)locationVector- the desired location (not null, unaffected)
-
setNormalWorldOnB
Alter the normal on object B of the specified point in physics-space coordinates (native name: m_normalWorldOnB).- Parameters:
manifoldPointId- the native ID of thebtManifoldPoint(not zero)normalVector- the desired normal (not null, unaffected)
-
setPositionWorldOnA
Alter the location of the specified point on object A in physics-space coordinates (native field: m_positionWorldOnA).- Parameters:
manifoldPointId- the native ID of thebtManifoldPoint(not zero)locationVector- the desired location (not null, unaffected)
-
setPositionWorldOnB
Alter the location of the specified point on object B in physics-space coordinates (native field: m_positionWorldOnB).- Parameters:
manifoldPointId- the native ID of thebtManifoldPoint(not zero)locationVector- the desired location (not null, unaffected)
-