Package com.github.stephengold.joltjni
Class CollisionEstimationResult
java.lang.Object
com.github.stephengold.joltjni.JoltPhysicsObject
com.github.stephengold.joltjni.CollisionEstimationResult
- All Implemented Interfaces:
ConstJoltPhysicsObject,AutoCloseable,Comparable<JoltPhysicsObject>
Store estimates of the contact and friction impulses associated with a
collision, along with the resulting body velocities.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionCopy the angular velocity of body 1.Copy the angular velocity of body 2.float[]Copy the impulses to an array.Copy the linear velocity of body 1.Copy the linear velocity of body 2.Methods inherited from class com.github.stephengold.joltjni.JoltPhysicsObject
close, compareTo, equals, getContainingObject, hasAssignedNativeObject, hashCode, isCleanerStarted, ownsNativeObject, setVirtualAddress, setVirtualAddress, startCleaner, targetVa, targetVaOrZero, toString, va
-
Constructor Details
-
CollisionEstimationResult
public CollisionEstimationResult()Instantiate a default estimate.
-
-
Method Details
-
getAngularVelocity1
Copy the angular velocity of body 1. The estimate is unaffected. (native attribute: mAngularVelocity1)- Returns:
- a new velocity vector (radians per second in system coordinates)
-
getAngularVelocity2
Copy the angular velocity of body 2. The estimate is unaffected. (native attribute: mAngularVelocity2)- Returns:
- a new velocity vector (radians per second in system coordinates)
-
getContactImpulses
public float[] getContactImpulses()Copy the impulses to an array. (native attribute: mContactImpulse)- Returns:
- a new array of impulses (in kilogram.meter per second)
-
getLinearVelocity1
Copy the linear velocity of body 1. The estimate is unaffected. (native attribute: mLinearVelocity1)- Returns:
- a new velocity vector (meters per second in system coordinates)
-
getLinearVelocity2
Copy the linear velocity of body 2. The estimate is unaffected. (native attribute: mLinearVelocity1)- Returns:
- a new velocity vector (meters per second in system coordinates)
-