## How Many Vectors?

In the past I have created a few simple 2D games with nothing more than a vector for location and variables for the speed and degree of my ship. Since my current project is in 3D, however, I'm not sure if such simplicity will be best when I add external forces to the mix (e.g. explosions, gravity, etc...) and then collision detection.

Any advice?

Is the little appfactory branching out into games? Cool!

you dont need a vector for acceleration. the acceleration impressed to the ship is determined each frame. â€œEvery body perseveres in its state of being at rest or of moving uniformly straight forward except insofar as it is compelled to change by forces impressed.â€ Good old Isaac. Acceleration is not a state variable.

Â©hâ‚¬ck Ã¸ut Âµy stuÆ’Æ’ Ã¥t ragdollsoft.com

New game in development Rubber Ninjas - Mac Games Downloads

Code:

`// Constant quantities.`

float oneOverM; // reciprocal mass of body

Matrix3x3 *IBodyInv; // inverse of the body-space inertia tensor

// State variables.

Vector3 *x; // position

Vector3 *p; // linear momentum

Vector3 *L; // angular momentum

Quaternion *q; // orientation in quaternion form

// Auxiliary variables.

Matrix3x3 *I_inv; // inverse of real-space inertia tensor

Vector3 *v; // linear velocity

Vector3 *omega; // angular velocity

Matrix3x3 *R; // rotation matrix, derived from q

// Computed quantities.

Vector3 *force; // net force on body

Vector3 *torque; // net torque on body

Vector3 *linearImpulse; // net linear impulse on body

Vector3 *rotationalImpulse; // net rotational impulse on body