java.lang.Object
com.github.stephengold.joltjni.JoltPhysicsObject
com.github.stephengold.joltjni.Vertex
- All Implemented Interfaces:
ConstJoltPhysicsObject,ConstVertex,AutoCloseable,Comparable<JoltPhysicsObject>
Attributes of a particle, for use during the creation of a soft body. (native
type:
SoftBodySharedSettings::Vertex)-
Constructor Summary
ConstructorsConstructorDescriptionVertex()Instantiate a default vertex.Vertex(ConstVertex original) Instantiate a copy of the specified vertex. -
Method Summary
Modifier and TypeMethodDescriptionfloatReturn the inverse mass.Copy the initial location.Copy the initial velocity.set(ConstVertex source) Copy the argument to the current vertex.setInvMass(float invMass) Alter the inverse mass.setPosition(float x, float y, float z) Alter the initial location of the vertex.setPosition(ConstFloat3 location) Alter the initial location of the vertex.setPosition(Vec3Arg location) Alter the initial location of the vertex.setVelocity(float x, float y, float z) Alter the initial velocity of the vertex.setVelocity(ConstFloat3 velocity) Alter the initial velocity of the vertex.setVelocity(Vec3Arg velocity) Alter the initial velocity of the vertex.toString()Return a string representation of the vertex, which is unaffected.Methods inherited from class com.github.stephengold.joltjni.JoltPhysicsObject
close, compareTo, equals, getContainingObject, hasAssignedNativeObject, hashCode, isCleanerStarted, ownsNativeObject, setVirtualAddress, setVirtualAddress, startCleaner, targetVa, 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
-
Vertex
public Vertex()Instantiate a default vertex. -
Vertex
Instantiate a copy of the specified vertex.- Parameters:
original- the vertex to copy (notnull, unaffected)
-
-
Method Details
-
set
Copy the argument to the current vertex.- Parameters:
source- the vertex to copy (notnull, unaffected)- Returns:
- the modified current vertex, for chaining
-
setInvMass
Alter the inverse mass. (native attribute: mInvMass)- Parameters:
invMass- the desired inverse mass (in 1/kilograms, default=1)- Returns:
- the modified vertex, for chaining
-
setPosition
Alter the initial location of the vertex. (native attribute: mPosition)- Parameters:
location- the desired location (notnull, unaffected default=(0,0,0))- Returns:
- the modified vertex, for chaining
-
setPosition
Alter the initial location of the vertex. (native attribute: mPosition)- Parameters:
x- the desired X coordinate (default=0)y- the desired Y coordinate (default=0)z- the desired Z coordinate (default=0)- Returns:
- the modified vertex, for chaining
-
setPosition
Alter the initial location of the vertex. (native attribute: mPosition)- Parameters:
location- the desired location (notnull, unaffected default=(0,0,0))- Returns:
- the modified vertex, for chaining
-
setVelocity
Alter the initial velocity of the vertex. (native attribute: mVelocity)- Parameters:
velocity- the desired velocity (in meters per second, notnull, unaffected default=(0,0,0))- Returns:
- the modified vertex, for chaining
-
setVelocity
Alter the initial velocity of the vertex. (native attribute: mVelocity)- Parameters:
x- the desired X component (default=0)y- the desired Y component (default=0)z- the desired Z component (default=0)- Returns:
- the modified vertex, for chaining
-
setVelocity
Alter the initial velocity of the vertex. (native attribute: mVelocity)- Parameters:
velocity- the desired velocity (in meters per second, notnull, unaffected, default=(0,0,0))- Returns:
- the modified vertex, for chaining
-
getInvMass
public float getInvMass()Return the inverse mass. The vertex is unaffected. (native attribute: mInvMass)- Specified by:
getInvMassin interfaceConstVertex- Returns:
- the inverse of the mass (in 1/kilograms)
-
getPosition
Copy the initial location. The vertex is unaffected. (native attribute: mPosition)- Specified by:
getPositionin interfaceConstVertex- Returns:
- a new location vector
-
getVelocity
Copy the initial velocity. The vertex is unaffected. (native attribute: mVelocity)- Specified by:
getVelocityin interfaceConstVertex- Returns:
- a new velocity vector (in meters per second)
-
toString
Return a string representation of the vertex, which is unaffected. For example:Vertex{(0.0 2.0 0.0) v(0.0 -1.0 0.0) im=0.5}- Overrides:
toStringin classJoltPhysicsObject- Returns:
- the string representation (not
null, not empty)
-