This pattern gets its name from the way that all insertions and deletions are limited to one place like a physical gateway where all people must move through it to get in or out which allows you to control flow.[/bquote]
There are three basic operations:
- When an object moves, it pushes itself into the void, updates its position, then pops itself back into the world.
- When an object is created, it is created in the void then popped into the world.
- When an object is destroyed, it is pushed into the void first, then destroyed.
It should also be noted that having one gateway of change allows multiple changes to be made simultaneously with minimal synchronization effect. For example, push(); move(); changeSize(); pop(); prevents an unnecessary update from happening around the changeSize() call.[/bquote]
[bquote]Some games have different world or index states. For example:
- An object may be allowed to be placed inside of another object (a container).
- An object may be attached to another object (a weapon, armor, etc.)In these cases, there may be more than one implementation of pop(). For example:
- popIntoWorld( int x, int y); // pop into world
- popIntoContainer( Model &container ); // pop into container
- popOnto( Model &parent, Matrix4X4 &orient ); // pop onto another model.[/bquote][size="5"]
Issues and Risks
[bquote]A Gateway simplifies the synchronization of a Spatial Index with a Model Database.[size="5"]Uses and References
Gateways are often implemented inside of Model Database code.[/bquote]
[bquote]Thanks to Herman Miller and Tony Zurovec.[/bquote]