SuperDex Physics C++ API
Loading...
Searching...
No Matches
mochi_actor.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#include "mochi_structs.h"
22
23/********************************************************************************
24 IMPORTANT: PLEASE KEEP HEADER INCLUDES TO A MINIMUM.
25 If you must include a mochi_core header, then please make sure that it only
26 declares the data types (not containing other implementation details).
27*********************************************************************************/
41
42#include <functional>
43#include <string_view>
44
45namespace superdex {
46
47class Scene;
48class Constraint;
49class Context;
50
51class Actor {
52 public:
53 [[nodiscard]] virtual ActorHandle GetHandle() const = 0;
54
55 [[nodiscard]] virtual Context* GetContext() = 0;
56 [[nodiscard]] virtual Context const* GetContext() const = 0;
57
58 [[nodiscard]] virtual Scene* GetScene() = 0;
59 [[nodiscard]] virtual Scene const* GetScene() const = 0;
60
61 [[nodiscard]] virtual char const* GetName() const = 0;
62
63 [[nodiscard]] virtual ActorType GetType() const = 0;
64
65 [[nodiscard]] virtual ConvergenceStatus GetConvergenceStatus() const = 0;
66
67 [[nodiscard]] virtual bool IsStatic() const = 0;
68
69 [[nodiscard]] virtual ContactParams GetContactParams(Error& error) const = 0;
70
71 virtual void SetContactParams(ContactParams const& params, Error& error) = 0;
72
73 [[nodiscard]] virtual ColliderType GetColliderType() const = 0;
74
75 [[nodiscard]] virtual bool HasRootTransform() const = 0;
76
77 [[nodiscard]] virtual TransformRT GetRootTransform() const = 0;
78
79 virtual void SetRootTransform(TransformRT const& worldFromLocal, Error& error) = 0;
80
81 [[nodiscard]] virtual Real3 GetRigidCenterOfMassLocal(Error& error) const = 0;
82
83 [[nodiscard]] virtual TransformRT GetCenterOfMassTransform(Error& error) const = 0;
84
85 virtual void SetCenterOfMassTransform(TransformRT const& worldFromCom, Error& error) = 0;
86
87 [[nodiscard]] virtual Real6 GetRigidMomentOfInertiaLocal(Error& error) const = 0;
88
89 virtual void SetVelocity(Real3 const& linearVel, Real3 const& angularVel, Error& error) = 0;
90
91 [[nodiscard]] virtual Real3 GetLinearVelocity(Error& error) const = 0;
92
93 [[nodiscard]] virtual Real3 GetAngularVelocity(Error& error) const = 0;
94
95 [[nodiscard]] virtual real GetMass(Error& error) const = 0;
96
97 [[nodiscard]] virtual real GetDensity(Error& error) const = 0;
98
99 virtual void SetDensity(real density, Error& error) = 0;
100
102 real mass,
103 Real3 const& centerOfMass,
104 Real6 const& momentOfInertia,
105 Error& error) = 0;
106
107 [[nodiscard]] virtual real GetElasticEnergy(Error& error) const = 0;
108
109 [[nodiscard]] virtual RecenteringParams GetRecenteringParams() const = 0;
110
111 virtual void SetRecenteringParams(RecenteringParams const& params, Error& error) = 0;
112
113 [[nodiscard]] virtual Span<real const> GetDisplacements(Error& error) const = 0;
114
115 virtual void SetDisplacements(Span<real const> displacements, Error& error) = 0;
116
117 [[nodiscard]] virtual SoftMaterialParams GetSoftMaterialParams(Error& error) const = 0;
118
119 virtual void SetSoftMaterialParams(SoftMaterialParams const& params, Error& error) = 0;
120
121 [[nodiscard]] virtual MeshDataView GetMesh() const = 0;
122
123 [[nodiscard]] virtual MeshDataView GetSurfaceMesh() const = 0;
124
125 [[nodiscard]] virtual MeshDataView GetVisualMesh() const = 0;
126
127 [[nodiscard]] virtual Span<real const> GetSurfaceMeshNodePositionsLocal(Error& error) const = 0;
128
129 [[nodiscard]] virtual Span<real const> GetSurfaceMeshNodeNormalsLocal(Error& error) const = 0;
130
131 [[nodiscard]] virtual ShapeHandle GetReferenceShape(Error& error) const = 0;
132
133 [[nodiscard]] virtual std::string_view GetContactLayer() const = 0;
134
135 virtual void SetContactLayer(std::string_view const& layer) = 0;
136
137 [[nodiscard]] virtual int GetNumDofs() const = 0;
138
139 virtual void GetDofValues(Span<int const> dofIndices, Span<real> outDofValues, Error& error)
140 const = 0;
141
143 Aabb const& volume,
144 bool boundaryOnly,
145 std::function<void(int, Real3)> const& callback,
146 Error& error) const = 0;
147
149 Obb const& volume,
150 bool boundaryOnly,
151 std::function<void(int, Real3)> const& callback,
152 Error& error) const = 0;
153
155 Sphere const& volume,
156 bool boundaryOnly,
157 std::function<void(int, Real3)> const& callback,
158 Error& error) const = 0;
159
161 Span<Real3 const> pointsWorld,
162 Span<real> outDistances,
163 Error& error) const = 0;
164
165 [[nodiscard]] virtual Aabb GetAabbLocal(Error& error) const = 0;
166
167 [[nodiscard]] virtual Aabb GetAabbWorld(Error& error) const = 0;
168
169 [[nodiscard]] virtual Span<real const> GetNodePositionsLocal(Error& error) const = 0;
170
171 virtual void SetZeroDisplacementsAndVelocities(Error& error) = 0;
172
173 [[nodiscard]] virtual Span<real const> GetElementsDeformationGradient(Error& error) const = 0;
174
175 virtual void SetNodePositionsLocal(Span<real const> positionsLocal, Error& error) = 0;
176
177 virtual void SetNodeVelocitiesLocal(Span<real const> velocitiesLocal, Error& error) = 0;
178
179 [[nodiscard]] virtual Span<real const> GetVisualMeshNodePositionsLocal(Error& error) const = 0;
180
181 [[nodiscard]] virtual Span<real const> GetVisualMeshNodeNormalsLocal(Error& error) const = 0;
182
183 [[nodiscard]] virtual Span<int const> GetBoundaryConditionDofIndices() const = 0;
184
185 [[nodiscard]] virtual Span<real const> GetBoundaryConditionDofValuesWorld() const = 0;
186
188 Span<int const> dofIndices,
189 Span<real const> dofValuesWorld,
190 Error& error) = 0;
191
193 Span<int const> dofIndices,
194 Span<real const> dofValuesWorld,
195 Error& error) = 0;
196
198 Span<int const> nodeIndices,
199 Span<real const> nodePositionsWorld,
200 Error& error) = 0;
201
203 Span<int const> nodeIndices,
204 Span<real const> nodePositionsWorld,
205 Error& error) = 0;
206
208
210
211 virtual void ClearBoundaryConditions() = 0;
212
214 Span<int const> dofIndices,
215 Span<real const> forceValues,
216 Error& error) = 0;
217
218 virtual void ClearExternalForces() = 0;
219
220 virtual void GetExternalForces(Span<real> outForces, Error& error) = 0;
221
222 [[nodiscard]] virtual Span<ContactPoint const> GetContactPointsWorld(Error& error) const = 0;
223
225 Error& error) const = 0;
226
227 [[nodiscard]] virtual Real3 GetContactForceWorld(Error& error) const = 0;
228
229 [[nodiscard]] virtual Real3 GetContactTorqueWorld(Error& error) const = 0;
230
231 [[nodiscard]] virtual Real3 GetContactForceFromActorWorld(Actor const* other, Error& error)
232 const = 0;
233
234 [[nodiscard]] virtual SdfDistances GetSdfDistances(Error& error) const = 0;
235
236 virtual QueryHandle RegisterQuery(QueryType type, Error& error) = 0;
237
239
240 virtual void CancelQuery(QueryHandle handle) = 0;
241
242 [[nodiscard]] virtual bool IsQuerySupported(QueryType type) const = 0;
243
244 virtual void SetUserData(void* userData) = 0;
245
246 virtual void* GetUserData() const = 0;
247
248 [[nodiscard]] virtual Span<ActorHandle const> GetNestedLinkActors(Error& error) const = 0;
249
250 [[nodiscard]] virtual Span<ActorHandle const> GetNestedSoftActors(Error& error) const = 0;
251
252 [[nodiscard]] virtual ArticulatedShapeInfo GetArticulatedShapeInfo(Error& error) const = 0;
253
255 Error& error) const = 0;
256
259
262 Error& error) = 0;
263
264 [[nodiscard]] virtual Span<real const> GetArticulatedJointInertiaParams(Error& error) const = 0;
265
266 virtual void SetArticulatedJointInertiaParams(Span<real const> inertia, Error& error) = 0;
267
268 virtual void GetArticulatedDofLimits(Span<Real2> outDofLimits, Error& error) const = 0;
269
270 virtual void GetArticulatedPose(Span<real> outPose, Error& error) const = 0;
271
272 virtual void GetArticulatedLinkTransforms(Span<TransformRT> outWorldFromLinks, Error& error)
273 const = 0;
274
275 virtual void GetArticulatedJointVelocities(Span<real> outVelocities, Error& error) const = 0;
276
278 Span<TransformRT const> worldFromLinks,
279 Error& error) = 0;
280
282
283 virtual void SetArticulatedJointVelocities(Span<real const> velocities, Error& error) = 0;
284
286 Span<real const> pose,
287 Span<real const> deltaDofs,
288 Span<real> outPose,
289 Error& error) const = 0;
290
292 Span<real const> poseBase,
293 Span<real const> poseTarget,
294 Span<real> outDeltaDofs,
295 Error& error) const = 0;
296
298 Span<real const> poseA,
299 Span<real const> poseB,
300 Span<real> outTransDistances,
301 Span<real> outRotDistances,
302 Error& error) const = 0;
303
304 [[nodiscard]] virtual bool HasArticulatedPoseController(Error& error) const = 0;
305
306 virtual void AddArticulatedPoseController(PoseControllerParams const& params, Error& error) = 0;
307
308 virtual void RemoveArticulatedPoseController(Error& error) = 0;
309
311 Span<TransformRT const> worldFromTargets,
312 Error& error) = 0;
313
314 virtual void SetArticulatedTargetPose(Span<real const> pose, Error& error) = 0;
315
317 Span<TransformRT const> worldFromTargets,
318 Error& error) = 0;
319
320 virtual void ResetArticulatedTargetPose(Span<real const> pose, Error& error) = 0;
321
322 virtual void SetArticulatedTargetVelocity(Span<real const> velocity, Error& error) = 0;
323
325 Error& error) const = 0;
326
328 const = 0;
329
331 PoseControllerParams const& params,
332 Error& error) = 0;
333
334 virtual void GetArticulatedTargetPose(Span<real> outPose, Error& error) const = 0;
335
337 Span<TransformRT> outWorldFromTargets,
338 Error& error) const = 0;
339
340 [[nodiscard]] virtual Span<real const> GetArticulatedControllerForce(Error& error) const = 0;
341
342 [[nodiscard]] virtual bool IsNestedLinkActor() const = 0;
343
344 [[nodiscard]] virtual bool IsNestedSoftActor() const = 0;
345
346 [[nodiscard]] virtual ActorHandle GetArticulatedActor(Error& error) const = 0;
347
348 [[nodiscard]] virtual Span<real const> GetArticulatedJacobian(Error& error) const = 0;
349
350 protected:
351 // Don't delete the Actor pointer. Call Scene::DestroyActor.
352 virtual ~Actor() = default;
353};
354
355} // namespace superdex
Represents a simulated body (actor) in a scene.
Definition mochi_actor.h:51
virtual void GetArticulatedLinkTransforms(Span< TransformRT > outWorldFromLinks, Error &error) const =0
Get the pose of an articulated actor expressed as world-from-local link transforms.
virtual Span< real const > GetArticulatedJointInertiaParams(Error &error) const =0
Get the per-joint inertia coefficients of the articulated actor.
virtual void SetDisplacements(Span< real const > displacements, Error &error)=0
Set the node displacements in the actor's local frame, relative to reference (rest) positions.
virtual void SetNodeVelocitiesLocal(Span< real const > velocitiesLocal, Error &error)=0
Set the current velocity of each node in the actor's local frame.
virtual ActorHandle GetArticulatedActor(Error &error) const =0
Get the owning articulated actor.
virtual Scene const * GetScene() const =0
Get the Scene that this actor belongs to (read only).
virtual void GetArticulatedPoseDistance(Span< real const > poseA, Span< real const > poseB, Span< real > outTransDistances, Span< real > outRotDistances, Error &error) const =0
Compute per-joint distances between two poses.
virtual void AddBoundaryConditionNodesWorldPermanent(Span< int const > nodeIndices, Span< real const > nodePositionsWorld, Error &error)=0
Add permanent world-space boundary conditions for specified nodes.
virtual void ResetArticulatedTargetLinkTransforms(Span< TransformRT const > worldFromTargets, Error &error)=0
Reset the target pose of the controller expressed as link transforms.
virtual Real3 GetContactTorqueWorld(Error &error) const =0
Get the total contact torque about the center of mass.
virtual void AddArticulatedPoseController(PoseControllerParams const &params, Error &error)=0
Add a pose controller to an articulated actor.
virtual QueryHandle RegisterQueryAndCompute(QueryType type, Error &error)=0
Register a query for this actor and compute the result immediately.
virtual char const * GetName() const =0
Get the name of the actor.
virtual ActorType GetType() const =0
Get the type of the actor.
virtual Aabb GetAabbWorld(Error &error) const =0
Get an axis-aligned bounding box (AABB) that contains the full volume of the actor,...
virtual SoftMaterialParams GetSoftMaterialParams(Error &error) const =0
Get the material parameters of a soft actor.
virtual Span< real const > GetVisualMeshNodeNormalsLocal(Error &error) const =0
Get the normal direction to each node of the visual mesh in the actor's local frame.
virtual Span< real const > GetBoundaryConditionDofValuesWorld() const =0
Get the target values of DoFs fixed by boundary conditions.
virtual Real3 GetContactForceWorld(Error &error) const =0
Get the total contact force on the actor.
virtual TransformRT GetRootTransform() const =0
Get the actor's world-from-local transform (root transform).
virtual bool IsNestedLinkActor() const =0
Check if the actor is a rigid link within an articulated actor.
virtual bool HasArticulatedPoseController(Error &error) const =0
Check if the articulated actor has a pose controller.
virtual void ClearBoundaryConditions()=0
Remove all clearable boundary conditions previously added.
virtual Context const * GetContext() const =0
Get read-only access to the Context that owns this actor.
virtual RecenteringParams GetRecenteringParams() const =0
Gets the recentering parameters of the actor.
virtual Span< Constraint *const > GetArticulatedJointLimitConstraints(Error &error) const =0
Get the joint-limit constraints of the articulated actor.
virtual void SetInertiaProperties(real mass, Real3 const &centerOfMass, Real6 const &momentOfInertia, Error &error)=0
Set the mass properties of the actor.
virtual MeshDataView GetVisualMesh() const =0
Get a view of the actor's reference visual mesh.
virtual Span< real const > GetSurfaceMeshNodeNormalsLocal(Error &error) const =0
Get the normal direction for each node of the surface mesh in the actor's local frame.
virtual void SetArticulatedPoseFromJoints(Span< real const > pose, Error &error)=0
Set the pose of an articulated actor from joint DoFs.
virtual void GetPointsDistanceToSurface(Span< Real3 const > pointsWorld, Span< real > outDistances, Error &error) const =0
Query the signed distance to the closest point on the actor's surface.
virtual void ComputeArticulatedPoseDelta(Span< real const > poseBase, Span< real const > poseTarget, Span< real > outDeltaDofs, Error &error) const =0
Compute the pose delta from a base pose to a target pose.
virtual void SetArticulatedPoseFromLinks(Span< TransformRT const > worldFromLinks, Error &error)=0
Set the pose of an articulated actor from the world-from-local link transforms.
virtual Span< NodeContactForce const > GetNodeContactForcesWorld(Error &error) const =0
Get contact forces on nodes.
virtual void AddBoundaryConditionNodesWorld(Span< int const > nodeIndices, Span< real const > nodePositionsWorld, Error &error)=0
Add world-space boundary conditions for specified nodes.
virtual Aabb GetAabbLocal(Error &error) const =0
Get an axis-aligned bounding box (AABB) that contains the full volume of the actor,...
virtual Real3 GetRigidCenterOfMassLocal(Error &error) const =0
Get the position of the center of mass in the actor's local coordinate frame (GetRootTransform).
virtual Span< real const > GetDisplacements(Error &error) const =0
Get the node displacements of the actor in the actor's local frame, relative to reference (rest) posi...
virtual void GetArticulatedTargetPose(Span< real > outPose, Error &error) const =0
Get the last target pose set to the pose controller.
virtual void AddBoundaryConditionDofsWorld(Span< int const > dofIndices, Span< real const > dofValuesWorld, Error &error)=0
Add boundary conditions to specified DoFs.
virtual Span< real const > GetElementsDeformationGradient(Error &error) const =0
Get the deformation gradient of each element.
virtual void SetArticulatedJointInertiaParams(Span< real const > inertia, Error &error)=0
Set the per-joint inertia coefficients of the articulated actor.
virtual void * GetUserData() const =0
Get application-specific user data for this actor.
virtual void GetArticulatedDofLimits(Span< Real2 > outDofLimits, Error &error) const =0
Get the limit values on all DoFs of the articulated actor.
virtual void SetRecenteringParams(RecenteringParams const &params, Error &error)=0
Set the recentering parameters of the actor.
virtual void CancelQuery(QueryHandle handle)=0
Cancel a previously registered query.
virtual void SetArticulatedPoseControllerParams(PoseControllerParams const &params, Error &error)=0
Set the pose controller's tracking parameters.
virtual bool HasRootTransform() const =0
Check if the actor has a root transform.
virtual Span< real const > GetVisualMeshNodePositionsLocal(Error &error) const =0
Get the current position (reference + displacements) of the nodes of the visual mesh in the actor's l...
virtual bool IsQuerySupported(QueryType type) const =0
Check whether a query type is supported for this actor.
virtual void SetDensity(real density, Error &error)=0
Set the density of the actor in the undeformed configuration.
virtual ContactParams GetContactParams(Error &error) const =0
Get the contact parameters of the actor.
virtual void ClearExternalForces()=0
Remove all the external forces previously added.
virtual void SetZeroDisplacementsAndVelocities(Error &error)=0
Set all local displacement and velocity DoFs to zero.
virtual MeshDataView GetMesh() const =0
Get a view of the actor's reference simulation mesh.
virtual Span< ActorHandle const > GetNestedSoftActors(Error &error) const =0
Get the actor handles for the nested soft actors (if any).
virtual Span< real const > GetArticulatedControllerForce(Error &error) const =0
Get the generalized forces applied by the pose controller on each joint DoF.
virtual bool IsNestedSoftActor() const =0
Check if the actor is a soft actor nested within a soft skinned articulated actor.
virtual void AddArticulatedDeltaToPose(Span< real const > pose, Span< real const > deltaDofs, Span< real > outPose, Error &error) const =0
Add a pose delta to a pose using joint-aware composition.
virtual Span< PoseConstraintInfo const > GetArticulatedPoseConstraints(Error &error) const =0
Get the pose controller's constraints.
virtual Real3 GetLinearVelocity(Error &error) const =0
Get the linear velocity of the actor in world frame.
virtual void SetArticulatedTargetPose(Span< real const > pose, Error &error)=0
Set the target pose for the controller expressed as joint DoFs.
virtual void SetExternalForcesOnDofs(Span< int const > dofIndices, Span< real const > forceValues, Error &error)=0
Set external forces on specified DoFs.
virtual void GetArticulatedTargetLinkTransforms(Span< TransformRT > outWorldFromTargets, Error &error) const =0
Get the last target pose set to the pose controller, expressed as link transforms.
virtual void GetArticulatedPoseControllerParams(PoseControllerParams &outParams, Error &error) const =0
Get the pose controller's tracking parameters.
virtual ~Actor()=default
virtual void SetVelocity(Real3 const &linearVel, Real3 const &angularVel, Error &error)=0
Set the world-frame linear and angular velocity of the actor at the center of mass.
virtual Span< ArticulatedJointFrictionParams const > GetArticulatedJointFrictionParams(Error &error) const =0
Get the per-joint friction parameters of the articulated actor.
virtual void AddBoundaryConditionDofsWorldPermanent(Span< int const > dofIndices, Span< real const > dofValuesWorld, Error &error)=0
Add permanent boundary conditions to specified DoFs.
virtual void SetArticulatedJointVelocities(Span< real const > velocities, Error &error)=0
Set time derivatives of the articulated actor DoFs.
virtual bool IsStatic() const =0
Check whether the actor is static.
virtual void QueryNodesInVolumeLocal(Aabb const &volume, bool boundaryOnly, std::function< void(int, Real3)> const &callback, Error &error) const =0
Find the actor's nodes that are inside an axis-aligned bounding box (AABB).
virtual void GetArticulatedJointVelocities(Span< real > outVelocities, Error &error) const =0
Get time derivatives of the articulated actor DoFs.
virtual MeshDataView GetSurfaceMesh() const =0
Get a view of the actor's reference surface mesh.
virtual void SetNodePositionsLocal(Span< real const > positionsLocal, Error &error)=0
Set the current position of each node (reference + displacements) in the actor's local frame.
virtual void SetCenterOfMassTransform(TransformRT const &worldFromCom, Error &error)=0
Set the world-space transform of the actor expressed at the center of mass.
virtual void SetContactParams(ContactParams const &params, Error &error)=0
Set the contact parameters of the actor.
virtual real GetMass(Error &error) const =0
Get the total mass of the actor.
virtual Span< real const > GetNodePositionsLocal(Error &error) const =0
Get the current position (reference + displacements) of each node in the actor's local frame.
virtual void AddBoundaryConditionConstrainedNodesAtRest(Error &error)=0
Fix the "constrained nodes" at their world-space reference positions.
virtual void SetArticulatedTargetVelocity(Span< real const > velocity, Error &error)=0
Set the target velocity of the controller expressed as joint velocities for the next simulation step.
virtual void SetContactLayer(std::string_view const &layer)=0
Set the name of the contact layer of the actor.
virtual SdfDistances GetSdfDistances(Error &error) const =0
Get SDF distances for contact sample points.
virtual void QueryNodesInVolumeLocal(Sphere const &volume, bool boundaryOnly, std::function< void(int, Real3)> const &callback, Error &error) const =0
Find the actor's nodes that are inside a sphere.
virtual void QueryNodesInVolumeLocal(Obb const &volume, bool boundaryOnly, std::function< void(int, Real3)> const &callback, Error &error) const =0
Find the actor's nodes that are inside an oriented bounding box (OBB).
virtual Real6 GetRigidMomentOfInertiaLocal(Error &error) const =0
Get the moment of inertia tensor of the actor at the center of mass, aligned with the actor's local r...
virtual void GetArticulatedPose(Span< real > outPose, Error &error) const =0
Get the pose of an articulated actor expressed as joint DoFs.
virtual int GetNumDofs() const =0
Get the number of degrees of freedom (DoFs) of the actor.
virtual Real3 GetAngularVelocity(Error &error) const =0
Get the angular velocity of the actor in world frame.
virtual Context * GetContext()=0
Get the Context that owns this actor.
virtual ShapeHandle GetReferenceShape(Error &error) const =0
Get a new ShapeHandle referencing the same shape data used to create this actor.
virtual real GetElasticEnergy(Error &error) const =0
Get the elastic energy of the actor, measured as the difference with respect to the rest state.
virtual Real3 GetContactForceFromActorWorld(Actor const *other, Error &error) const =0
Get the total contact force on the actor from another specified actor.
virtual void SetRootTransform(TransformRT const &worldFromLocal, Error &error)=0
Set the actor's world-from-local transform (root transform).
virtual Span< ActorHandle const > GetNestedLinkActors(Error &error) const =0
Get the actor handles for the nested rigid link actors.
virtual void GetDofValues(Span< int const > dofIndices, Span< real > outDofValues, Error &error) const =0
Get the current value of the actor's degrees of freedom (DoFs) corresponding to the specified indices...
virtual Span< int const > GetBoundaryConditionDofIndices() const =0
Get the DoF indices that are constrained by boundary conditions.
virtual void RemoveArticulatedPoseController(Error &error)=0
Remove the pose controller.
virtual ActorHandle GetHandle() const =0
Get the actor's handle.
virtual TransformRT GetCenterOfMassTransform(Error &error) const =0
Get the world-space transform of the actor expressed at the center of mass.
virtual real GetDensity(Error &error) const =0
Get the density of the actor in the undeformed configuration.
virtual ColliderType GetColliderType() const =0
Get the collider type of the actor.
virtual ArticulatedShapeInfo GetArticulatedShapeInfo(Error &error) const =0
Get articulated shape information about the articulated actor.
virtual QueryHandle RegisterQuery(QueryType type, Error &error)=0
Register a query to compute data for this actor.
virtual void SetArticulatedTargetLinkTransforms(Span< TransformRT const > worldFromTargets, Error &error)=0
Set the target pose for the controller expressed as link transforms.
virtual void SetArticulatedJointFrictionParams(Span< ArticulatedJointFrictionParams const > friction, Error &error)=0
Set the per-joint friction parameters of the articulated actor.
virtual void ResetArticulatedTargetPose(Span< real const > pose, Error &error)=0
Reset the target pose of the controller expressed as joint DoFs.
virtual std::string_view GetContactLayer() const =0
Get the name of the contact layer of the actor.
virtual void GetExternalForces(Span< real > outForces, Error &error)=0
Get the external forces currently set on this actor as a dense array over all DoFs.
virtual Span< real const > GetArticulatedJacobian(Error &error) const =0
Get the Jacobian with respect to the articulated DoFs in world frame.
virtual void SetSoftMaterialParams(SoftMaterialParams const &params, Error &error)=0
Set the material parameters of a soft actor.
virtual ConvergenceStatus GetConvergenceStatus() const =0
Get the convergence status of the actor in the most recent simulation step.
virtual Scene * GetScene()=0
Get the Scene that this actor belongs to.
virtual Span< real const > GetSurfaceMeshNodePositionsLocal(Error &error) const =0
Get the current position of the nodes (reference + displacements) of the surface mesh in the actor's ...
virtual Span< ContactPoint const > GetContactPointsWorld(Error &error) const =0
Get all the active contact points of the actor.
virtual void AddBoundaryConditionConstrainedNodesAtRestPermanent(Error &error)=0
Permanently fix the "constrained nodes" at their world-space reference positions.
virtual void SetUserData(void *userData)=0
Set application-specific user data for this actor.
Represents a constraint that restricts the degrees of freedom of one or more actors.
Main entry point for SuperDex Physics simulation.
Represents a simulation scene.
Definition mochi_scene.h:45
ConvergenceStatus
Convergence status of the non-linear solver.
NdArray< real, 3 > Real3
Definition nd_array.h:106
ColliderType
Collision detection geometry for an Actor.
NdArray< real, 6 > Real6
Definition nd_array.h:109
ActorType
Type of actor.
Definition mochi_enums.h:25
QueryType
Type of query data to compute for an actor or constraint.
Unique identifier for an Actor within a Scene.
Information describing an articulated shape's kinematic structure.
Parameters for contact mechanics simulation.
A non-owning view of the mesh data for a Mochi actor or model file.
Definition mesh_data.h:218
Parameters to create a pose controller for an articulated actor.
Unique identifier for a query within a Scene.
Parameters controlling recentering behavior for soft actors (not soft-skinned).
SDF distance information for active contact sample points.
Handle to a shape (mesh, sphere, plane, etc.) within a Context.
Material parameters for soft body simulation.