Possible to query for list of contacts w/StaticTriangleGroup

Discuss any questions about BEPUphysics or problems encountered.
Post Reply
BrianL
Posts: 54
Joined: Wed Jun 25, 2008 4:41 pm
Location: Panama City Beach, FL

Possible to query for list of contacts w/StaticTriangleGroup

Post 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.
Norbo
Site Admin
Posts: 4929
Joined: Tue Jul 04, 2006 4:45 am

Re: Possible to query for list of contacts w/StaticTriangleGroup

Post 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.
Post Reply