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 TypeMethodDescriptionint
Return the index of the colliding shape.Copy the collision plane.float
Return the inverse mass.float
Return the amount of penetration.Copy the location.Copy the velocity.boolean
Test whether the vertex collided during the previous update.void
Reset the collision data.void
setCollidingShapeIndex
(int index) Alter the index of the colliding shape.void
setCollisionPlane
(ConstPlane plane) Alter the collision plane.void
setInvMass
(float invMass) Alter the inverse mass.void
setLargestPenetration
(float penetration) Alter the amount of penetration.void
setPosition
(Vec3Arg location) Relocate the vertex.void
setVelocity
(Vec3Arg velocity) Alter the velocity of the vertex.Methods inherited from class com.github.stephengold.joltjni.JoltPhysicsObject
close, compareTo, equals, getContainingObject, hasAssignedNativeObject, hashCode, ownsNativeObject, setVirtualAddress, setVirtualAddress, startCleaner, targetVa, toString, va
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.lang.Comparable
compareTo
Methods 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:
getCollidingShapeIndex
in interfaceConstSoftBodyVertex
- Returns:
- the index
-
getCollisionPlane
Copy the collision plane. The vertex is unaffected. (native attribute: mCollisionPlane)- Specified by:
getCollisionPlane
in interfaceConstSoftBodyVertex
- Returns:
- a new object
-
getInvMass
public float getInvMass()Return the inverse mass. The vertex is unaffected. (native attribute: mInvMass)- Specified by:
getInvMass
in interfaceConstSoftBodyVertex
- Returns:
- the inverse of the mass (in 1/kilograms)
-
getLargestPenetration
public float getLargestPenetration()Return the amount of penetration. (native attribute: mLargestPenetration)- Specified by:
getLargestPenetration
in interfaceConstSoftBodyVertex
- Returns:
- the depth (in meters)
-
getPosition
Copy the location. The vertex is unaffected. (native attribute: mPosition)- Specified by:
getPosition
in 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:
getVelocity
in 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:
hasContact
in interfaceConstSoftBodyVertex
- Returns:
true
if it collided, otherwisefalse
-