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<real> frictionFalloffVel;
58
59 std::optional<real> viscousFrictionCoefficient;
60
61 std::optional<real> coulombFrictionCoefficient;
62
64
65#if MOCHI_LANGUAGE_CPP20
66 bool operator==(ContactPairParamsOverride const&) const = default;
67#endif
68};
69
83
85 bool useRecentering = true;
86
88
90
91#if MOCHI_LANGUAGE_CPP20
92 bool operator==(RecenteringParams const&) const = default;
93#endif
94};
95
105
131
132struct StepInfo {
133 Scene* scene = nullptr;
134
135 double timeStepSec = 0.0;
136};
137
140
142
144
146
148
149 bool isStatic = false;
150
152
154
155 bool hasGravity = true;
156
157 std::optional<real> density;
158
159 std::optional<real> mass;
160
161 std::optional<Real3> centerOfMass;
162
163 std::optional<Real6> momentOfInertia;
164
166
167 std::optional<BoundarySubsamplingParams> boundarySubsampling;
168
169 std::optional<Real3> linearVelocity;
170
171 std::optional<Real3> angularVelocity;
172
173#if MOCHI_LANGUAGE_CPP20
174 bool operator==(RigidActorParams const&) const = default;
175#endif
176};
177
205
222
225 int parentLink = -1;
231 bool hasGravity = true;
232 std::optional<real> density;
233 std::optional<real> mass;
234 std::optional<Real3> centerOfMass;
235 std::optional<Real6> momentOfInertia;
237 std::optional<BoundarySubsamplingParams> boundarySubsampling;
238
239#if MOCHI_LANGUAGE_CPP20
240 bool operator==(ArticulatedLinkParams const&) const = default;
241#endif
242};
243
249 std::optional<BoundarySubsamplingParams> boundarySubsampling;
250 std::optional<DynamicArray<DynamicString>> nonCollidingLinks;
251
252#if MOCHI_LANGUAGE_CPP20
253 bool operator==(ArticulatedSkinParams const&) const = default;
254#endif
255};
256
258 int parentLink = -1;
259 int childLink = -1;
261 real stiffness = 50000_r;
262
263#if MOCHI_LANGUAGE_CPP20
264 bool operator==(ArticulatedCycleJointParams const&) const = default;
265#endif
266};
267
281
291
294
296
298
299#if MOCHI_LANGUAGE_CPP20
300 bool operator==(ConstraintParams const&) const = default;
301#endif
302};
303
306
308
310
312
313#if MOCHI_LANGUAGE_CPP20
315#endif
316};
317
320
322
324
325 std::optional<real> max{};
326
327 std::optional<real> min{};
328
329#if MOCHI_LANGUAGE_CPP20
331#endif
332};
333
335 int nodeIndexA = -1;
336
337 int nodeIndexB = -1;
338
340
342
343 bool findClosest = false;
344
345#if MOCHI_LANGUAGE_CPP20
347#endif
348};
349
352
354
356
358
359#if MOCHI_LANGUAGE_CPP20
361#endif
362};
363
366
368
370
372
373 bool findClosest = false;
374
376
377#if MOCHI_LANGUAGE_CPP20
379#endif
380};
381
401
404
406
408
409#if MOCHI_LANGUAGE_CPP20
410 bool operator==(RigidPivotPositionConstraintParams const&) const = default;
411#endif
412};
413
416
418
420
421#if MOCHI_LANGUAGE_CPP20
423#endif
424};
425
428
430
432
433#if MOCHI_LANGUAGE_CPP20
434 bool operator==(RigidPivotRotationConstraintParams const&) const = default;
435#endif
436};
437
439 int nodeIndex = -1;
440
442
444
445#if MOCHI_LANGUAGE_CPP20
447#endif
448};
449
452
454
456
457#if MOCHI_LANGUAGE_CPP20
459#endif
460};
461
464
465 int jointIndex = 0;
466
467 int dofIndex = 0;
468
470
471#if MOCHI_LANGUAGE_CPP20
473#endif
474};
475
478
479 int jointIndex = 0;
480
482
483#if MOCHI_LANGUAGE_CPP20
485#endif
486};
487
490
491 int jointIndex = 0;
492
493 int dofIndex = {};
494
496
498
499#if MOCHI_LANGUAGE_CPP20
501#endif
502};
503
506
507 int jointIndex = 0;
508
510
512
513#if MOCHI_LANGUAGE_CPP20
515#endif
516};
517
520
522
524
526
528
530
532
534
536
537 int sampleIndex = 0;
538
540
541 int elementIndex = -1;
542
544};
545
547 int index = 0;
548
550};
551
563
565 bool useFixedTimeStep = false;
566
567 double fixedTimeStepSeconds = 0.01;
568
570
572
573 std::function<double()> timeStepCallback;
574};
575
578
580
582
584
586
587#if MOCHI_LANGUAGE_CPP20
588 bool operator==(PerformanceStats const&) const = default;
589#endif
590};
591
594
595 double residualNorm = 0.0;
596
598
600
601#if MOCHI_LANGUAGE_CPP20
602 bool operator==(SolverStats const&) const = default;
603#endif
604};
605
608
610
612
613#if MOCHI_LANGUAGE_CPP20
614 bool operator==(PoseTrackingParams const&) const = default;
615#endif
616};
617
620
621 // Construct with all three tracking arrays pre-sized to numLinks default-constructed
622 // PoseTrackingParams (zero gains). Convenient for Get/SetArticulatedPoseControllerParams, which
623 // operate on link-indexed arrays of size numLinks.
624 explicit PoseControllerParams(int numLinks)
625 : linkPosTracking(numLinks), linkRotTracking(numLinks), jointTracking(numLinks) {}
626
628
630
632};
633
643
646
648
650
651#if MOCHI_LANGUAGE_CPP20
652 bool operator==(DebugDrawSpheres const&) const = default;
653#endif
654};
655
658
660
661#if MOCHI_LANGUAGE_CPP20
662 bool operator==(DebugDrawLineVertices const&) const = default;
663#endif
664};
665
668
670
671#if MOCHI_LANGUAGE_CPP20
672 bool operator==(DebugDrawData const&) const = default;
673#endif
674};
675
676} // namespace superdex
A dynamically resizable array with syntax and behavior similar to std::pmr::vector.
Represents a simulation scene.
Definition mochi_scene.h:45
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:34
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.
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< real > frictionFalloffVel
Friction falloff velocity [m/s].
bool operator==(ContactPairParamsOverride const &) const =default
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:73
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.
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 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 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.
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.