ComponentRef

Define Collision

DefineCollision

Defines a collision detection test. Collision detection will occur between models with their category set to Cat1 and Cat2. Collision detection only need to be defined once, so a good place to put this component is in Application.OnLoaded.

For example: PlayerModel has its category set to "1". EnemyShotModel has category "2". Add a DefineCollision component with Cat1 set to "1" and Cat2 set to "2" for making collision detection between player and enemy shots.

Example usage: ZPong sample project.

Properties

Action

If set to "Collision" then Model.OnCollision is called on both the models involved in the collision. If set to "Stop" the model is moved out of intersection with the other model and movement stops, then the Model.OnCollision is called on both the models.

Cat1

The first model category in this collision test.

Cat2

The second model category in this collision test.

Green Marinee theme adapted by David Gilbert, powered by PmWiki