Game Development Community

Collision Meshes on a PlayerClass derived object?

by Marc-Andre Vachon · in Torque Game Engine · 03/05/2009 (5:44 am) · 2 replies

Hi!
For my current project I'm using a copy of the PlayerClass to control a kind of Hover Tank (Didn't want/need the HoverVehicleClass physic). Anyway, it's going very well but now I need to update the collision system a bit. I have found something to allow the Bounding Box to rotate with player, should work.

But, I think I should be able to use collision meshes instead. The "Player" only run on flat .dif and he will always stay vertical. So I guess using basic collision meshes shouldn't be hard. I have implemented the hitbox ressource and i'd like to use those box for the collison instead of bounding box.

Is it possible? If so, I'm not looking for a complete solution necessarly but at least some hint about where to look at in code or pointing me at a ressource I might have miss. Maybe I could just use the standard ShapeBase collision, but does it will work with the player movements?

Any suggestions , hint or help appreciated!

Thanks

#1
03/05/2009 (7:48 am)
Player::updatePos has all the collision handling for Players - you might want to have a look there. The code checks whether the Player's bounding box will overlap with anything it's moving towards (if I'm reading the code right). I *think* you could just plug in your own custom shape there and do collision checks against it.
#2
03/05/2009 (3:33 pm)
Thanks David, I had a look there but I think I would need to modify the buildConvex and buildPolyList function too. The updatePos function is lacking some commenting too, I'm not sure if I understand it well and how I could adjust it. I will look further into it.
I'm not a very good coder but I will do some experiments to see if I can get close of something that could work.

Stay tuned!