SoftBody

A component that can be attached to a PhysicObject of the type DynamicMesh that add soft body physics behaviors to the deformable Mesh.

Soft body physics (or dynamics) can be used for cloth simulation, replicate a whole range of "jelly" and other deformable objects as well as aeros (such as leaves falling etc...).

See Also

Static Variables


Name Description
physicobject Reference to the parent PhysicObject that maintains the SoftBody component.
position_iterations Specify the current amount of position iterations.
cluster_iterations Available only when soft cluster collision is enabled. This value control how many iterations should be used on clusters.
velocity_iterations Amounts of iterations the velocity solver is currently executing.
drift_iterations A value greater than 0 represent that the solver is also processing drift.
drift_interpolation Available only if drift solving is enabled. This value allows you to control the smoothness of the drift.
clusters_generation The active cluster size.
clusters_refine_pass The number of pass to refine clusters.
damping_coefficient The active amount of damping controlling how much the environment will affect the SoftBody.
drag_coefficient The current drag force coefficient to apply on the SoftBody.
lift_coefficient The current lift force coefficients that affect the active SoftBody.
pressure_coefficient Represents the influence of the pressure applied on the SoftBody.
volume_conservation Factor that determine how much upon impact the percentage of the original volume should be kept.
volume_pose_matching Control the percentage of the volume that can be deformed compare to its original pose.
rigid_collision_type Determine which RigidSoftCollision algorithm should be used when the SoftBody collides with a RigidBody.
rigid_contact_hardness Controls the amount of rigid contact hardness.
kinetic_contact_hardness Controls the influence of kinetic contact hardness.
clusters_rigid_contact_hardness Controls the amount of soft vs rigid clusters contact hardness.
clusters_kinetic_contact_hardness Controls the kinetic hardness on soft vs rigid clusters.
clusters_rigid_impulse_split Controls the rigid impulse split factor for soft vs rigid clusters collision.
clusters_kinetic_impulse_split Determine the impulse split factor to use for soft vs rigid clusters collision.
soft_contact_hardness Soft contact hardness factor to use on soft vs soft collision.
clusters_soft_contact_hardness Controls the amount of soft contact hardness soft vs soft clusters collision.
clusters_soft_impulse_split Determine the impulse split factor for soft vs soft clusters collision.
clusters_matching Percentage the clusters should match the original geometry topology.
clusters_linear_damping Amount of linear damping the clusters should be using.
clusters_angular_damping Amount of angular damping the clusters should be using.
clusters_node_damping Amount of damping cluster nodes should be using.
clusters_self_collision_impulse_factor Available only when clusters self-collision is enabled; this value controls the amount of impact with nearby clusters.
clusters_self_max_collision_impulse Determine the maximum amount of impulse that can be applied by nearby clusters.
softconstraint_count Current amount of SoftConstraint attached to the active SoftBody.

Variables


Name Description
default_state The default ActivationState the SoftBody after it is created.
revision Active revision number of the active SoftBody.
friction Friction factor to apply on the SoftBody.
margin Value used to reduce penetration issues during simulation.
contact_processing_threshold Specify the amount of time in second (where 1.0 = 1 sec.) before the SoftBody contact point is considered resting; allowing it to be deactivated.
sleeping_threshold The amount of time the active velocity should be considered stable to allow the SoftBody to be deactivated.
mass Specify the amount of time in second (where 1.0 = 1 sec.) before the SoftBody contact point is considered resting; allowing it to be deactivated.
weighted_mass Force the mass to be evenly spreaded among the nodes that form the SoftBody.
aero_model Specify aero dynamic model (AeroModel) to use for the active SoftBody.
anisotropic_friction Controls the internal friction damping by altering the value of each axis.
wind_velocity Specify a custom wind velocity that will only affect the active SoftBody.
gravity Setup a custom gravity vector that will only affect the active SoftBody.
bending_constraints Determine the type of BendingConstraints to use for the active SoftBody.
anchor_hardness Factor that specifies the impact of anchors attached to the SoftBody.
randomize_constraints Force to randomize the bending constraints applied on the SoftBody.
force Control the amount of force applied on the SoftBody.
velocity Control the amount of velocity applied on the SoftBody.

Functions


