java.lang.Object
com.github.stephengold.joltjni.JoltPhysicsObject
com.github.stephengold.joltjni.SVertex
- All Implemented Interfaces:
ConstJoltPhysicsObject,ConstSVertex,AutoCloseable,Comparable<JoltPhysicsObject>
A single vertex used to simulate a strand of hair. (native type:
HairSettings::SVertex)-
Constructor Summary
ConstructorsConstructorDescriptionSVertex()Instantiate a default vertex.SVertex(ConstFloat3 location, float inverseMass) Instantiate a vertex with the specified location and inverse mass. -
Method Summary
Modifier and TypeMethodDescriptionCopy the bishop frame of the strand in its modeled pose, computed byinit().floatReturn the inverse of the mass.floatReturn the initial distance between this vertex from the next one in the unloaded strand, computed byinit().Copy the rotation between the previous rod and this one in the unloaded strand, computed byinit().Copy the initial location of the vertex in its modeled pose.floatReturn the fraction of the way along the strand, computed byinit().voidsetInvMass(float inverseMass) Alter the mass.voidsetPosition(ConstFloat3 location) Alter the initial location of the vertex in its modeled pose.voidsetPosition(Vec3Arg location) Alter the initial location of the vertex in its modeled pose.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
-
SVertex
public SVertex()Instantiate a default vertex. -
SVertex
Instantiate a vertex with the specified location and inverse mass.- Parameters:
location- the desired coordinates (notnull, unaffected, default=(0,0,0))inverseMass- the inverse of the desired mass (default=1)
-
-
Method Details
-
setInvMass
public void setInvMass(float inverseMass) Alter the mass. (native attribute: mInvMass)- Parameters:
inverseMass- the inverse of the desired mass (default=1)
-
setPosition
Alter the initial location of the vertex in its modeled pose. (native attribute: mPosition)- Parameters:
location- the desired coordinates (notnull, unaffected, default=(0,0,0))
-
setPosition
Alter the initial location of the vertex in its modeled pose. (native attribute: mPosition)- Parameters:
location- the desired coordinates (notnull, unaffected, default=(0,0,0))
-
getBishop
Copy the bishop frame of the strand in its modeled pose, computed byinit(). The vertex is unaffected. (native attribute: mBishop)- Specified by:
getBishopin interfaceConstSVertex- Returns:
- a new vector
-
getInvMass
public float getInvMass()Return the inverse of the mass. The vertex is unaffected. (native attribute: mInvMass)- Specified by:
getInvMassin interfaceConstSVertex- Returns:
- the value
-
getLength
public float getLength()Return the initial distance between this vertex from the next one in the unloaded strand, computed byinit(). The vertex is unaffected. (native attribute: mLength)- Specified by:
getLengthin interfaceConstSVertex- Returns:
- the distance
-
getOmega0
Copy the rotation between the previous rod and this one in the unloaded strand, computed byinit(). The vertex is unaffected. (native attribute: mOmega0)- Specified by:
getOmega0in interfaceConstSVertex- Returns:
- a new vector
-
getPosition
Copy the initial location of the vertex in its modeled pose. The vertex is unaffected. (native attribute: mPosition)- Specified by:
getPositionin interfaceConstSVertex- Returns:
- a new vector
-
getStrandFraction
public float getStrandFraction()Return the fraction of the way along the strand, computed byinit(). The vertex is unaffected. (native attribute: mStrandFraction)- Specified by:
getStrandFractionin interfaceConstSVertex- Returns:
- the fractional distance (0=start, 1=end)
-