SuperDex Physics C++ API
Loading...
Searching...
No Matches
superdex::RigidActorParams Struct Reference

Parameters to create a rigid body actor. More...

#include <mochi_structs.h>

Inheritance diagram for superdex::RigidActorParams:
superdex::prefab::RigidActorPrefab

Public Member Functions

bool operator== (RigidActorParams const &) const =default

Public Attributes

std::optional< Real3angularVelocity
 Optional initial angular velocity in world frame [rad/s], zero otherwise.
ActorBoundaryElementType boundaryElementType = ActorBoundaryElementType::Default
 Finite element type for boundary discretization.
std::optional< BoundarySubsamplingParamsboundarySubsampling
 Optional subsampling for boundary integrals such as contact.
std::optional< Real3centerOfMass
 Position [m] of the center of mass in the actor's local frame.
ColliderType colliderType = ColliderType::Auto
 Collision detection geometry.
ContactParams contact
 Contact mechanics parameters.
std::optional< realdensity
 Uniform density [kg/m³] of the actor.
bool hasGravity = true
 If true, actor is affected by gravity.
bool isStatic = false
 If true, actor will be static (fixed in space).
DynamicString layer
 Contact layer name for filtering contacts between actors.
std::optional< Real3linearVelocity
 Optional initial linear velocity of the center of mass in world frame [m/s], zero otherwise.
std::optional< realmass
 Total mass [kg] of the actor.
std::optional< Real6momentOfInertia
 Moment of inertia tensor [kg·m²] at the center of mass in the actor's local frame.
DynamicString name
 Optional actor name.
GridSdfParams sdf
 Parameters used to construct a grid-based Signed Distance Field (SDF) if the shape doesn't already have one.
ShapeHandle shape
 Shape handle defining the actor's geometry and other metadata.
TransformRT worldFromLocal
 Initial rotation and translation of the actor's local frame with respect to world frame.

Detailed Description

Parameters to create a rigid body actor.

Rigid actors behave as rigid bodies with 6 degrees of freedom (3 translational, 3 rotational). They can be static (fixed in space) or dynamic (affected by forces and collisions).

Note
Also used to create links in articulated bodies.
See also
Scene::CreateRigidActor, ArticulatedActorParams

Definition at line 118 of file mochi_structs.h.

Member Function Documentation

◆ operator==()

bool superdex::RigidActorParams::operator== ( RigidActorParams const & ) const
default

Member Data Documentation

◆ angularVelocity

std::optional<Real3> superdex::RigidActorParams::angularVelocity

Optional initial angular velocity in world frame [rad/s], zero otherwise.

Note
Not valid for static rigid actors or articulated links.
See also
Actor::GetAngularVelocity, Actor::SetVelocity

Definition at line 151 of file mochi_structs.h.

◆ boundaryElementType

ActorBoundaryElementType superdex::RigidActorParams::boundaryElementType = ActorBoundaryElementType::Default

Finite element type for boundary discretization.

Note
Affects accuracy and performance of contact and boundary integrals.
See also
ActorBoundaryElementType

Definition at line 145 of file mochi_structs.h.

◆ boundarySubsampling

std::optional<BoundarySubsamplingParams> superdex::RigidActorParams::boundarySubsampling

Optional subsampling for boundary integrals such as contact.

Note
Reduces computational cost by using fewer sample points.
For best performance, combine subsampling with boundaryElementType = ActorBoundaryElementType::P1Q1.
See also
BoundarySubsamplingParams

Definition at line 147 of file mochi_structs.h.

◆ centerOfMass

std::optional<Real3> superdex::RigidActorParams::centerOfMass

Position [m] of the center of mass in the actor's local frame.

Note
If not set, computed automatically from geometry.
Usually combined with explicit momentOfInertia.
See also
momentOfInertia

Definition at line 141 of file mochi_structs.h.

◆ colliderType

ColliderType superdex::RigidActorParams::colliderType = ColliderType::Auto

Collision detection geometry.

Note
Determines how OTHER actors detect contact with this actor. It does not affect how this actor detects contact with other actors.
See also
ColliderType

Definition at line 127 of file mochi_structs.h.

◆ contact

ContactParams superdex::RigidActorParams::contact

Contact mechanics parameters.

See also
ContactParams

Definition at line 131 of file mochi_structs.h.

