69#if MOCHI_LANGUAGE_CPP20
83#if MOCHI_LANGUAGE_CPP20
95#if MOCHI_LANGUAGE_CPP20
105#if MOCHI_LANGUAGE_CPP20
177#if MOCHI_LANGUAGE_CPP20
205#if MOCHI_LANGUAGE_CPP20
227#if MOCHI_LANGUAGE_CPP20
245#if MOCHI_LANGUAGE_CPP20
275#if MOCHI_LANGUAGE_CPP20
292#if MOCHI_LANGUAGE_CPP20
313#if MOCHI_LANGUAGE_CPP20
326#if MOCHI_LANGUAGE_CPP20
337#if MOCHI_LANGUAGE_CPP20
348 std::optional<ArticulatedSkinParams>
skin;
351#if MOCHI_LANGUAGE_CPP20
373#if MOCHI_LANGUAGE_CPP20
387#if MOCHI_LANGUAGE_CPP20
399 std::optional<real>
max{};
401 std::optional<real>
min{};
403#if MOCHI_LANGUAGE_CPP20
419#if MOCHI_LANGUAGE_CPP20
433#if MOCHI_LANGUAGE_CPP20
445#if MOCHI_LANGUAGE_CPP20
463#if MOCHI_LANGUAGE_CPP20
483#if MOCHI_LANGUAGE_CPP20
495#if MOCHI_LANGUAGE_CPP20
507#if MOCHI_LANGUAGE_CPP20
519#if MOCHI_LANGUAGE_CPP20
531#if MOCHI_LANGUAGE_CPP20
543#if MOCHI_LANGUAGE_CPP20
557#if MOCHI_LANGUAGE_CPP20
569#if MOCHI_LANGUAGE_CPP20
585#if MOCHI_LANGUAGE_CPP20
599#if MOCHI_LANGUAGE_CPP20
673#if MOCHI_LANGUAGE_CPP20
687#if MOCHI_LANGUAGE_CPP20
699#if MOCHI_LANGUAGE_CPP20
737#if MOCHI_LANGUAGE_CPP20
747#if MOCHI_LANGUAGE_CPP20
757#if MOCHI_LANGUAGE_CPP20
A dynamically resizable array with syntax and behavior similar to std::pmr::vector.
Represents a simulation scene.
ConvergenceStatus
Convergence status of the non-linear solver.
@ None
Convergence status has not been set.
ArticulatedJointType
Types of joints in an articulated body.
PoseConstraintType
Type of constraint in an articulated pose controller.
@ Invalid
Invalid constraint type.
ActorBoundaryElementType
Two-dimensional discretization element types for actor boundary integrals.
@ Default
Default actor boundary element type.
constexpr Real2 kMinus2PiPlus2Pi
IntegrationMethod
Time integration methods.
@ Default
Default time integration method.
ActorSegmentElementType
One-dimensional discretization element types for actor segment integrals.
@ Default
Default actor segment element type.
ColliderType
Collision detection geometry for an Actor.
@ Auto
Automatic collider type selection based on the actor's shape.
@ None
No collision representation.
std::basic_string< char, std::char_traits< char >, StlAllocator< char > > DynamicString
Alias for std::string using a polymorphic superdex::Allocator pointer.
BoundarySubsamplingStrategy
Strategy for selecting the active boundary faces when subsampling boundary integrals.
@ UniformProbability
Select boundary faces with uniform probability.
Unique identifier for an Actor within a Scene.
Parameters for creating a range constraint on a 3D-rotation articulated joint.
int jointIndex
Index of the joint in the articulated actor.
ActorHandle actor
Actor handle identifying the articulated actor.
bool operator==(Articulated3dRotationRangeConstraintParams const &) const =default
Real3 minValues
Minimum allowed value [rad] for each component of the joint-local rotation vector.
Real3 maxValues
Maximum allowed value [rad] for each component of the joint-local rotation vector.
Parameters for creating a target constraint on 3D rotation DoFs of an articulated actor.
bool operator==(Articulated3dRotationTargetConstraintParams const &) const =default
ActorHandle actor
Actor handle identifying the articulated actor.
Quaternion target
Target rotation relative to the joint's rest orientation, expressed in the joint's local frame as a q...
int jointIndex
Index of the joint in the articulated actor.
Parameters to create an articulated actor.
DynamicArray< ArticulatedLinkParams > links
Link actor parameters (one per link).
DynamicString name
Name of the articulated actor.
std::optional< ArticulatedSkinParams > skin
Optional skinned mesh parameters.
std::optional< DynamicArray< real > > jointVelocities
Optional initial joint velocity per DoF [m/s or rad/s].
TransformRT worldFromRoot
Initial rotation and translation of the articulated actor's local frame with respect to world frame.
bool operator==(ArticulatedActorParams const &) const =default
DynamicArray< ArticulatedJointParams > joints
Joint parameters (one per joint).
DynamicArray< ArticulatedCycleJointParams > cycles
Optional cycle joints creating closed kinematic loops.
Parameters for a cycle-closing joint within an articulated actor.
TransformRT jointFromChildLink
Position and rotation of the cycle joint constraint in the child link's local frame.
int childLink
Child link index.
bool operator==(ArticulatedCycleJointParams const &) const =default
real stiffness
Stiffness [N/m] for the cycle joint constraint.
int parentLink
Parent link index.
Per-joint friction parameters for articulated bodies.
Parameters describing a single joint within an articulated actor.
ArticulatedJointFrictionParams friction
Joint friction parameters.
std::optional< Real3 > minLimit
Minimum joint limits for each DoF.
real limitDamping
Damping coefficient [N·s/m or N·m·s/rad] for the joint limit constraints.
std::optional< Real3 > maxLimit
Maximum joint limits for each DoF.
DynamicString name
Joint name.
Real3 axis
Local axis of motion for the joint, in the joint's local frame.
bool operator==(ArticulatedJointParams const &) const =default
ArticulatedJointType type
Joint type.
std::optional< real > inertia
Joint inertia coefficient.
real limitStiffness
Stiffness coefficient [N/m or N·m/rad] for the joint limit constraints.
TransformRT parentLinkFromJoint
Rotation and translation of the joint with respect to the parent link.
Parameters describing a single rigid link within an articulated actor.
std::optional< real > density
Uniform density [kg/m³] of the actor.
TransformRT parentJointFromLink
Rotation and translation of the link with respect to the parent joint.
ColliderType colliderType
Collision detection geometry.
ShapeHandle shape
Shape handle defining the actor's geometry and other metadata.
DynamicString name
Link local name.
int parentLink
Index of the parent link in ArticulatedActorParams::links, or -1 for the root.
ActorBoundaryElementType boundaryElementType
Finite element type for boundary discretization.
bool hasGravity
If true, the link actor will be affected by gravity.
std::optional< Real3 > centerOfMass
Position [m] of the center of mass in the link actor's local frame.
bool operator==(ArticulatedLinkParams const &) const =default
std::optional< real > mass
Total mass [kg] of the actor.
ContactParams contact
Contact mechanics parameters.
std::optional< BoundarySubsamplingParams > boundarySubsampling
Optional subsampling for boundary integrals such as contact.
std::optional< Real6 > momentOfInertia
Moment of inertia tensor [kg·m²] at the center of mass in the actor's local frame.
DynamicString layer
Contact layer name for filtering contacts between actors.
Information describing an articulated shape's kinematic structure.
Span< TransformRT const > parentLinkFromJoint
Joint frame of each joint expressed in its parent link's local frame (rotation + translation).
Span< DynamicString const > linkNames
Name of each link.
Span< Real3 const > jointMinLimits
Minimum joint limits for each joint DoF.
Span< Real3 const > jointMaxLimits
Maximum joint limits for each joint DoF.
Span< ArticulatedJointType const > jointTypes
Type of each joint.
Span< ArticulatedDofInfo const > dofInfo
DoF information of each joint (offset within the full pose, number of translation DoFs,...
Span< Real3 const > jointAxes
Axis of each joint in the joint's local frame.
Span< TransformRT const > jointFromChildLink
Transform from each joint's child link to the joint frame (rotation + translation).
Span< ArticulatedCycleJoint const > cycles
Cycle joints creating closed kinematic loops in the articulated body.
Span< TransformRT const > rootFromLinksAtRest
Rotation and translation of each link in rest configuration relative to the local reference system of...
Span< int const > parents
Parent link indices defining a tree-like joint structure with no cycles.
Span< DynamicString const > jointNames
Name of each joint.
Parameters for creating a range constraint on a single articulated DoF.
real minValue
Minimum value for the DoF.
bool operator==(ArticulatedSingleDofRangeConstraintParams const &) const =default
int dofIndex
DoF index within the joint (0-based).
real maxValue
Maximum value for the DoF.
ActorHandle actor
Actor handle identifying the articulated actor.
int jointIndex
Index of the joint in the articulated actor.
Parameters for creating a target constraint on a single articulated DoF.
ActorHandle actor
Actor handle identifying the articulated actor.
real targetValue
Target value for the joint DoF.
bool operator==(ArticulatedSingleDofTargetConstraintParams const &) const =default
int dofIndex
DoF index within the joint (0-based).
int jointIndex
Index of the joint in the articulated actor.
Optional skinned mesh attached to an articulated actor for collision and rendering.
std::optional< DynamicArray< DynamicString > > nonCollidingLinks
Local names of links that do not act as colliding actors.
bool operator==(ArticulatedSkinParams const &) const =default
ActorBoundaryElementType boundaryElementType
Finite element type for boundary discretization.
ShapeHandle shape
Shape handle defining the skinned triangular or tetrahedral mesh.
std::optional< BoundarySubsamplingParams > boundarySubsampling
Optional subsampling for boundary integrals such as contact.
ContactParams contact
Contact mechanics parameters.
DynamicString layer
Contact layer name for filtering contacts between actors.
Parameters controlling the stepping behavior of an AsyncScene.
std::function< double()> timeStepCallback
Optional callback to provide custom time step size [s].
double dynamicTimeStepMaxSeconds
Maximum time step size [s] in dynamic mode.
double dynamicTimeStepMinSeconds
Minimum time step size [s] in dynamic mode.
double fixedTimeStepSeconds
Fixed time step size [s].
bool useFixedTimeStep
Use fixed time step if true, dynamic (real-time) time step if false.
Parameters for subsampling boundary integrals such as contact.
real subsamplingDensity
Subsampling density in the range [0, 1].
BoundarySubsamplingStrategy strategy
Strategy for determining which sample points to use.
bool operator==(BoundarySubsamplingParams const &) const =default
Unique identifier for a Constraint within a Scene.
Base constraint parameters.
real saturation
Saturation distance [m] or angle [rad].
real stiffness
Constraint stiffness coefficient.
bool operator==(ConstraintParams const &) const =default
real damping
Constraint damping coefficient.
Collection of debug draw primitives.
bool operator==(DebugDrawData const &) const =default
DebugDrawSpheres spheres
Sphere primitives.
DebugDrawLineVertices lineVertices
Line primitives.
Line primitives for debug visualization.
Span< Color const > colors
Line vertex colors.
bool operator==(DebugDrawLineVertices const &) const =default
Span< Real3 const > positions
Line vertex positions [m] in world frame.
Sphere primitives for debug visualization.
bool operator==(DebugDrawSpheres const &) const =default
Span< real const > radii
Sphere radii [m].
Span< Color const > colors
Sphere colors.
Span< Real3 const > positions
Sphere center positions [m] in world frame.
[Experimental] Evaluation settings common to the full scene.
Parameters controlling the resolution of grid-based Signed Distance Fields (SDF).
Parameters for creating a joint rotation range constraint between two rigid actors.
Real2 angleRangeY
Allowed range [min, max] [rad] for the Y component of the relative rotation vector (axis-angle),...
Real2 angleRangeZ
Allowed range [min, max] [rad] for the Z component of the relative rotation vector (axis-angle),...
ActorHandle actorB
Actor handle identifying rigid actor B.
Real2 angleRangeX
Allowed range [min, max] [rad] for the X component of the relative rotation vector (axis-angle),...
ActorHandle actorA
Actor handle identifying rigid actor A.
Real3 refFrameRotVec
Joint reference frame specified as a rotation vector [rad] with respect to world frame.
bool operator==(JointRotationRangeConstraintParams const &) const =default
bool rangeAroundRest
When true, angle limits are relative to the actors' relative rotation at constraint creation time.
Parameters for creating a joint rotation tracking constraint between two rigid actors.
ActorHandle actorA
Actor handle identifying rigid actor A.
bool operator==(JointRotationTrackingConstraintParams const &) const =default
ActorHandle actorB
Actor handle identifying rigid actor B.
Real3 refFrameRotVec
Joint reference-frame orientation in world coordinates at constraint creation, expressed as a rotatio...
Parameters for the linear solve performed in each iteration of the non-linear solver.
Parameters for the non-linear solver.
Geometric and logical properties of a point-cloud collider.
std::optional< ActorSegmentElementType > colliderSegmentElementType
Segment element type for collider discretization on a curve.
bool operator==(PointCloudColliderParams const &) const =default
real radius
Range of interaction of the contact penalty potential evaluated between pairs of points.
real spatialHashLoadFactor
Load factor for the spatial hash table used in collision detection.
std::optional< ActorBoundaryElementType > colliderTriangleElementType
Triangle element type for collider discretization on a surface.
bool selfContact
Whether to enable self-contact for this actor.
real selfContactExclusionRatio
Contact samples whose reference-configuration positions are within a radius of (radius * selfContactE...
Information about a single pose constraint in a pose controller.
int parent
Index of the parent link, or -1 if none.
ConstraintHandle handle
Handle to the underlying constraint.
PoseConstraintType type
Type of constraint.
int link
Index of the target link in the articulated body.
PoseControllerParams(int numLinks)
Construct with all tracking arrays pre-sized to numLinks default-constructed PoseTrackingParams (zero...
PoseControllerParams()=default
DynamicArray< PoseTrackingParams > linkRotTracking
Tracking parameters for link rotation constraints.
DynamicArray< PoseTrackingParams > linkPosTracking
Tracking parameters for link position constraints.
DynamicArray< PoseTrackingParams > jointTracking
Tracking parameters for joint constraints.
Parameters for pose controller tracking constraints.
real saturation
Saturation distance [m] or angle [rad].
real stiffness
Constraint stiffness.
bool operator==(PoseTrackingParams const &) const =default
real damping
Constraint damping.
Parameters controlling recentering behavior for standalone soft, shell, and rod actors.
bool operator==(RecenteringParams const &) const =default
real translationEpsilon
Minimum translation threshold [m] to apply recentering.
bool useRecentering
Whether recentering is enabled.
real rotationEpsilonDeg
Minimum rotation threshold [degrees] to apply recentering.
Parameters to create a rigid body actor.
bool hasGravity
If true, actor is affected by gravity.
DynamicString layer
Contact layer name for filtering contacts between actors.
ContactParams contact
Contact mechanics parameters.
ColliderType colliderType
Collision detection geometry.
ShapeHandle shape
Shape handle defining the actor's geometry and other metadata.
bool operator==(RigidActorParams const &) const =default
std::optional< real > mass
Total mass [kg] of the actor.
ActorBoundaryElementType boundaryElementType
Finite element type for boundary discretization.
std::optional< Real3 > linearVelocity
Optional initial linear velocity of the center of mass in world frame [m/s], zero otherwise.
std::optional< BoundarySubsamplingParams > boundarySubsampling
Optional subsampling for boundary integrals such as contact.
GridSdfParams sdf
Parameters used to construct a grid-based Signed Distance Field (SDF) if the shape doesn't already ha...
std::optional< Real6 > momentOfInertia
Moment of inertia tensor [kg·m²] at the center of mass in the actor's local frame.
TransformRT worldFromLocal
Initial rotation and translation of the actor's local frame with respect to world frame.
bool isStatic
If true, actor will be static (fixed in space).
std::optional< real > density
Uniform density [kg/m³] of the actor.
std::optional< Real3 > angularVelocity
Optional initial angular velocity in world frame [rad/s], zero otherwise.
std::optional< Real3 > centerOfMass
Position [m] of the center of mass in the actor's local frame.
DynamicString name
Optional actor name.
Parameters for creating a position constraint on a rigid actor's pivot point.
ActorHandle actor
Actor handle identifying the rigid actor.
Real3 localPosition
Pivot point in rigid actor's local frame [m].
bool operator==(RigidPivotPositionConstraintParams const &) const =default
Real3 targetPosition
Target position in world frame [m].
Parameters for creating a rotation constraint on a rigid actor's pivot frame.
ActorHandle actor
Actor handle identifying the rigid actor.
Real3 localRotation
Pivot frame in rigid actor's local coordinates, as a rotation vector [rad].
bool operator==(RigidPivotRotationConstraintParams const &) const =default
Real3 targetRotation
Target rotation in world coordinates, as a rotation vector [rad].
Parameters for creating a constraint on a rigid actor's pivot point.
ActorHandle actor
Actor handle identifying the rigid actor.
bool operator==(RigidPivotToRigidTargetConstraintParams const &) const =default
TransformRT targetTransform
Target center-of-mass transform.
Real3 localPosition
Pivot point in rigid actor's local frame [m].
Parameters for creating a prismatic joint between two rigid actors.
bool operator==(RigidPrismaticJointConstraintParams const &) const =default
Real3 freeAxis
Axis of free translation, specified in the world frame at constraint creation time.
std::optional< real > min
Minimum translation [m] relative to rest position.
std::optional< real > max
Maximum translation [m] relative to rest position.
ActorHandle actorA
Actor handle identifying rigid actor A.
ActorHandle actorB
Actor handle identifying rigid actor B.
Parameters for creating a spherical joint between two rigid actors.
Real3 localPosA
Joint position [m] for rigid actor A in actor A's local frame.
bool operator==(RigidSphericalJointConstraintParams const &) const =default
Real3 localPosB
Joint position [m] for rigid actor B in actor B's local frame.
ActorHandle actorB
Actor handle identifying rigid actor B.
ActorHandle actorA
Actor handle identifying rigid actor A.
Parameters to create a rod actor.
bool hasGravity
Enables gravity.
RodMaterialParams material
Rod material properties.
TransformRT worldFromLocal
World-from-local transform applied to the shape.
DynamicString name
Actor name.
bool useContactSkin
Use the rod shape's contact skin for contact instead of its centerline.
ActorSegmentElementType contactElementType
Element type controlling the number of contact samples per segment.
ColliderType colliderType
Collider type.
ActorBoundaryElementType contactSkinElementType
Triangle element type for contact-skin quadrature.
ContactParams contact
Contact properties for interactions with volume actors.
PointCloudColliderParams pointCloudCollider
Geometric and logical properties of the point-cloud collider.
DynamicString layer
Contact layer name.
bool operator==(RodActorParams const &) const =default
ShapeHandle shape
Shape handle defining the rod geometry.
Parameters for creating a tracking constraint on the world rotation of a rod element.
bool operator==(RodElementRotationConstraintParams const &) const =default
ActorHandle actor
Actor handle identifying the rod actor.
Real3 refFrameRotVec
Reference-frame orientation relative to the target rotation, expressed as a rotation vector [rad].
int elementIndex
Index of the element in the rod actor.
Parameters for creating a tracking constraint on the relative rotation between a rigid actor and a ro...
ActorHandle rigidActor
Actor handle identifying rigid actor.
ActorHandle rodActor
Actor handle identifying rod actor.
bool operator==(RodElementRotationToRigidConstraintParams const &) const =default
Real3 refFrameRotVec
Joint reference-frame orientation in world coordinates at constraint creation, expressed as a rotatio...
int elementIndex
Index of the element in the rod actor.
Material properties of a rod actor.
bool operator==(RodMaterialParams const &) const =default
real massDampingCoefficient
Mass-proportional damping coefficient.
real linearDensity
Mass per unit undeformed length.
real linearRotationalInertia
Rotational inertia about the rod's axis, per unit undeformed length.
real axialStiffness
Axial stiffness.
real torsionalStiffness
Torsional stiffness.
real axialCollapseBarrierScale
Dimensionless scale of an optional barrier against axial collapse.
Real2 flexuralStiffness
Flexural stiffnesses about the element frame axis and about the perpendicular cross-sectional axis,...
real stiffnessDampingCoefficient
Stiffness-proportional damping coefficient.
SDF distance information for active contact sample points.
Span< real const > distances
Signed distances [m] to the closest surface.
Span< int const > sampleIndices
Indices into the actor's contact sample points array.
real maxSdfFarDistanceEvaluation
Maximum distance [m] at which SDF evaluation was performed.
Span< Real3 const > distanceGrads
SDF gradients at sample positions, in world frame.
Span< Real3 const > worldPositions
Sample positions [m] in world frame.
Handle to a shape (mesh, sphere, plane, etc.) within a Context.
Parameters to create a soft deformable actor.
SoftMaterialParams material
Uniform material properties.
ShapeHandle shape
Shape handle defining the actor's geometry and other metadata.
bool hasStress
If true, actor is affected by internal stress/strain forces.
bool hasInertia
If true, actor is affected by inertial forces.
DynamicString name
Optional actor name.
DynamicString layer
Contact layer name for filtering contacts between actors.
ContactParams contact
Contact mechanics parameters.
ActorBoundaryElementType boundaryElementType
Finite element type for contact discretization.
bool useContactSkin
[Experimental] Use the shape's authored contact skin for colliding contact samples.
TransformRT worldFromLocal
Initial rotation and translation of the actor's local frame with respect to world frame.
bool hasGravity
If true, actor is affected by gravity.
bool operator==(SoftActorParams const &) const =default
Material parameters for soft body simulation.
Parameters to create soft-skinned actors with a shared articulated skeleton.
bool hasGravity
Enable gravity evaluation of nested soft actors on posed/skinned positions.
bool hasInertia
Enable inertia evaluation of nested soft actors on posed/skinned positions.
bool enableCollidingLinks
Enable internal skeleton links as colliding actors.
ArticulatedActorParams skeletonParams
Parameters for the articulated skeleton.
DynamicArray< DynamicString > softAttachLinks
Optional local names of the rigid links where nested soft actors are attached.
bool hasStress
Enable elasticity evaluation of nested soft actors on posed/skinned positions.
DynamicArray< SoftActorParams > softParams
Parameters for the nested soft actors.
Simulation solver configuration parameters.
LinearSolverParams linearSolver
Linear solver settings.
NonLinearSolverParams nonLinearSolver
Nonlinear solver settings.
bool operator==(SolverParams const &) const =default
ExperimentalEvalParams experimentalEval
[Experimental] Evaluation settings common to the full scene.
IntegrationMethod integrationMethod
Time integration method.
Solver convergence metrics from the last simulation step.
ConvergenceStatus convergenceStatus
Aggregate convergence status of the scene in the last call to Scene::Step.
int maxLineSearchIters
Maximum number of line-search iterations per Newton solve across all awake islands and integration st...
int maxNonLinearIters
Maximum number of non-linear solver iterations across all awake islands and integration stages in the...
bool operator==(SolverStats const &) const =default
double residualNorm
Aggregate residual norm across all awake islands and integration stages in the last call to Scene::St...
Information passed to per-step callbacks.
Scene * scene
Pointer to the Scene being stepped.
double timeStepSec
Time step size [s] for this simulation step.