
Surface collision
I''m working with the scripting language of a sector-based game engine. With a script, I can retrieve each suface''s normal, center position, and vertex positions.
Now, when given a direction vector and a position vector, I need to find out which surface that anything traveling along that vector from that position would collide with.
So assuming I can access all the information I need, what kind of algorithm should I use? I''m not exactly stupid, but I''m afraid it''s beyond me.
Thanks for your time.

Could you clarify "sector-based"? I''m thinking of a collection of convex spaces that constitute a "map" (like BSP), but I''ve heard the term used to represent other things as well.
From your description, each sector sounds like an arbitrary polygon. Your collision detection code would require two components. The first determines the line passing through each neighbouring pair of vertices on a sector edge and checks to see if the current motion vector intersects this line. The second part verifies the collision condition, that a collision only occurs if the point is between the two vertices.
Cheers,
Timkin
Cheers,
Timkin
Sorry, should have explained that before.
These sectors are nearly arbitrary polygons (they must be convex), but in the game you are limited to movement inside of the sectors. There is no "outside" to these sectors. And sectors are joined together to create a map.
Timkin, could you elaborate on those components?
Thanks for the replies.

Timkin, could you elaborate on those components?
Thanks for the replies.

This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement