java.lang.Object
com.github.stephengold.joltjni.JoltPhysicsObject
com.github.stephengold.joltjni.HairMaterial
- All Implemented Interfaces:
ConstHairMaterial,ConstJoltPhysicsObject,AutoCloseable,Comparable<JoltPhysicsObject>
Simulation parameters for a hair strand. (native type:
HairSettings::Material)-
Constructor Summary
ConstructorsConstructorDescriptionInstantiate a default material.HairMaterial(ConstHairMaterial original) Instantiate a copy of the specified material. -
Method Summary
Modifier and TypeMethodDescriptionfloatReturn the angular damping coefficient of the rods.floatReturn the compliance of bend constraints, the inverse of bend stiffness.Copy the multiples of bend compliance to be applied to the strand at 0%, 33%, 66% and 100% of its length.booleanTest whether collisions between hair strands and the environment are enabled.booleanTest whether long-range attachments are enabled to keep hair near its modeled pose.floatReturn the friction coefficient for collisions between hair strands and the environment.Access the fraction of the neutral pose applied to hair during each iteration.Access the fraction of gravity to be applied to the hair during simulation.floatReturn the fraction of gravity to be removed during initialization.floatReturn the force factor pushing the hair toward neutral density.Access the fraction of grid velocity to be applied to the hair.Access the radius of the hair strand.floatReturn the inertia of each rod as a multiple of its mass.floatReturn the linear damping coefficient of the rods.floatReturn the maximum angular rate of vertices.floatReturn the maximum speed of vertices.floatReturn the fraction of strands that should be simulated.Access how strongly the scalp influences the global pose.floatReturn the compliance of stretch constraints, the inverse of stretch stiffness.Access the influence of head rotation on hair.setAngularDamping(float damping) Alter the angular damping coefficient of the rods.setBendCompliance(float compliance) Alter the compliance of bend constraints, the inverse of bend stiffness.setBendComplianceMultiplier(Float4 multipliers) Alter the multiples of bend compliance to be applied to the strand at 0%, 33%, 66% and 100% of its length.setEnableCollision(boolean setting) Enable or disable collisions between hair strands and the environment.setEnableLra(boolean setting) Enable or disable long-range attachments to keep hair near its modeled pose.setFriction(float friction) Alter the friction coefficient for collisions between hair strands and the environment.setGlobalPose(ConstGradient gradient) Alter the fraction of the neutral pose applied to hair during each iteration.setGravityFactor(ConstGradient gradient) Alter the fraction of gravity to be applied to the hair during simulation.setGravityPreloadFactor(float factor) Alter the fraction of gravity to be removed during initialization.setGridDensityForceFactor(float factor) Alter the force factor pushing the hair toward neutral density.setGridVelocityFactor(ConstGradient gradient) Alter the fraction of grid velocity to be applied to the hair.setHairRadius(ConstGradient gradient) Alter the radius of the hair strand.setInertiaMultiplier(float multiplier) Alter the inertia of each rod as a multiple of its mass.setLinearDamping(float damping) Alter the linear damping coefficient of the rods.setMaxAngularVelocity(float angularRate) Alter the maximum angular rate of vertices.setMaxLinearVelocity(float speed) Alter the maximum speed of vertices.setSimulationStrandsFraction(float fraction) Alter fraction of strands that should be simulated.setSkinGlobalPose(ConstGradient gradient) Alter how strongly the scalp influences the global pose.setStretchCompliance(float compliance) Alter the compliance of stretch constraints, the inverse of stretch stiffness.setWorldTransformInfluence(ConstGradient gradient) Alter the influence of head rotation on hair.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
-
HairMaterial
public HairMaterial()Instantiate a default material. -
HairMaterial
Instantiate a copy of the specified material.- Parameters:
original- the material to copy (notnull, unaffected)
-
-
Method Details
-
setAngularDamping
Alter the angular damping coefficient of the rods. (native attribute: mAngularDamping)- Parameters:
damping- the desired coefficient (default=2)- Returns:
- the modified material, for chaining
-
setBendCompliance
Alter the compliance of bend constraints, the inverse of bend stiffness. (native attribute: mBendCompliance)- Parameters:
compliance- the desired compliance (default=10^-7)- Returns:
- the modified material, for chaining
-
setBendComplianceMultiplier
Alter the multiples of bend compliance to be applied to the strand at 0%, 33%, 66% and 100% of its length. (native attribute: mBendComplianceMultiplier)- Parameters:
multipliers- the desired multipliers (notnull, unaffected, default=(1,100,100,1))- Returns:
- the modified material, for chaining
-
setEnableCollision
Enable or disable collisions between hair strands and the environment. (native attribute: mEnableCollision)- Parameters:
setting-trueto enable collisions,falseto disable them (default=true)- Returns:
- the modified material, for chaining
-
setEnableLra
Enable or disable long-range attachments to keep hair near its modeled pose. (native attribute: mEnableLRA)- Parameters:
setting-trueto enable attachments,falseto disable them (default=true)- Returns:
- the modified material, for chaining
-
setFriction
Alter the friction coefficient for collisions between hair strands and the environment. (native attribute: mFriction)- Parameters:
friction- the desired friction coefficient (default=0.2)- Returns:
- the modified material, for chaining
-
setGlobalPose
Alter the fraction of the neutral pose applied to hair during each iteration. (native attribute: mGlobalPose)- Parameters:
gradient- the desired variation of the pose fraction along each strand (notnull, unaffected, default=(0.01,0,0,0.3))- Returns:
- the modified material, for chaining
-
setGravityFactor
Alter the fraction of gravity to be applied to the hair during simulation. (native attribute: mGravityFactor)- Parameters:
gradient- the desired variation of the gravity factor along each strand (notnull, unaffected, default=(0.1,1,0.2,0.8))- Returns:
- the modified material, for chaining
-
setGravityPreloadFactor
Alter the fraction of gravity to be removed during initialization. (native attribute: mGravityPreloadFactor)- Parameters:
factor- the desired fraction to remove (default=0)- Returns:
- the modified material, for chaining
-
setGridDensityForceFactor
Alter the force factor pushing the hair toward neutral density. (native attribute: mGridDensityForceFactor)- Parameters:
factor- the desired force factor (default=0)- Returns:
- the modified material, for chaining
-
setGridVelocityFactor
Alter the fraction of grid velocity to be applied to the hair. (native attribute: mGridVelocityFactor)- Parameters:
gradient- the desired variation of the grid influence along each strand (notnull, unaffected, default=(0.05,0.01))- Returns:
- the modified material, for chaining
-
setHairRadius
Alter the radius of the hair strand. (native attribute: mHairRadius)- Parameters:
gradient- the desired variation of each strand's radius along its length (in meters, notnull, unaffected, default=(0.001,0.001))- Returns:
- the modified material, for chaining
-
setInertiaMultiplier
Alter the inertia of each rod as a multiple of its mass. (native attribute: mInertiaMultiplier)- Parameters:
multiplier- the desired ratio (default=10)- Returns:
- the modified material, for chaining
-
setLinearDamping
Alter the linear damping coefficient of the rods. (native attribute: mLinearDamping)- Parameters:
damping- the desired coefficient (default=2)- Returns:
- the modified material, for chaining
-
setMaxAngularVelocity
Alter the maximum angular rate of vertices. (native attribute: mMaxAngularVelocity)- Parameters:
angularRate- the desired rate limit (in radians per second, default=50)- Returns:
- the modified material, for chaining
-
setMaxLinearVelocity
Alter the maximum speed of vertices. (native attribute: mMaxLinearVelocity)- Parameters:
speed- the desired speed (in meters per second, default=10)- Returns:
- the modified material, for chaining
-
setSimulationStrandsFraction
Alter fraction of strands that should be simulated. Used byInitRenderAndSimulationStrandsonly. (native attribute: mSimulationStrandsFraction)- Parameters:
fraction- the desired fraction (default=0.1)- Returns:
- the modified material, for chaining
-
setSkinGlobalPose
Alter how strongly the scalp influences the global pose. (native attribute: mSkinGlobalPose)- Parameters:
gradient- the desired variation of influence along each strand (notnull, unaffected, 0=no influence, 1=fully following, default=(1,0,0,0.1))- Returns:
- the modified material, for chaining
-
setStretchCompliance
Alter the compliance of stretch constraints, the inverse of stretch stiffness. (native attribute: mStretchCompliance)- Parameters:
compliance- the desired compliance (default=10^-8)- Returns:
- the modified material, for chaining
-
setWorldTransformInfluence
Alter the influence of head rotation on hair. (native attribute: mWorldTransformInfluence)- Parameters:
gradient- the desired variation of influence along each strand (notnull, unaffected, 0=no influence, 1=fully following, default=(0,1))- Returns:
- the modified material, for chaining
-
getAngularDamping
public float getAngularDamping()Return the angular damping coefficient of the rods. The material is unaffected. (native attribute: mAngularDamping)- Specified by:
getAngularDampingin interfaceConstHairMaterial- Returns:
- the coefficient
-
getBendCompliance
public float getBendCompliance()Return the compliance of bend constraints, the inverse of bend stiffness. The material is unaffected. (native attribute: mBendCompliance)- Specified by:
getBendCompliancein interfaceConstHairMaterial- Returns:
- the compliance value
-
getBendComplianceMultiplier
Copy the multiples of bend compliance to be applied to the strand at 0%, 33%, 66% and 100% of its length. (native attribute: mBendComplianceMultiplier)- Specified by:
getBendComplianceMultiplierin interfaceConstHairMaterial- Returns:
- a new object
-
getEnableCollision
public boolean getEnableCollision()Test whether collisions between hair strands and the environment are enabled. The material is unaffected. (native attribute: mEnableCollision)- Specified by:
getEnableCollisionin interfaceConstHairMaterial- Returns:
trueif enabled, otherwisefalse
-
getEnableLra
public boolean getEnableLra()Test whether long-range attachments are enabled to keep hair near its modeled pose. The material is unaffected. (native attribute: mEnableLRA)- Specified by:
getEnableLrain interfaceConstHairMaterial- Returns:
trueif enabled, otherwisefalse
-
getFriction
public float getFriction()Return the friction coefficient for collisions between hair strands and the environment. The material is unaffected. (native attribute: mFriction)- Specified by:
getFrictionin interfaceConstHairMaterial- Returns:
- the friction coefficient
-
getGlobalPose
Access the fraction of the neutral pose applied to hair during each iteration. (native attribute: mGlobalPose)- Specified by:
getGlobalPosein interfaceConstHairMaterial- Returns:
- a new JVM object with the pre-existing native object assigned
-
getGravityFactor
Access the fraction of gravity to be applied to the hair during simulation. (native attribute: mGravityFactor)- Specified by:
getGravityFactorin interfaceConstHairMaterial- Returns:
- a new JVM object with the pre-existing native object assigned
-
getGravityPreloadFactor
public float getGravityPreloadFactor()Return the fraction of gravity to be removed during initialization. The material is unaffected. (native attribute: mGravityPreloadFactor)- Specified by:
getGravityPreloadFactorin interfaceConstHairMaterial- Returns:
- the fraction
-
getGridDensityForceFactor
public float getGridDensityForceFactor()Return the force factor pushing the hair toward neutral density. The material is unaffected. (native attribute: mGridDensityForceFactor)- Specified by:
getGridDensityForceFactorin interfaceConstHairMaterial- Returns:
- the force factor
-
getGridVelocityFactor
Access the fraction of grid velocity to be applied to the hair. (native attribute: mGridVelocityFactor)- Specified by:
getGridVelocityFactorin interfaceConstHairMaterial- Returns:
- a new JVM object with the pre-existing native object assigned
-
getHairRadius
Access the radius of the hair strand. (native attribute: mHairRadius)- Specified by:
getHairRadiusin interfaceConstHairMaterial- Returns:
- a new JVM object with the pre-existing native object assigned
-
getInertiaMultiplier
public float getInertiaMultiplier()Return the inertia of each rod as a multiple of its mass. The material is unaffected. (native attribute: mInertiaMultiplier)- Specified by:
getInertiaMultiplierin interfaceConstHairMaterial- Returns:
- the ratio
-
getLinearDamping
public float getLinearDamping()Return the linear damping coefficient of the rods. The material is unaffected. (native attribute: mLinearDamping)- Specified by:
getLinearDampingin interfaceConstHairMaterial- Returns:
- the damping coefficient
-
getMaxAngularVelocity
public float getMaxAngularVelocity()Return the maximum angular rate of vertices. The material is unaffected. (native attribute: mMaxAngularVelocity)- Specified by:
getMaxAngularVelocityin interfaceConstHairMaterial- Returns:
- the rate limit (in radians per second)
-
getMaxLinearVelocity
public float getMaxLinearVelocity()Return the maximum speed of vertices. The material is unaffected. (native attribute: mMaxLinearVelocity)- Specified by:
getMaxLinearVelocityin interfaceConstHairMaterial- Returns:
- the speed limit (in meters per second)
-
getSimulationStrandsFraction
public float getSimulationStrandsFraction()Return the fraction of strands that should be simulated. Used byInitRenderAndSimulationStrandsonly. The material is unaffected. (native attribute: mSimulationStrandsFraction)- Specified by:
getSimulationStrandsFractionin interfaceConstHairMaterial- Returns:
- the fraction
-
getSkinGlobalPose
Access how strongly the scalp influences the global pose. (native attribute: mSkinGlobalPose)- Specified by:
getSkinGlobalPosein interfaceConstHairMaterial- Returns:
- a new JVM object with the pre-existing native object assigned
-
getStretchCompliance
public float getStretchCompliance()Return the compliance of stretch constraints, the inverse of stretch stiffness. The material is unaffected. (native attribute: mStretchCompliance)- Specified by:
getStretchCompliancein interfaceConstHairMaterial- Returns:
- the compliance value
-
getWorldTransformInfluence
Access the influence of head rotation on hair. (native attribute: mWorldTransformInfluence)- Specified by:
getWorldTransformInfluencein interfaceConstHairMaterial- Returns:
- a new JVM object with the pre-existing native object assigned
-