Multiple objects & collision (DirectX)

Started by
2 comments, last by Digibo 19 years, 2 months ago
Ok, as far as I understand it, to get multiple instances of a game object I just load it once and then render it with different transform matrices. But then how does collision between the objects work? For example I'd like to use D3DXIntersect (for unit selection in a simple strategy...) but I don't seem to understand which mesh should I pass it. Also how do I get different animation times/tracks for each game object with a single Animation Controller?
Advertisement
Ok, each object has it's own Animation Controller, they are not tied to the mesh. The timing problem is solved.
But still the mesh intersect question..?
If i understanding what your saying, what you need to do is transform the mesh and then check for intersection, and as far as instancing, youd end up with not only a transform, but a animation controller for each instance.

hope that helps
-Dan
When General Patton died after World War 2 he went to the gates of Heaven to talk to St. Peter. The first thing he asked is if there were any Marines in heaven. St. Peter told him no, Marines are too rowdy for heaven. He then asked why Patton wanted to know. Patton told him he was sick of the Marines overshadowing the Army because they did more with less and were all hard-core sons of bitches. St. Peter reassured him there were no Marines so Patton went into Heaven. As he was checking out his new home he rounded a corner and saw someone in Marine Dress Blues. He ran back to St. Peter and yelled "You lied to me! There are Marines in heaven!" St. Peter said "Who him? That's just God. He wishes he were a Marine."
For the intersection - I think I got it, I have to apply the world matrix to the ray too(duh! :|). I'll have to rework the code so it takes each object's transform matrix, applies it to the ray and checks for collision with the mesh.

For the instancing - Yeah I figured out that each instance needs a separate Animation Controller, but now I'm trying to understand how is the controller "applied" to the mesh so you get the right thing to render. I've been ripping apart the MultiAnimation sample for hours and what I see is advancing the controller's time and then updating the frames starting from the root.. which is shared among all instances? I must be missing something because I see no link between the specific controller and the shared frame (the controller isn't passed anywhere). Hints?

Hope you manage to understand my far-from-perfect English :>

This topic is closed to new replies.

Advertisement