MilkShape exporter and collision meshes
by David Fielder · in Torque Game Engine · 03/05/2004 (12:21 pm) · 5 replies
I've created a custom player with Milkshape, and I replaced the orc in the starter.fps project with it. I am having one problem with collisions. The collision region appears to be much smaller than the actual mesh. There is a zone (centered around the origin) that, when I aim at, show the damage bar. If I shoot at any other part of the mesh, the projectile goes right through.
I was under the understanging that, for players, the collision region is the bounding box of the mesh. I tried using the Milkshape exporter to export the bounding box and use a collision mesh to no avail. I also tried creating a box in Milkshape called "bounds", and I also tried "collision".
I did notice that if I loaded the DTS file in as a static shape, the bounding box is perfect. So, can anybody think of what is happeing here? Is it possible that the bounding box fomr the player is defined elsewhere in the script files?
Dave
I was under the understanging that, for players, the collision region is the bounding box of the mesh. I tried using the Milkshape exporter to export the bounding box and use a collision mesh to no avail. I also tried creating a box in Milkshape called "bounds", and I also tried "collision".
I did notice that if I loaded the DTS file in as a static shape, the bounding box is perfect. So, can anybody think of what is happeing here? Is it possible that the bounding box fomr the player is defined elsewhere in the script files?
Dave
#2
Just wondering... Because when i do that, i see an actual gray
untextured box :/
03/11/2004 (4:01 am)
Okay now... In the End, did you use theQuote:
also tried creating a box in Milkshape called "bounds", and I also tried "collision".
Just wondering... Because when i do that, i see an actual gray
untextured box :/
#3
Anyway, as I said, for a player object, the collision mesh (whatever it is) appears to be ignored in favor of the "boundingBox" entry in the Player.cc script.
Dave
p.s. I say "appears" a lot in this post because I am new to the engine, and I not familiar with it's inner workings. Just posting my observations. If anybody can correct me on any point, please feel free to.
03/11/2004 (8:01 am)
Yeah, it appears that the Milkshape exporter does not need you to manually create a box called "bounds". It appears to not recognize it as anything special, and simply includes it as a part of the mesh. It appears that the exporter automatically generates the bounds (which should be obvious, since I see no reason why the user should have to manually create that anyway).Anyway, as I said, for a player object, the collision mesh (whatever it is) appears to be ignored in favor of the "boundingBox" entry in the Player.cc script.
Dave
p.s. I say "appears" a lot in this post because I am new to the engine, and I not familiar with it's inner workings. Just posting my observations. If anybody can correct me on any point, please feel free to.
#4
I too am trying to subsitute the exsiting orc model with one ive created with milkshape - but im getting an error:
"TSMaterialList: Getflags: index out of bounds"
I put all the same animations into the milkshape version and one material (Material01). it seems like it exports ok - but when i run the demo i get an error or it locks up.
Did you change anything else in YOUR milkshape player.dts file? Any changes in player.cs or player.cfg files
Do the bones or materials need to be EXACTLY the same as the old orc model? What material file did you use?
Im really close - i know it - but theres one little thing wrong - i just cant figure out what it is.
Thanks
Bill
03/11/2004 (5:56 pm)
Hello David... I was hoping you could help me out.I too am trying to subsitute the exsiting orc model with one ive created with milkshape - but im getting an error:
"TSMaterialList: Getflags: index out of bounds"
I put all the same animations into the milkshape version and one material (Material01). it seems like it exports ok - but when i run the demo i get an error or it locks up.
Did you change anything else in YOUR milkshape player.dts file? Any changes in player.cs or player.cfg files
Do the bones or materials need to be EXACTLY the same as the old orc model? What material file did you use?
Im really close - i know it - but theres one little thing wrong - i just cant figure out what it is.
Thanks
Bill
#5
You should try exporting a box or sphere first, just to get it working, and then try your custom model.
Also, make sure that you select "bounding box" as your collision mesh in the export window. I have found that torque may crash if you do not do this (even though the boundingBox setting in the Player.cs is actually used).
Dave
03/13/2004 (9:31 am)
I have never encountered that error before. Perhaps you should select ALL faces, go to materials, select the material and then click "assign". Other than that, I can't think of anything.You should try exporting a box or sphere first, just to get it working, and then try your custom model.
Also, make sure that you select "bounding box" as your collision mesh in the export window. I have found that torque may crash if you do not do this (even though the boundingBox setting in the Player.cs is actually used).
Dave
Torque Owner David Fielder
boundingBox = "1.2 1.2 2.3";
Since my character is a bit bigger than than the default orc, I changed it to
boundingBox = "2 5 5";
and it works fine now.
Dave