Page 1 of 1
Possible to query for list of contacts w/StaticTriangleGroup
Posted: Sat Apr 11, 2009 9:14 pm
by BrianL
Is it possible to query for the list of contacts with a StaticTriangleGroup? I need this because as I move objects (STGs) around in an editor, sometimes they have Entities resting on them that need to be re-activated. Otherwise the resting Entities just fall through. Any ideas? Thanks.
Re: Possible to query for list of contacts w/StaticTriangleGroup
Posted: Sat Apr 11, 2009 10:36 pm
by Norbo
While you can't get the contacts directly (they aren't any when the objects are resting on a STG, actually), you can do a brute force activation on all entities within a bounding box. Grabbing the StaticTriangleGroup.triangleMesh.hierarchy.boundingBox and querying the broadphase with space.broadphase.getEntities(BoundingBox) will get you the possibly colliding entities with which you can call (Entity).activate(). This will obviously do a bit more than necessary, but needlessly reactivated entities will quickly go back to sleep.