java.lang.Object
com.github.stephengold.joltjni.JoltPhysicsObject
com.github.stephengold.joltjni.SoftBodyVertex
- All Implemented Interfaces:
ConstJoltPhysicsObject,ConstSoftBodyVertex,AutoCloseable,Comparable<JoltPhysicsObject>
Run-time information for a single particle in a soft body. (native type:
SoftBodyMotionProperties::Vertex)-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintReturn the index of the colliding shape.Copy the collision plane.floatReturn the inverse mass.floatReturn the amount of penetration.Copy the location.Copy the velocity.booleanTest whether the vertex collided during the previous update.voidReset the collision data.voidsetCollidingShapeIndex(int index) Alter the index of the colliding shape.voidsetCollisionPlane(ConstPlane plane) Alter the collision plane.voidsetInvMass(float invMass) Alter the inverse mass.voidsetLargestPenetration(float penetration) Alter the amount of penetration.voidsetPosition(Vec3Arg location) Relocate the vertex.voidsetVelocity(Vec3Arg velocity) Alter the velocity of the vertex.Methods inherited from class com.github.stephengold.joltjni.JoltPhysicsObject
close, compareTo, equals, getContainingObject, hasAssignedNativeObject, hashCode, isCleanerStarted, ownsNativeObject, setVirtualAddress, setVirtualAddress, startCleaner, targetVa, toString, vaMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.Comparable
compareToMethods inherited from interface com.github.stephengold.joltjni.readonly.ConstJoltPhysicsObject
close, hasAssignedNativeObject, ownsNativeObject, targetVa
-
Constructor Details
-
SoftBodyVertex
public SoftBodyVertex()Instantiate a default vertex.
-
-
Method Details
-
resetCollision
public void resetCollision()Reset the collision data. -
setCollidingShapeIndex
public void setCollidingShapeIndex(int index) Alter the index of the colliding shape. (native attribute: mCollidingShapeIndex)- Parameters:
index- the desired index
-
setCollisionPlane
Alter the collision plane. (native attribute: mCollisionPlane)- Parameters:
plane- the desired collision plane (not null, unaffected)
-
setInvMass
public void setInvMass(float invMass) Alter the inverse mass. (native attribute: mInvMass)- Parameters:
invMass- the desired inverse mass (in 1/kilograms)
-
setLargestPenetration
public void setLargestPenetration(float penetration) Alter the amount of penetration. (native attribute: mLargestPenetration)- Parameters:
penetration- the desired amount (in meters)
-
setPosition
Relocate the vertex. (native attribute: mPosition)- Parameters:
location- the desired location (not null, unaffected)
-
setVelocity
Alter the velocity of the vertex. (native attribute: mVelocity)- Parameters:
velocity- the desired velocity (in meters per second, not null, unaffected)
-
getCollidingShapeIndex
public int getCollidingShapeIndex()Return the index of the colliding shape. The vertex is unaffected. (native attribute: mCollidingShapeIndex)- Specified by:
getCollidingShapeIndexin interfaceConstSoftBodyVertex- Returns:
- the index
-
getCollisionPlane
Copy the collision plane. The vertex is unaffected. (native attribute: mCollisionPlane)- Specified by:
getCollisionPlanein interfaceConstSoftBodyVertex- Returns:
- a new object
-
getInvMass
public float getInvMass()Return the inverse mass. The vertex is unaffected. (native attribute: mInvMass)- Specified by:
getInvMassin interfaceConstSoftBodyVertex- Returns:
- the inverse of the mass (in 1/kilograms)
-
getLargestPenetration
public float getLargestPenetration()Return the amount of penetration. (native attribute: mLargestPenetration)- Specified by:
getLargestPenetrationin interfaceConstSoftBodyVertex- Returns:
- the depth (in meters)
-
getPosition
Copy the location. The vertex is unaffected. (native attribute: mPosition)- Specified by:
getPositionin interfaceConstSoftBodyVertex- Returns:
- a new location vector (relative to the body's center of mass)
-
getVelocity
Copy the velocity. The vertex is unaffected. (native attribute: mVelocity)- Specified by:
getVelocityin interfaceConstSoftBodyVertex- Returns:
- a new velocity vector (relative to the body's center of mass, in meters per second)
-
hasContact
public boolean hasContact()Test whether the vertex collided during the previous update. The vertex is unaffected. (native attribute: mHasContact)- Specified by:
hasContactin interfaceConstSoftBodyVertex- Returns:
trueif it collided, otherwisefalse
-