|
NcEngine
|
Interface for modifying a mutable CompoundShape. More...
#include <CompoundShape.h>
Public Member Functions | |
| CompoundShapeBuilder (CookedShape &shape) | |
| Construct a builder from a cooked mutable CompoundShape. | |
| auto | GetSubShapeCount () const -> uint32_t |
| Get the number of SubShapes. | |
| auto | GetSubShapeIndex (uint32_t userData) const -> SubShapeIndex |
| Get the index of the SubShape with userData. More... | |
| auto | GetSubShapePosition (SubShapeIndex index) const -> Vector3 |
| Get the local position of a SubShape. | |
| auto | GetSubShapeRotation (SubShapeIndex index) const -> Quaternion |
| Get the local rotation of a SubShape. | |
| auto | AddSubShape (const SubShapeInfo &info) -> SubShapeIndex |
| Add a new SubShape. | |
| void | RemoveSubShape (SubShapeIndex index) |
| Remove the SubShape at index. | |
| void | ModifySubShape (SubShapeIndex index, const Vector3 &position, const Quaternion &rotation) |
| Update the position and rotation of a SubShape. | |
| void | ReplaceSubShape (SubShapeIndex index, const SubShapeInfo &info) |
| Replace the SubShape matching shapeId (user data will be unchanged). | |
| void | RecalculateCenterOfMass () |
| Update internal COM offsets, if the shape has been modified significantly. | |
Interface for modifying a mutable CompoundShape.
Mutable CompoundShapes trade some query performance for the ability to be modified after cooking. The builder applies modifications directly to the provided CookedShape, holding a strong reference to it. Modification is only supported for untransformed shapes (cooking must be done with identity position, rotation, and scale).
| auto nc::CompoundShapeBuilder::GetSubShapeIndex | ( | uint32_t | userData | ) | const -> SubShapeIndex |
Get the index of the SubShape with userData.