-
Notifications
You must be signed in to change notification settings - Fork 0
cDoubleVector
Defines a vector in 2D space using double-typed magnitude and direction variables.
double
The magnitude of the vector.
double
The direction of the vector, given in degrees clockwise from the +x axis.
cDoubleVector checkCSpriteCollision(cSprite sprite1, cSprite sprite2)
Checks collision between two sprites. Returns the Minimum Translation Vector, the vector representing the path that sprite1 must travel to stop intersecting sprite2. If no collision is found, the returned cDoubleVector.magnitude will be equal to 0.
cDoubleVector checkC2DModelCollision(c2DModel model1, c2DModel model2, bool fast)
Checks collisions between two c2DModels. If fast == true, then the collision is checked between the two c2DModel.rect rectangles. If fast == false, then the collision is checked between every sprite of model1 and every sprite of model2.
A recommended use of the "fast == false" mode is after a "fast == true" check found a collision. The fast check gives you an estimate of if two models are colliding, and the slow check can find if they are colliding with 100% accuracy.