Physics Engine Overview
A physic engine is computer software that provides an approximate simulation of certain physical systems, such as rigid body dynamics (including collision detection), soft body dynamics, and fluid dynamics, of use in the domains of computer graphics, video games and film.
Physics engine are used to simulate forces, kinetics, falling bodies under gravitation forces and collisions.
Their main uses are in video games (typically as middleware), in which case the simulations are in real-time. The term is sometimes used more generally to describe any software system for simulating physical phenomena, such as high-performance scientific simulation.
Physics in Video-Games
However, talking of video-games, execution speed and gameplay are more important than accuracy of simulation.
That is why game physics engine produce real-time simulation of real world physics but with a certain degree of approximation and such, for most common cases.
The aim is to produce a 'perceptually correct' simulation of real world, not an exact simulation in every point of view.
Previously, physic engines only simulate rigid bodies dynamics but last movies and games released started to use soft-bodies dynamics, used for example to simulate liquids, fire, explosion or particles emission.
A physical body, in the field of classical mechanics, is collection of matter that has properties such as mass, velocity, momentum and energy. The matter defines a contiguous boundary in 2D or 3D space. Orientation and external shape defines interactions between bodies
Sprite Basic PhysicsJS Engine
Sprite Basic has chosen PhysicsJS engine for its performances and ease of use. The real world in PhysicsJS is represented by the world basic object and controls the flow of the simulation while keeping track of all the parts of the simulation.
Physical objects are represented by bodies. The world will use an Integrator to update the positions and velocities of its bodies on every iteration. So far, this will result in the physics of non-interacting objects in empty space. Things get more interesting because of Behaviors. Behaviors will subscribe to integration events and modify bodies' accelerations, and sometimes velocities, and positions according to rules that will result in interesting behavior like collisions, gravity, constraints, etc.
With PhysicsJS physic engine, Sprite Basic offer users the capacity to write games ruled by real physic laws in a simple and elegant manner.