Body
The Body class provides an interface to Scene bodies. It provides an association with a NodeObject.
#include <scene/TellusimBody.h>
Constructors
Body()
Methods
static Body create(Type type, const char *name = nullptr)
Clear body.
void clear()
Body type.
Type getType() const
static const char *getTypeName(Type type)
const char *getTypeName() const
bool isRigid() const
bool isRagdoll() const
bool isCloth() const
bool isSoft() const
Body unique identifier.
uint32_t getID() const
Body index.
uint32_t getIndex() const
Body address.
uint32_t getAddress() const
Body name.
void setName(const char *name)
void setName(const String &name)
String getName() const
Body scene.
void setScene(Scene &scene, bool check = true)
const Scene getScene() const
Scene getScene()
Enabled flag.
void setEnabled(bool enabled)
bool isEnabled() const
Object mask.
void setObjectMask(uint32_t mask)
uint32_t getObjectMask() const
Collider mask.
void setColliderMask(uint32_t mask)
uint32_t getColliderMask() const
Hidden flag.
void setHidden(bool flag)
bool isHidden() const
Expanded flag.
void setExpanded(bool flag)
bool isExpanded() const
Internal flag.
void setInternal(bool flag)
bool isInternal() const
Virtual flag.
void setVirtual(bool flag)
bool isVirtual() const
Changed flag.
void setChanged(bool flag)
bool isChanged() const
Pointer info.
void setPtrInfo(void *ptr)
void *getPtrInfo() const
Meta info.
void setMetaInfo(const String &info)
String getMetaInfo() const
Body object.
uint32_t getObjectID() const
void setObject(NodeObject &object)
const NodeObject getObject() const
NodeObject getObject()
Body shapes.
void shrinkShapes()
void reserveShapes(uint32_t num_shapes)
uint32_t addShape(Shape &shape, bool check = true)
bool removeShape(Shape &shape)
void releaseShapes()
bool swapShapes(Shape &shape_0, Shape &shape_1, bool update = false)
uint32_t findShape(const Shape &shape) const
uint32_t findShape(const char *name) const
uint32_t getNumShapes() const
uint32_t getShapeCount() const
uint32_t getShapeCapacity() const
const Array<Shape> getShapes() const
Array<Shape> getShapes()
const Shape getShape(uint32_t index) const
const Shape getShape(const char *name) const
Shape getShape(uint32_t index)
Shape getShape(const char *name)
void updateShapes(Array<Shape> shapes)
void updateShape(Shape &shape)
void updateShapes(bool update = false)
uint32_t getShapeAddress() const
Body joints.
void shrinkJoints()
void reserveJoints(uint32_t num_joints)
uint32_t addJoint(Joint &joint, bool check = true)
bool removeJoint(Joint &joint)
void releaseJoints()
bool swapJoints(Joint &joint_0, Joint &joint_1, bool update = false)
uint32_t findJoint(const Joint &joint) const
uint32_t findJoint(const char *name) const
uint32_t getNumJoints() const
uint32_t getJointCount() const
uint32_t getJointCapacity() const
const Array<Joint> getJoints() const
Array<Joint> getJoints()
const Joint getJoint(uint32_t index) const
const Joint getJoint(const char *name) const
Joint getJoint(uint32_t index)
Joint getJoint(const char *name)
void updateJoints(Array<Joint> joints)
void updateJoint(Joint &joint)
void updateJoints(bool update = false)
uint32_t getJointAddress() const
Load body.
bool load(const Xml &xml)
bool load(const Json &json)
bool load(Stream &stream)
Save body.
bool save(Xml &xml) const
bool save(Json &json) const
bool save(Stream &stream) const
Clone body.
Body clone(Scene &scene) const
Copy body.
void copy(const Body &body)
Updated flag.
bool isUpdated() const
Update scene.
void updateScene()
Enums
Type
Body types.
Name | Value |
---|---|
TypeUnknown | 0 |
TypeRigid | 1 |
TypeRagdoll | 2 |
TypeCloth | 3 |
TypeSoft | 4 |
NumTypes | 5 |