◆ density

std::optional<real> superdex::RigidActorParams::density

Uniform density [kg/m³] of the actor.

Must be positive if provided.

Note
Setting both density and mass is not recommended. If both are set, mass takes precedence and density is ignored.
If only density is set, mass is computed automatically from volume.
If neither is set, kDefaultDensity is used.
See also
mass

Definition at line 137 of file mochi_structs.h.

◆ hasGravity

bool superdex::RigidActorParams::hasGravity = true

If true, actor is affected by gravity.

See also
Scene::SetGravity

Definition at line 135 of file mochi_structs.h.

◆ isStatic

bool superdex::RigidActorParams::isStatic = false

If true, actor will be static (fixed in space).

If false, actor will be dynamic.

Definition at line 129 of file mochi_structs.h.

◆ layer

DynamicString superdex::RigidActorParams::layer

Contact layer name for filtering contacts between actors.

See also
Scene::EnableLayerContactAsymmetric, Scene::EnableLayerContactSymmetric, Scene::EnableActorContactAsymmetric, Scene::EnableActorContactSymmetric

Definition at line 121 of file mochi_structs.h.

◆ linearVelocity

std::optional<Real3> superdex::RigidActorParams::linearVelocity

Optional initial linear velocity of the center of mass in world frame [m/s], zero otherwise.

Note
Not valid for static rigid actors or articulated links.
See also
Actor::GetLinearVelocity, Actor::SetVelocity

Definition at line 149 of file mochi_structs.h.

◆ mass

std::optional<real> superdex::RigidActorParams::mass

Total mass [kg] of the actor.

Must be positive if provided.

Note
Setting both mass and density is not recommended. If both are set, mass takes precedence and density is ignored.
If only mass is set, density is computed automatically from volume.
See also
density

Definition at line 139 of file mochi_structs.h.

◆ momentOfInertia

std::optional<Real6> superdex::RigidActorParams::momentOfInertia

Moment of inertia tensor [kg·m²] at the center of mass in the actor's local frame.

Stored as [ixx, ixy, ixz, iyy, iyz, izz] using negative tensor notation:

[ixx, ixy, ixz] [ +∫(y²+z²)dm, -∫(xy)dm, -∫(xz)dm ]
I = [ixy, iyy, iyz] = [ -∫(xy)dm, +∫(x²+z²)dm, -∫(yz)dm ]
[ixz, iyz, izz] [ -∫(xz)dm, -∫(yz)dm, +∫(x²+y²)dm ]
Note
Uses negative tensor notation consistent with e.g. robotics URDF files.
Many CAD tools (e.g., Solidworks) use positive tensor notation requiring negation of off-diagonal terms. See https://www.mathworks.com/help/sm/ug/specify-custom-inertia.html.
Must be finite. A finite but physically invalid tensor (negative principal moments or one violating the triangle inequality) is accepted with a warning, not rejected.
If not set, computed automatically from geometry and density.
Usually combined with explicit centerOfMass.
See also
centerOfMass

Definition at line 143 of file mochi_structs.h.

◆ name

DynamicString superdex::RigidActorParams::name

Optional actor name.

Uniqueness of names is not enforced.

Definition at line 119 of file mochi_structs.h.

◆ sdf

GridSdfParams superdex::RigidActorParams::sdf

Parameters used to construct a grid-based Signed Distance Field (SDF) if the shape doesn't already have one.

Note
Ignored if colliderType is not ColliderType::Sdf.
Ignored if the shape already has a grid-based SDF.

Definition at line 133 of file mochi_structs.h.

◆ shape

ShapeHandle superdex::RigidActorParams::shape

Shape handle defining the actor's geometry and other metadata.

Note
A shape can be shared by multiple actors, even actors in different scenes.
Dynamic rigid actors require a shape with a surface mesh.
See also
ShapeHandle, Context::LoadShapeFromFile

Definition at line 123 of file mochi_structs.h.

◆ worldFromLocal

TransformRT superdex::RigidActorParams::worldFromLocal

Initial rotation and translation of the actor's local frame with respect to world frame.

Note
The actor's center of mass may be located elsewhere, since it is not necessarily at the origin of the actor's local coordinate frame.
See also
centerOfMass

Definition at line 125 of file mochi_structs.h.


The documentation for this struct was generated from the following files: