Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

dario_s

Collision detect with md2??

This topic is 5625 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Anyone know how to do this? Im looking into this library called coldet (http://photoneffect.com/coldet/)... But I cant make it to work with my md2 code... Anyone have any examples of collision detect with md2 or animated models?? Please share your wisdom!

Share this post


Link to post
Share on other sites
Advertisement
This is how the md2 load code look like. Here I loop through all the frames and load all the polygons... Any ideas?


  
for (j = 0; j < numFrames; j++)
{
frame = (frame_t*)&buffer[modelHeader->offsetFrames + frameSize * j];

vertexListPtr = (vector_t*)&vertexList[numVertices * j];
for (i = 0; i < numVertices; i++)
{
vertexListPtr[i].point[0] = frame->scale[0] * frame->fp[i].v[0] + frame->translate[0];
vertexListPtr[i].point[1] = frame->scale[1] * frame->fp[i].v[1] + frame->translate[1];
vertexListPtr[i].point[2] = frame->scale[2] * frame->fp[i].v[2] + frame->translate[2];
}
}

Share this post


Link to post
Share on other sites
If I recall correctly the way Q2 does collision dection is they draw an invisible box around the model and only do collision detection for that box. You might want to think about that it might make life a bit easyer.

Share this post


Link to post
Share on other sites
Well, that works great for Q2, but my game is a fighting game.
I must be able to determine where ie. a kick hits...

Thanks for the replies! Im thinking of a bounding box/sphere kinda thing... with several boxes for diffrent bodyparts.

If you have more ideas, post em!

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!