OGWWorldContactTestAspect Class Reference
Inherits from | OGWAspect : NSObject |
Declared in | OGWWorldContactTestAspect.h |
Overview
Performs various contact tests. Tests a single entity against other entities in a specific category using a specific contact test type.
For best performance try to test against sparsely populated categories. If necessary break down heavily populated categories into smaller ones, for example if you’re only interested in intersections with boss enemies then add boss enemies into a category of their own rather than adding them to the generic “enemies” category. On the other hand you may now have to perform other tests on both enemies and bosses categories, so use your best judgement.
Note: it is legal to test an entity against its own category. The “self” entity will be filtered out since by definition an entity always intersects itself.
Instance Methods
performTest:withEntity:againstCategory:contacts:
Performs a specific test type testing one entity against the entities in a category. The contacts are added to the user-supplied hash table.
- (void)performTest:(OGWContactTest)test withEntity:(OGWEntity *)entity againstCategory:(const OGWEntityCategory *)category contacts:(NSHashTable *)contacts
Parameters
- test
The type of test to perform. See OGWContactTest.
- entity
The source entity to test collision with.
- category
The entities of this category will be tested for contact with the entity.
- contacts
A user-supplied NSHashTable to which contacts will be added. Must not be nil.
Declared In
OGWWorldContactTestAspect.h