Speeding up repetitive collision checks?

David20321
Posts: 17
Joined: Sat Mar 13, 2010 10:08 pm

Speeding up repetitive collision checks?

Post by David20321 »

In my game project, I do a lot of very similar collision queries. For instance, if a character is walking across a surface, I sweep a small sphere downwards from above each foot to get the ground position for inverse kinematics. Similarly, visibility checks works by tracing a ray from one character's eyes to a different random point on the target's body every frame.

These checks are repeated very often, and track almost the same path, and presumably follow a lot of the same paths through the broadphase and narrowphase hierarchies, so I was wondering if there's some way to accelerate repeated tests by reusing this information. For example, by storing the path through the hierarchy in the first check, and then checking against this path for the second check. This way, I could reuse information from the right-foot IK sweep test for frame 351 to accelerate the sweep test for frame 352.