Name Description
Activate Try to activate the active SoftBody.
Deactivate Trigger the deactivation of the active SoftBody.
WantsDeactivation Hint that the SoftBody require to be deactivated.
DisableDeactivation Prevent the SoftBody to be deactivated.
DisableSimulation Skip the physic simulation of the active SoftBody.
GetActivationState Return the current ActivationState of the active SoftBody.
SetMass Manually set the mass of a specific node.
SetIterations Helper to modify the active iterations and settings to use for the active SoftBody.
SetClusterSettings Update the settings of a specific cluster.
BuildClusters Function allowing you to build the clusters of the SoftBody.
SetCoefficients Helper allowing you to setup/update the different type of coefficient used by the SoftBody.
SetPose Function to control the orginal pose of the SoftBody to allow it to come back to its original form.
SetVolumeSettings Controls that amounf of volume deformation that can be applied on the active SoftBody.
SetRigidCollisionSettings Function to setup SoftBody vs RigidBody collision settings.
SetRigidClustersCollisionSettings Setup clusters collision parameters.
SetRigidCollisionType Setup the type of collision to use against RigidBody (RigidSoftCollision).
SetSoftCollisionSettings Specify the SoftBody vs SoftBody collision settings.
SetSoftClustersCollisionSettings SoftBody vs SoftBody clusters collision settings.
SetSoftCollisionType Specify the type of collision the SoftBody clusters will be processing.
SetPhysicMaterial Assign a PhysicMaterial to an existing SoftBody primitive.
ClearForces Reset all forces applied on the nodes of SoftBody back to 0.
AddForce Append a certain amount of force to one or more SoftBody node(s).
SetForce Manually set the amount of force of one or all node(s) that construct the SoftBody.
GetForce Return the active force applied on a specific node.
ClearVelocities Zero out the velocity of all nodes contained in the SoftBody.
AddVelocity Append velocity to one or all nodes of the SoftBody.
SetVelocity Set the velocity of one or all nodes contained in the active SoftBody.
GetVelocity Helper that return that active velocity use by a specific node index.
GetClosestNode Helper that returns the AudioPreset reference associated to a specific index.
GetNodeInfo Return the current NodeInfo structure associated with a particular node.
GetNumConstraintLinks Return the amount of constraints currently connected to the active SoftBody.
AddConstraint Generic function to create a new SoftConstraint.
AddPinConstraint Helper function to create and attach a new PinConstraint to the active SoftBody.
AddAnchorConstraint Helper function to create and attach a new AnchorConstraint to the active SoftBody.
AddLinearJointConstraint Helper that creates a new LinearJointConstraint and attach it to the active SoftBody.
AddAngularJointConstraint Helper that creates a new AngularJointConstraint and attach it to the active SoftBody.
GetConstraint Retrieve an existing SoftConstraint maintained by the active SoftBody.
GetConstraintAt Retrieve a constraint using its index as key.
GetConstraintIndex Retrieve the internal index of a specific SoftConstraint maintained by the active SoftBody.
RemoveConstraint Remove a SoftConstraint associated to the current SoftBody.
RemoveConstraintAt Remove a SoftConstraint using its index as key.
Restore Restore the current SoftBody back to its original form before deformation.
UpdateBounds Manually force to update the Bounds of the underlying Object connected to the PhysicObject associated to the current SoftBody.
Update Trigger a manual update of the SoftBody re-evaluating its deformation.
SetBendingConstraintPhysicMaterial Set the PhysicMaterial to use for BendingConstraints.

BendingConstraints


Available types of bending constraints.

  • kDoNotUse: Do not use bending constraints for the active SoftBody; this will cause the SoftBody nodes to be fully bendable and will show no resistance.
  • kOptimized: Optimized version to calculate bending constraints (slightly slower than kRegular but gives better results).
  • kRegular: Generic way to calculate bending constraints (faster than kOptimized to process and give acceptable results).

AeroModel


Available types of aerodynamic models you can use to simulate different types of deformable aeros such as leaves, cloth etc...

  • kVertexOneSided: Vertex normals are taken as it is.
  • kVertexPoint: Vertex normals are oriented toward velocity.
  • kVertexTwoSided: Vertex normals are flipped to match velocity.
  • kVertexTwoSidedLiftDrag: Vertex normals are flipped to match velocity and lift and drag forces are applied.
  • kFaceOnSided: Face normals are taken as it is.
  • kFaceTwoSided: Face normals are flipped to match the velocity.
  • kFaceTwoSidedLiftDrag: Face normals are flipped to match velocity and lift and drag forces are applied.
Note
Using a face approach is faster than using vertices; however all vertex models gives more realistic result but is more complex to calculate (up to 3x).

RigidSoftCollision


Constant types of RigidBody vs SoftBody collision algorithm available. Profile your application to find which model is more suitable.

  • kRigidSoftDisabled: Completly disable rigid vs soft collision detection.
  • kRigidSoftSDF: Use signed distance fields to evaluate the collision between rigid and soft body (approximated).
  • kRigidSoftClusters: Rely on clusters to evaluate collision detection; more precise than using SDF at the cost of more memory (clusters creation is required).

NodeInfo


Structure used to retrieve information about a specific node of a SoftBody.

Static Variables


Name Description
location Current location of the node in world space.
normal Current face normal of the node.
linear_velocity The active linear velocity of the node.
force Amount of force applied on the node.
mass Current mass of the node.




NRG - API 2022.4.384543 - Fri Nov 4 2022
Copyright © 2022 nrgcore.com. All Rights Reserved. Terms of Service - Privacy Policy - EULA