63#if MOCHI_LANGUAGE_CPP20
81#if MOCHI_LANGUAGE_CPP20
153#if MOCHI_LANGUAGE_CPP20
179#if MOCHI_LANGUAGE_CPP20
196#if MOCHI_LANGUAGE_CPP20
217#if MOCHI_LANGUAGE_CPP20
229#if MOCHI_LANGUAGE_CPP20
240#if MOCHI_LANGUAGE_CPP20
251 std::optional<ArticulatedSkinParams>
skin;
254#if MOCHI_LANGUAGE_CPP20
276#if MOCHI_LANGUAGE_CPP20
298 std::optional<real>
max{};
300 std::optional<real>
min{};
386#if MOCHI_LANGUAGE_CPP20
508#if MOCHI_LANGUAGE_CPP20
522#if MOCHI_LANGUAGE_CPP20
580#if MOCHI_LANGUAGE_CPP20
618#if MOCHI_LANGUAGE_CPP20
628#if MOCHI_LANGUAGE_CPP20
638#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.
ColliderType
Collision detection geometry for an Actor.
@ Auto
Automatic collider type selection based on the actor's shape.
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.
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.
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.
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.
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.
bool operator==(ArticulatedSkinParams const &) const =default
ActorBoundaryElementType boundaryElementType
Finite element type for boundary discretization.
ShapeHandle shape
Shape handle defining the skinned triangle 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 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.
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.
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 soft actors (not soft-skinned).
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 controlling what data gets included in a scene recording.
bool recordNodeContactForces
Record results for QueryType::NodeContactForces for each soft actor every step.
bool recordActorMassMatrix
Include the mass matrix (if any) when recording actor creation events.
bool recordActorLocalToGlobalMap
Include the local-to-global map (if any) when recording actor creation events.
static RecordingParams All(bool enabled=true)
Return RecordingParams with all boolean options set to the given value.
bool recordStaticActorState
Record the state of static actors every step.
bool recordSdfDistances
Record SDF distances for QueryType::SdfDistances for each dynamic actor every step.
bool recordContactPoints
Record results from QueryType::ContactPoints for each dynamic actor every step.
bool recordActorMeshes
Include the meshes (if any) when recording actor creation events.
bool recordTargetState
Record articulated pose controller targets and tracking parameters every step.
bool recordDynamicActorState
Record the state of dynamic actors every step.
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].
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].
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.
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.
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.
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 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.
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.
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 boundary discretization.
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 soft actors on posed/skinned positions.
bool hasInertia
Enable inertia evaluation of 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 soft actors are attached.
bool hasStress
Enable elasticity evaluation of soft actors on posed/skinned positions.
DynamicArray< SoftActorParams > softParams
Parameters for the soft deformable 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 islands and integration stages i...
int maxNonLinearIters
Maximum number of non-linear solver iterations across all islands and integration stages in the last ...
bool operator==(SolverStats const &) const =default
double residualNorm
Aggregate residual norm across all islands and integration stages in the last call to Scene::Step.
Information passed to per-step callbacks.
Scene * scene
Pointer to the Scene being stepped.
double timeStepSec
Time step size [s] for this simulation step.