The physics in this project is based of newton laws of motion. An entity has a position, velocity and acceleration which helps to know the direction to which an entity is travelling and at what speed. this means that orientation of the entity do not matter as it is easier to determine where the entity is going.
The Entity Implemented in this Project has different physics components that helps one track the physics components of the entity from position to velocity, mass to inverse mass , torque and speed thus having the following components:
/** * Holds the Inverse Mass of the entity. */ float inverseMass; /** * Holds the damping force of the entity. */ float damping; float radius; /** * Holds the linear position of the entity. */ Vector2D position; /** * Holds the linear velocity of the entity. */ Vector2D velocity; Vector2D forceAccum; /** * Holds the acceleration of the entity. This value * can be used to set acceleration due to gravity (its primary * use) or any other constant acceleration. */ Vector2D acceleration; /** * The speed of The entity*/ float Speed; /** The current rotation on the Z axis of this entity */ float rotation; /** * Rotation of the body around it's center of gravity in radians. Must agree with rotation! Use SetAngle() when changing the angle for this reason.*/ float Angle; /** * Angular velocity of the body around it's center of gravity in radians/second.*/ float wAngle; /** * Torque applied to the body around it's center of gravity.*/ float torque; Vector2D rot;//entity's rotational value// temp float Area;//entity's Area CacoShapeType type;//entity's Shape Type