Collision detection is fundamental to many applications, including computer games, physical simulations, robotics and virtual prototyping. In computer games, collision detection ensures that the illusion of a solid world is maintained. Without collision detection, characters could go through walls and other obstacles. Collision detection involves algorithms checking for intersection of two given objects. Simulating what happens once a collision is detected is sometimes referred to as "collision response". In its basic development the collision detection and resolution algorithm supports circular shapes and handle an arbitrary number objects at the same time using a Quad tree.

Maths of an entity in Caco*Asteroids


Entities in this case are referred to 2d objects in a particular space. Before simulating the physics of an entity, one must implement vector math for entity and vector calculus to which the fundamentals of vectors calculation for this application.This will lay a foundation to the physics of the "Caco*Asteroids" Project. Also in this project one will be implementing Matrices and quaternions.


Vectors are used for representing coordinates in space. The position of a 2D vector can be represented by 2 coordinate values in space. In 3D, vectors are represented by 3 coordinate values in space and 4D has 4. For the sake this project one will have to stick to 2D coordinates. A 2D coordinate can be represented as x and y values so that a vector at point P=[x,y]. where x and y are coordinates along the X and Y axis of a 2D space. vectors are the only way of representing position in space.

A vector can represent a change in position in 2d space and can be used to move an object in 2D space so that the Vector at point P becomes [x,y], where x is the change in the position from one place to another in the x axis and y is the change in position from one position to another in 2D space. in terms of 2D geometry, Movement or change of position will require many mathematical operations such a Vector subtraction, addition, multiplication and division by a scalar and different kinds of mathematical operations can be performed in light of how the movements of the 2D geometry of object. Other vector manipulations and different calculations are implemented in the Code below.

implementation the Vector Class in C++: CacoVector2D.h

For the purpose moving entities in the project one must visit differential calculus to be able implement velocity and Acceleration to calculate speed and direction of an entity. one also need to visit integral calculus to move objects to perform calculations on a component by component basis, for example position +=velocity *t; or in the case of the above vector class position.addScaledVector(velocity,t);

Vectors will always be the way one views and locates objects in any given space and it's easy to manipulate the vectors to determine position and direction and in this project one will need to start connection the two to perform physics simulation as described in the specification.

In 2D one can represent an object by its 2D position and an angle that shows how it is oriented. Just as the position is specified relative to some fixed origin point, the angle is also given relative to a predetermined direction.

All this implementation can be found in the header file given above.


A Matrix is a rectangular array of numbers with rows and columns. Given two matrices A and B, Matrix addition C=A+B is defined by the addition of elements in pairs for each matrix at corresponding positions. Matrix subtraction may also be defined as the addition operation but with the negation of pairs of elements in the matrix, However multiplication of matrices comes in two forms. if for example b is a scalar factor, then the scalar multiplication of B=bA, this means that b will be multiplied by every element in Matrix A to give B. The second multiplication Matrix is defined as


The mathematics of combining rotation uses matrices for orientation and rotational calculations.

implementation the Matrix Class in C++: CacoMatrix.h


This is the best way to handle orientation that gives more degrees of freedom to the application and it's the most widely used math concepts for orientations. Quaternions have four degrees of freedom to represent the three degrees of freedom in rotation.

implementation the Quaternions Class in C++: CacoQuaternions.h
Note: this is not implemented due to necessity.



This Page is still under construction Please bear with us. All our Resources are being gathered to provide you with more information about our services.