SuperDex Physics C++ API
Loading...
Searching...
No Matches
mochi_structs.h
Go to the documentation of this file.
1/*
2 * Copyright (c) Meta Platforms, Inc. and affiliates.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17#pragma once
18
19#include "mochi_enums.h"
20#include "mochi_handle.h"
21
22/********************************************************************************
23 IMPORTANT: PLEASE KEEP HEADER INCLUDES TO A MINIMUM.
24 If you must include a mochi_core header, then please make sure that it only
25 declares the data types (not containing other implementation details).
26*********************************************************************************/
46
47#include <functional>
48#include <optional>
49
50namespace superdex {
51
52class Scene;
53
55 std::optional<real> penaltyCoefficient;
56
57 std::optional<bool> preferElastoPlasticFriction;
58
59 std::optional<real> frictionFalloffVel;
60
61 std::optional<real> preslidingDisplacement;
62
63 std::optional<real> viscousFrictionCoefficient;
64
65 std::optional<real> coulombFrictionCoefficient;
66
68
69#if MOCHI_LANGUAGE_CPP20
70 bool operator==(ContactPairParamsOverride const&) const = default;
71#endif
72};
73
87
89 bool useRecentering = true;
90
92
94
95#if MOCHI_LANGUAGE_CPP20
96 bool operator==(RecenteringParams const&) const = default;
97#endif
98};
99
109
135
136struct StepInfo {
137 Scene* scene = nullptr;
138
139 double timeStepSec = 0.0;
140};
141
144
146
148
150
152
153 bool isStatic = false;
154
156
158
159 bool hasGravity = true;
160
161 std::optional<real> density;
162
163 std::optional<real> mass;
164
165 std::optional<Real3> centerOfMass;
166
167 std::optional<Real6> momentOfInertia;
168
170
171 std::optional<BoundarySubsamplingParams> boundarySubsampling;
172
173 std::optional<Real3> linearVelocity;
174
175 std::optional<Real3> angularVelocity;
176
177#if MOCHI_LANGUAGE_CPP20
178 bool operator==(RigidActorParams const&) const = default;
179#endif
180};
181
209
212
214
216
218
219 Real2 flexuralStiffness = {5e-4_r, 5e-4_r};
220
222
224
226
227#if MOCHI_LANGUAGE_CPP20
228 bool operator==(RodMaterialParams const&) const = default;
229#endif
230};
231
233 real radius = 0.01_r;
234
236
238
239 bool selfContact = false;
240
241 std::optional<ActorBoundaryElementType> colliderTriangleElementType = std::nullopt;
242
243 std::optional<ActorSegmentElementType> colliderSegmentElementType = std::nullopt;
244
245#if MOCHI_LANGUAGE_CPP20
246 bool operator==(PointCloudColliderParams const&) const = default;
247#endif
248};
249
279
296
299 int parentLink = -1;
305 bool hasGravity = true;
306 std::optional<real> density;
307 std::optional<real> mass;
308 std::optional<Real3> centerOfMass;
309 std::optional<Real6> momentOfInertia;
311 std::optional<BoundarySubsamplingParams> boundarySubsampling;
312
313#if MOCHI_LANGUAGE_CPP20
314 bool operator==(ArticulatedLinkParams const&) const = default;
315#endif
316};
317
323 std::optional<BoundarySubsamplingParams> boundarySubsampling;
324 std::optional<DynamicArray<DynamicString>> nonCollidingLinks;
325
326#if MOCHI_LANGUAGE_CPP20
327 bool operator==(ArticulatedSkinParams const&) const = default;
328#endif
329};
330
332 int parentLink = -1;
333 int childLink = -1;
335 real stiffness = 50000_r;
336
337#if MOCHI_LANGUAGE_CPP20
338 bool operator==(ArticulatedCycleJointParams const&) const = default;
339#endif
340};
341
355
365
368
370
372
373#if MOCHI_LANGUAGE_CPP20
374 bool operator==(ConstraintParams const&) const = default;
375#endif
376};
377
380
382
384
386
387#if MOCHI_LANGUAGE_CPP20
389#endif
390};
391
394
396
398
399 std::optional<real> max{};
400
401 std::optional<real> min{};
402
403#if MOCHI_LANGUAGE_CPP20
405#endif
406};
407
409 int nodeIndexA = -1;
410
411 int nodeIndexB = -1;
412
414
416
417 bool findClosest = false;
418
419#if MOCHI_LANGUAGE_CPP20
421#endif
422};
423
426
428
430
432
433#if MOCHI_LANGUAGE_CPP20
435#endif
436};
437
440
442
444
445#if MOCHI_LANGUAGE_CPP20
446 bool operator==(RodElementRotationConstraintParams const&) const = default;
447#endif
448};
449
452
454
456
458
459 bool findClosest = false;
460
462
463#if MOCHI_LANGUAGE_CPP20
465#endif
466};
467
487
490
492
494
495#if MOCHI_LANGUAGE_CPP20
496 bool operator==(RigidPivotPositionConstraintParams const&) const = default;
497#endif
498};
499
502
504
506
507#if MOCHI_LANGUAGE_CPP20
509#endif
510};
511
514
516
518
519#if MOCHI_LANGUAGE_CPP20
520 bool operator==(RigidPivotRotationConstraintParams const&) const = default;
521#endif
522};
523
525 int nodeIndex = -1;
526
528
530
531#if MOCHI_LANGUAGE_CPP20
533#endif
534};
535
538
540
542
543#if MOCHI_LANGUAGE_CPP20
545#endif
546};
547
550
551 int jointIndex = 0;
552
553 int dofIndex = 0;
554
556
557#if MOCHI_LANGUAGE_CPP20
559#endif
560};
561
564
565 int jointIndex = 0;
566
568
569#if MOCHI_LANGUAGE_CPP20
571#endif
572};
573
576
577 int jointIndex = 0;
578
579 int dofIndex = {};
580
582
584
585#if MOCHI_LANGUAGE_CPP20
587#endif
588};
589
592
593 int jointIndex = 0;
594
596
598
599#if MOCHI_LANGUAGE_CPP20
601#endif
602};
603
606
608
610
612
614
616
618
620
622
623 int sampleIndex = 0;
624
626
627 int elementIndex = -1;
628
630};
631
633 int index = 0;
634
636};
637
649
651 bool useFixedTimeStep = false;
652
653 double fixedTimeStepSeconds = 0.01;
654
656
658
659 std::function<double()> timeStepCallback;
660};
661
664
666
668
670
672
673#if MOCHI_LANGUAGE_CPP20
674 bool operator==(PerformanceStats const&) const = default;
675#endif
676};
677
680
681 double residualNorm = 0.0;
682
684
686
687#if MOCHI_LANGUAGE_CPP20
688 bool operator==(SolverStats const&) const = default;
689#endif
690};
691
694
696
698
699#if MOCHI_LANGUAGE_CPP20
700 bool operator==(PoseTrackingParams const&) const = default;
701#endif
702};
703
706
707 // Construct with all three tracking arrays pre-sized to numLinks default-constructed
708 // PoseTrackingParams (zero gains). Convenient for Get/SetArticulatedPoseControllerParams, which
709 // operate on link-indexed arrays of size numLinks.
710 explicit PoseControllerParams(int numLinks)
711 : linkPosTracking(numLinks), linkRotTracking(numLinks), jointTracking(numLinks) {}
712
714
716
718};
719
729
732
734
736
737#if MOCHI_LANGUAGE_CPP20
738 bool operator==(DebugDrawSpheres const&) const = default;
739#endif
740};
741
744
746
747#if MOCHI_LANGUAGE_CPP20
748 bool operator==(DebugDrawLineVertices const&) const = default;
749#endif
750};
751
754
756
757#if MOCHI_LANGUAGE_CPP20
758 bool operator==(DebugDrawData const&) const = default;
759#endif
760};
761
762} // namespace superdex
A dynamically resizable array with syntax and behavior similar to std::pmr::vector.
Represents a simulation scene.
Definition mochi_scene.h:45
static TransformRT Identity()
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.
Definition mochi_enums.h:49
@ Default
Default actor boundary element type.
Definition mochi_enums.h:64
NdArray< real, 3 > Real3
Definition nd_array.h:115
constexpr Real2 kMinus2PiPlus2Pi
Definition constants.h:37
IntegrationMethod
Time integration methods.
@ Default
Default time integration method.
ActorSegmentElementType
One-dimensional discretization element types for actor segment integrals.
Definition mochi_enums.h:67
@ Default
Default actor segment element type.
Definition mochi_enums.h:76
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.
NdArray< real, 2 > Real2
Definition nd_array.h:114
BoundarySubsamplingStrategy
Strategy for selecting the active boundary faces when subsampling boundary integrals.
Definition mochi_enums.h:41
@ UniformProbability
Select boundary faces with uniform probability.
Definition mochi_enums.h:42
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.
bool operator==(ArticulatedCycleJointParams const &) const =default
real stiffness
Stiffness [N/m] for the cycle joint constraint.
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.
bool operator==(ArticulatedSingleDofRangeConstraintParams const &) const =default
int dofIndex
DoF index within the joint (0-based).
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.
Optional contact-response parameter replacements for an unordered actor pair.
std::optional< real > coulombFrictionCoefficient
Pair Coulomb friction coefficient.
std::optional< real > viscousFrictionCoefficient
Pair viscous friction coefficient [s/m].
std::optional< real > penaltyCoefficient
Pair penalty coefficient [Pa/m] before role-dependent dimensional corrections.
std::optional< real > normalViscousDampingCoefficient
Pair normal viscous damping coefficient [s/m].
std::optional< bool > preferElastoPlasticFriction
[Experimental] Whether the pair prefers elasto-plastic friction.
std::optional< real > frictionFalloffVel
Friction falloff velocity [m/s].
bool operator==(ContactPairParamsOverride const &) const =default
std::optional< real > preslidingDisplacement
Presliding displacement of elasto-plastic friction [m].
Parameters for contact mechanics simulation.
Information about a contact point between two actors.
Real3 posA
Contact position [m] on actorA in world frame.
int sampleIndex
Sample point index of actorA.
Real3 posB
Approximate contact position [m] on actorB in world frame.
Real3 parametricCoords
Parametric coordinates within the surface element of actorA.
real intWeight
Quadrature integration weight of the sample point on the colliding manifold of actorA.
Real3 pointVelocityB
Velocity [m/s] of the contact point on actorB in world frame.
int elementIndex
Index of the triangle of actorA in Actor::GetSurfaceMesh, or in Actor::GetContactSkinMesh when contac...
Real3 normal
Contact normal in world frame pointing away from actorB.
ActorHandle actorB
Handle of the collider actor.
real distance
Signed separation distance [m] between posA (on actorA) and the closest point on the surface of actor...
Real3 force
Contact force [N] applied to actorA from actorB in world frame.
Real3 pointVelocityA
Velocity [m/s] of the contact point on actorA in world frame.
ActorHandle actorA
Handle of the colliding actor.
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.
Parameters for creating a position constraint on a deformable actor node.
ActorHandle actor
Actor handle identifying the deformable actor.
Real3 position
Target position for the node in world frame [m].
int nodeIndex
Node index in the deformable actor's reference simulation mesh, as returned by Actor::GetMesh.
bool operator==(DeformableNodePositionConstraintParams const &) const =default
Parameters for creating a constraint coupling a node in a deformable actor to a node in another defor...
bool operator==(DeformableNodeToDeformableNodeConstraintParams const &) const =default
int nodeIndexB
Node index in deformable actor B's reference simulation mesh, as returned by Actor::GetMesh.
ActorHandle actorB
Actor handle identifying deformable actor B.
ActorHandle actorA
Actor handle identifying deformable actor A.
int nodeIndexA
Node index in deformable actor A's reference simulation mesh, as returned by Actor::GetMesh.
bool findClosest
Whether to automatically select a boundary node on each actor.
Parameters for creating a constraint coupling a deformable node to a rigid actor.
ActorHandle rigidActor
Actor handle identifying the rigid actor.
bool fixToDeformablePos
When true, the coupling position on the rigid actor is auto-computed to match the deformable node's i...
bool operator==(DeformableNodeToRigidConstraintParams const &) const =default
bool findClosest
Whether to automatically select a boundary node of the deformable actor.
int deformableNodeIndex
Node index in the deformable actor's reference simulation mesh, as returned by Actor::GetMesh.
ActorHandle deformableActor
Actor handle identifying the deformable actor.
Real3 rigidLocalPos
Coupling position [m] in rigid actor's local frame.
[Experimental] Evaluation settings common to the full scene.
Definition eval_params.h:75
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.
Contact force applied to a specific node.
int index
Index of the node in the node list returned by Actor::GetMesh, or by Actor::GetContactSkinMesh when c...
Real3 force
Contact force [N] applied to the node.
Parameters for the non-linear solver.
Timing and profiling metrics from the last simulation step.
double postStepCallbacksDurationSec
Wall-clock time [s] spent executing user-defined post-step callbacks in the last call to Scene::Step.
double recordingStepDurationSec
Wall-clock time [s] spent on recording in the last call to Scene::Step.
bool operator==(PerformanceStats const &) const =default
double totalStepDurationSec
Total wall-clock time [s] spent in the last call to Scene::Step, excluding time spent in the remote p...
double preStepCallbacksDurationSec
Wall-clock time [s] spent executing user-defined pre-step callbacks in the last call to Scene::Step.
double solveStepDurationSec
Wall-clock time [s] spent solving physics in the last call to Scene::Step.
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...
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.