Games 101 w/ Verax

Ver el tema anterior Ver el tema siguiente Ir abajo

Games 101 w/ Verax Empty Games 101 w/ Verax

Mensaje  Verax Miér Dic 10, 2014 10:30 pm

GAMES 101 w/ VERAX:
A simple topic where I share tips and tricks within game programming, game designs, and just about everything within games.





Verax

Verax

Messages : 1139
Data de inscrição : 27/06/2014

Volver arriba Ir abajo

Games 101 w/ Verax Empty Re: Games 101 w/ Verax

Mensaje  Verax Miér Dic 10, 2014 10:38 pm

QUADTREES FOR COLLISION DETECTION:
If you have a game where your collision detection is taking way too much CPU power and is making the game slow, you can use a quadtree to reduce the number of collision detection operations.

A quadtree is basically a variant of a binary tree; it has four child nodes instead of two. The idea of a quadtree is to avoid calculating collisions for objects that cannot possibly collide. This is done by splitting our tree when it reaches x objects. Have a look at this:

Games 101 w/ Verax Image4

Here we have a quadtree that has been split into four, then yet again it has been split into four. The objects in the top left cannot collide with the objects in the bottom left, and therefore we reduce the number of collision detection calls/calculations. Neat, eh?
Verax

Verax

Messages : 1139
Data de inscrição : 27/06/2014

Volver arriba Ir abajo

Ver el tema anterior Ver el tema siguiente Volver arriba

- Temas similares

 
Permisos de este foro:
No puedes responder a temas en este foro.