Game Development Reference
In-Depth Information
Particles
The simplest representation of physical properties is achieved through the particles
method. In this case, it is assumed by the physics engine that items consist of a
single point in space (that is, a particle). The particle can move in space (that is, it
has velocity), but it neither rotates nor does it have any volume. We use particles in
games for effects such as explosions and smoke.
Rigid bodies
The most common physical representation system is that of rigid bodies. In this case,
items are defined by the physics engine as consisting of a shape in space (for example,
a cube or a collection of spheres). The rigid body can move in space and can rotate in
space, so it has both linear and angular velocity. It also has volume. This volume is
represented by a fixed shape which does not change over time, hence the term rigid
body . This approach is taken for practically everything in games where reasonable
accuracy is required.
The rigid bodies that do not move are static bodies and the other are dynamic bodies.
To define a rigid body as static, we use the set_movable(false) function. Terrains
are the best examples of static rigid bodies.
JigLib, like other physics systems, has the RigidBody class. We are listing the most
common properties of the class:
RigidBody.prototype._id=null;
RigidBody.prototype._skin=null;
RigidBody.prototype._type=null;
RigidBody.prototype._boundingSphere=null;
RigidBody.prototype._boundingBox=null;
RigidBody.prototype._currState=null;
RigidBody.prototype._oldState=null;
RigidBody.prototype._mass=null;
RigidBody.prototype._bodyInertia=null;
RigidBody.prototype._force=null;
RigidBody.prototype._torque=null;
RigidBody.prototype._activity=null;
RigidBody.prototype._movable=null;
RigidBody.prototype._doShockProcessing=null;
RigidBody.prototype._material=null;
RigidBody.prototype._nonCollidables=null;
RigidBody.prototype._constraints=null;
RigidBody.prototype.collisions=null;
RigidBody.prototype.isActive=null;
 
Search WWH ::




Custom Search