Skip to content

14 days of Akaldiroka – Day 4

August 11, 2011
by

Ok so tonight im working out how to get a solid collision detection system using the tools I have created, already we have two bounding volumes to act as a range to limit the calculations we have to do, and also we have a function that provides brute force collision detection.

So now comes the tricky bit, where and how to use it. So far I have determined that having a function within the entity manager that takes the key of an entity is the best way to go.

Something happened at 1am this morning that really threw me a bit, currently we are supporting the wavefront obj file format, and everything is great ‘n’ all, but it’s actually a fairly messy format to deal with. So unfortunately I decided perhaps it’s best to create one fit for purpose. 3 and half hours later, ive finished, and wow using tricks from the TiledMax project such as XML and GZip really payed off. Even though there is a slight bit more padding in the structure, thanks to the fast compression, I’ve managed to make the format (which i dubbed .m3d, or mesh3d) which has the same speed performance, includes light mapping information, incorporates material data inside the same file, animation frame indecies where appropriate, and is far more easier to read than wave front OBJ files.

I know what your thinking, but what happened to the collision detection? Well as the file format issue set me back a few hours, it’s gotten a bit late, so i’ll have to postpone it till tomorrow. However I did manage to write the function that tests for collision detection. Looking at it without any tests, it looks like it should be fast enough, it uses the BoundingBox and a sensitivity measurement to detect near triangles only, then tests to see if the triangles facing the movement direction have ray’s that intersect triangles in the sensitive range, and report back the result. Obviously this is a little different to more preferred ways such as octree’s and bsp, but as collision detection is entity dependant in this engine, a fresh design was warrented.

Thanks for following, and I’ll update this blog again tomorrow!

Aimee.

Advertisements
No comments yet

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: