EntityPhysicBody()

Syntax

EntityPhysicBody(#Entity, Type)
Description
Changes the type of the body associted with the #Entity.

To have its collisions managed by the physic engine, an entity has to set a body. In fact, only the body is known by the physic engine, which will do all the calculation about the entity, check the mass, friction and if it collides will move back the real entity.

To have any effect, the physic engine needs to be activated with the EnableWorldPhysics().
  #PB_Entity_None       : No body is associated to the entity (default)
  #PB_Entity_StaticBody : The body is a static only, which means than the mesh can't be animated.
                          This mode allows very precise collisions, as it's done against triangles
                          (also known as tri-mesh collision). It's also fast when colliding with
                          a box or sphere entity body type. It's perfect when using a mesh for
                          a ground or static world.
  #PB_Entity_BoxBody    : A 'virtual' box is set around the entity (with the same dimensions)
                          and is used to manage the collision against the other entities.
  #PB_Entity_SphereBody : A 'virtual' sphere is set around the entity and is used to manage the collision
                          against the other entities.

Supported OS

Windows, Linux

<- EntityMaterial() - Entity Index - EntityRenderMode() ->