![]() |
Xors3d Engine
|
Modules | |
Compound | |
Functions | |
void | xEntityAddBoxShape (Entity *entity, float mass, float width=0.0f, float height=0.0f, float depth=0.0f) |
Creates a box shape and attaches it to the entity. | |
void | xEntityAddCapsuleShape (Entity *entity, float mass, float radius=0.0f, float height=0.0f) |
Creates a capsule shape and attaches it to the entity. | |
void | xEntityAddConcaveShape (Entity *entity, float mass) |
Creates a concave shape and attaches it to the entity. | |
void | xEntityAddConcaveShapeProxy (Entity *entity, Entity *proxy, float mass) |
Creates a concave shape using information about vertices and indices of the proxy entity and attaches it to the main entity. | |
void | xEntityAddConeShape (Entity *entity, float mass, float radius=0.0f, float height=0.0f) |
Creates a cone shape and attaches it to the entity. | |
void | xEntityAddConvexShape (Entity *entity, float mass) |
Creates a convex shape and attaches it to the entity. | |
void | xEntityAddConvexShapeProxy (Entity *entity, Entity *proxy, float mass) |
Creates a convex shape using information about vertices and indices of the proxy entity and attaches it to the main entity. | |
void | xEntityAddCylinderShape (Entity *entity, float mass, float width=0.0f, float height=0.0f, float depth=0.0f) |
Creates a cylinder shape and attaches it to the entity. | |
void | xEntityAddDummyShape (Entity *entity) |
Creates a dummy shape and attaches it to the entity. | |
void | xEntityAddSphereShape (Entity *entity, float mass, float radius=0.0f) |
Creates a sphere shape and attaches it to the entity. | |
void | xEntityAddTerrainShape (Entity *entity) |
Creates a static shape for a terrain. | |
void | xEntityAddTriMeshShape (Entity *entity) |
Creates a trimesh (triangle mesh) shape and attaches it to the entity. | |
void | xEntityAddTriMeshShapeProxy (Entity *entity, Entity *proxy) |
Creates a trimesh (triangle mesh) shape using information about vertices and indices of the proxy entity and attaches it to the main entity. | |
void | xEntityAttachBody (Entity *entity, IBody *body) |
Attaches a previously detached body. | |
IBody * | xEntityDetachBody (Entity *entity) |
Detaches a body from an entity. | |
void | xFreeEntityBody (Entity *entity) |
Frees the body of an entity. |
void xEntityAddDummyShape | ( | Entity * | entity | ) |
Creates a dummy shape and attaches it to the entity.
A dummy shape has no mass and collision body.
entity | Entity handle |
void xEntityAddBoxShape | ( | Entity * | entity, |
float | mass, | ||
float | width = 0.0f , |
||
float | height = 0.0f , |
||
float | depth = 0.0f |
||
) |
Creates a box shape and attaches it to the entity.
Set any dimension of the box shape to zero or less than zero and the shape will fit the dimensions of the entity automatically.
entity | Entity handle |
mass | Mass of the body |
width | Width of the body |
height | Height of the body |
depth | Depth of the body |
void xEntityAddSphereShape | ( | Entity * | entity, |
float | mass, | ||
float | radius = 0.0f |
||
) |
Creates a sphere shape and attaches it to the entity.
Set the radius of the sphere shape to zero or less than zero and the shape will fit the dimensions of the entity automatically.
entity | Entity handle |
mass | Mass of the body |
radius | Radius of the body |
void xEntityAddCapsuleShape | ( | Entity * | entity, |
float | mass, | ||
float | radius = 0.0f , |
||
float | height = 0.0f |
||
) |
Creates a capsule shape and attaches it to the entity.
Set any dimension of the capsule shape to zero or less than zero and the shape will fit the dimensions of the entity automatically.
entity | Entity handle |
mass | Mass of the body |
radius | Radius of the body |
height | Height of the body |
void xEntityAddConeShape | ( | Entity * | entity, |
float | mass, | ||
float | radius = 0.0f , |
||
float | height = 0.0f |
||
) |
Creates a cone shape and attaches it to the entity.
Set any dimension of the cone shape to zero or less than zero and the shape will fit the dimensions of the entity automatically.
entity | Entity handle |
mass | Mass of the body |
radius | Radius of the body |
height | Height of the body |
void xEntityAddCylinderShape | ( | Entity * | entity, |
float | mass, | ||
float | width = 0.0f , |
||
float | height = 0.0f , |
||
float | depth = 0.0f |
||
) |
Creates a cylinder shape and attaches it to the entity.
Set any dimension of the cylinder shape to zero or less than zero and the shape will fit the dimensions of the entity automatically.
entity | Entity handle |
mass | Mass of the body |
width | Width of the body |
height | Height of the body |
depth | Depth of the body |
void xEntityAddTriMeshShape | ( | Entity * | entity | ) |
Creates a trimesh (triangle mesh) shape and attaches it to the entity.
Created trimesh shape is static which means that moving of vertices won't affect the shape.
entity | Entity handle |
void xEntityAddTriMeshShapeProxy | ( | Entity * | entity, |
Entity * | proxy | ||
) |
Creates a trimesh (triangle mesh) shape using information about vertices and indices of the proxy entity and attaches it to the main entity.
Created trimesh shape is static which means that moving of vertices won't affect the shape.
Usually proxy entity is a lowpoly version of the main entity. Proxy entity may be freed after using in this function.
entity | Entity handle |
proxy | Proxy entity handle |
void xEntityAddConvexShape | ( | Entity * | entity, |
float | mass | ||
) |
Creates a convex shape and attaches it to the entity.
The convex shape works much faster than the concave one. That's why the use of the convex shape is more preferable if it fits your needs.
entity | Entity handle |
mass | Mass of the body |
void xEntityAddConvexShapeProxy | ( | Entity * | entity, |
Entity * | proxy, | ||
float | mass | ||
) |
Creates a convex shape using information about vertices and indices of the proxy entity and attaches it to the main entity.
The convex shape works much faster than the concave one. That's why the use of the convex shape is more preferable if it fits your needs.
entity | Entity handle |
proxy | Proxy entity handle |
mass | Mass of the body |
void xEntityAddConcaveShape | ( | Entity * | entity, |
float | mass | ||
) |
Creates a concave shape and attaches it to the entity.
Unlike a convex shape a concave shape can have dents and holes. For instance, a torus will have a hole if it was created as a concave shape.
entity | Entity handle |
mass | Mass of the body |
void xEntityAddConcaveShapeProxy | ( | Entity * | entity, |
Entity * | proxy, | ||
float | mass | ||
) |
Creates a concave shape using information about vertices and indices of the proxy entity and attaches it to the main entity.
Unlike a convex shape a concave shape can have dents and holes. For instance, a torus will have a hole if it was created as a concave shape.
entity | Entity handle |
proxy | Proxy entity handle |
mass | Mass of the body |
void xEntityAddTerrainShape | ( | Entity * | entity | ) |
Creates a static shape for a terrain.
Can be used only with the terrains.
entity | Entity handle |
void xEntityAttachBody | ( | Entity * | entity, |
IBody * | body | ||
) |
Attaches a previously detached body.
In combination with xEntityDetachBody() this function is useful if you need to switch bodies between two or more shapes.
entity | Entity handle |
body | Body handle |
IBody* xEntityDetachBody | ( | Entity * | entity | ) |
Detaches a body from an entity.
In combination with xEntityAttachBody() this function is useful if you need to switch bodies between two or more shapes.
entity | Entity handle |
void xFreeEntityBody | ( | Entity * | entity | ) |
Frees the body of an entity.
entity | Entity handle. |