Player collision volume
by Tony Oakden · in Torque Game Engine · 03/02/2005 (2:58 pm) · 2 replies
Dear All,
I have a large variety of different shaped characters in my game so would like to be able to set the collision volume up when I make the model. I'm currently using milkshape for making models and know how to set the collision volume up and export it - works fine for items and static scene object.
However I know that the player object doesn't use the exported collision volume at all instead using a simple rectangle set up in it's datablock. Has anyone had any luck changing the player code so that it uses the exported collision volume? I've not looked in detail but I am assuming that I should be able to use the code from item or sceneobject as a template for this? I suspect one of the reasons why the code is written this way is to allow for seperate collision zones within the player e.g. headshots, but I don't use any of that code anyway.
I could set each of my collision volumes up by hand but it would be much easier if I could set up a collision mesh in Milkshape and have it work.
Any advice in this would be very much appreciated
I have a large variety of different shaped characters in my game so would like to be able to set the collision volume up when I make the model. I'm currently using milkshape for making models and know how to set the collision volume up and export it - works fine for items and static scene object.
However I know that the player object doesn't use the exported collision volume at all instead using a simple rectangle set up in it's datablock. Has anyone had any luck changing the player code so that it uses the exported collision volume? I've not looked in detail but I am assuming that I should be able to use the code from item or sceneobject as a template for this? I suspect one of the reasons why the code is written this way is to allow for seperate collision zones within the player e.g. headshots, but I don't use any of that code anyway.
I could set each of my collision volumes up by hand but it would be much easier if I could set up a collision mesh in Milkshape and have it work.
Any advice in this would be very much appreciated
#2
Actually my main problem was that some of my characters where centered on the origin in the model tool rather than having their feet set at y=0. So the collision volume as created by the datablock was too high. I got around this by adding an offset to the collision volume in the datablock and adding this to the collision volume when it's used in player.cc. It's clunky and needs tuning for each seperate character but at least my stuff works now.
03/05/2005 (5:51 pm)
Thaks Manoel,Actually my main problem was that some of my characters where centered on the origin in the model tool rather than having their feet set at y=0. So the collision volume as created by the datablock was too high. I got around this by adding an offset to the collision volume in the datablock and adding this to the collision volume when it's used in player.cc. It's clunky and needs tuning for each seperate character but at least my stuff works now.
Associate Manoel Neto
Default Studio Name
Of course, that probably opens another can of worms, since I suspect the shapeBase default collision wasn't made with movable objects in mind. You'll probably have to look at the Vehicle class and check how it does handle things like collision volume rotation properly.