java.lang.Object
com.github.stephengold.joltjni.JoltPhysicsObject
com.github.stephengold.joltjni.Vertex
- All Implemented Interfaces:
ConstJoltPhysicsObject
,AutoCloseable
,Comparable<JoltPhysicsObject>
Attributes of a particle, for use during the creation of a soft body. (native
type:
SoftBodySharedSettings::Vertex
)-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfloat
Return the inverse mass.Copy the initial location.Copy the initial velocity.void
setInvMass
(float invMass) Alter the inverse mass.void
setPosition
(Float3 location) Alter the initial location of the vertex.void
setPosition
(Vec3Arg location) Alter the initial location of the vertex.void
setVelocity
(Float3 velocity) Alter the initial velocity of the vertex.void
setVelocity
(Vec3Arg velocity) Alter the initial 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
-
Constructor Details
-
Vertex
public Vertex()Instantiate a default vertex.
-
-
Method Details
-
getInvMass
public float getInvMass()Return the inverse mass. The vertex is unaffected. (native attribute: mInvMass)- Returns:
- the inverse of the mass (in 1/kilograms)
-
getPosition
Copy the initial location. The vertex is unaffected. (native attribute: mPosition)- Returns:
- a new location vector
-
getVelocity
Copy the initial velocity. The vertex is unaffected. (native attribute: mVelocity)- Returns:
- a new velocity vector (in meters per second)
-
setInvMass
public void setInvMass(float invMass) Alter the inverse mass. (native attribute: mInvMass)- Parameters:
invMass
- the desired inverse mass (in 1/kilograms, default=1)
-
setPosition
Alter the initial location of the vertex. (native attribute: mPosition)- Parameters:
location
- the desired location (not null, unaffected default=(0,0,0))
-
setPosition
Alter the initial location of the vertex. (native attribute: mPosition)- Parameters:
location
- the desired location (not null, unaffected default=(0,0,0))
-
setVelocity
Alter the initial velocity of the vertex. (native attribute: mVelocity)- Parameters:
velocity
- the desired velocity (in meters per second, not null, unaffected default=(0,0,0))
-
setVelocity
Alter the initial velocity of the vertex. (native attribute: mVelocity)- Parameters:
velocity
- the desired velocity (in meters per second, not null, unaffected, default=(0,0,0))
-