Multiple objects & collision (DirectX)
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?
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..?
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
hope that helps
-Dan
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 :>
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
Popular Topics
Advertisement