Large model walks through walls...
by Dennis Saarela · in Torque Game Engine · 02/08/2005 (6:20 pm) · 10 replies
Hi!
We are using a large player model (16 m (units)) long and 8m wide. It is based on a rigid body and not on the ordinary player coz we want to use collision meshes. Everything works fine until you reach a vertical(or almost) terrain wall. Then the model puts its head inside, there is no collision. If we do a smaller object; like 4m long and 2m wide this doesn't accur.
When an object is testing collision against the terrain, does it test a maximum of 4 squares or something? Coz when we tried a 12m long object we got collision after 25-35% of the model was inside the wall. Anyone got any ideas, thoughts or solutions??
We are using a large player model (16 m (units)) long and 8m wide. It is based on a rigid body and not on the ordinary player coz we want to use collision meshes. Everything works fine until you reach a vertical(or almost) terrain wall. Then the model puts its head inside, there is no collision. If we do a smaller object; like 4m long and 2m wide this doesn't accur.
When an object is testing collision against the terrain, does it test a maximum of 4 squares or something? Coz when we tried a 12m long object we got collision after 25-35% of the model was inside the wall. Anyone got any ideas, thoughts or solutions??
About the author
#2
02/10/2005 (3:22 am)
Many collision algorithms, including the ones that Torque uses, tend to have problems colliding objects of widely dissimilar size. You can try tesselating the collision mesh more finely, but the best thing would be to just make it a bit smaller if you can. :)
#3
I'm not using the player style physics. The boundingbox and collision meshes comes from the shape file.
We have tried to tesslating the collisions mesh and that doesn't change anything, we still don't get any collisions. :(
The problem seems to be that the surface the model walks thorugh isn't in the collision workingList at all. If we put the model ~8 units into the wall, then the surface is added to the workingList and we get collision.
I have dug through the code and got lost somewhere between all "bins". Can someone explian where and how the terrain polygons is put into collision workingList for the convex our player is using. Still thinks the problem is threre somewhere, that only four squars of the terrain are put in the workingList.
02/11/2005 (1:35 am)
Thnaks for the replies.I'm not using the player style physics. The boundingbox and collision meshes comes from the shape file.
We have tried to tesslating the collisions mesh and that doesn't change anything, we still don't get any collisions. :(
The problem seems to be that the surface the model walks thorugh isn't in the collision workingList at all. If we put the model ~8 units into the wall, then the surface is added to the workingList and we get collision.
I have dug through the code and got lost somewhere between all "bins". Can someone explian where and how the terrain polygons is put into collision workingList for the convex our player is using. Still thinks the problem is threre somewhere, that only four squars of the terrain are put in the workingList.
#4
Have you tried using the CollisionTest visualizer? Accessible via the console, type collision and hit tab to see the various options.
Does your model look right in the TSTPro?
02/11/2005 (2:26 pm)
No, the terrain collision code will put as many squares as necessary (up to a fairly large limit).Have you tried using the CollisionTest visualizer? Accessible via the console, type collision and hit tab to see the various options.
Does your model look right in the TSTPro?
#5
02/11/2005 (2:44 pm)
@Ben is that some resource? if I type collision and hit tab nothing happens. (TGE1.3)
#7
Is there someplace all the little very useful bits like this are stored I can read about them?
I also just learned about tree() which is invaluable to me now.
02/11/2005 (3:05 pm)
That's great by the way exactly something I was looking for about a month ago. Is there someplace all the little very useful bits like this are stored I can read about them?
I also just learned about tree() which is invaluable to me now.
#8
02/12/2005 (8:04 pm)
There will be. Not at the moment. Give me a few weeks. :)
#9
We do use the $GameBase::boundingBox to draw the boundingbox, collisionmesh and the collision points.
This is the way is looks like when I go inside a wall:
02/17/2005 (6:53 am)
I tried the $Collision:: things. But it seems like the information I get is for the camera? Because only the ground under the camera is affected. We do use the $GameBase::boundingBox to draw the boundingbox, collisionmesh and the collision points.
This is the way is looks like when I go inside a wall:
#10
Looking at your screenshot (couldn't you just replace your art with a cube rather than block out large chunks of the image?) it seems like the bounding box doesn't match up at all with the shape. That might be part of the problem.
02/19/2005 (4:37 pm)
Yes, the visualization is relative to the camera. It's not "for" the camera, though; it's global information accessible to any object that wants it. With a bit of experimenting you should be able to find out everything you need.Looking at your screenshot (couldn't you just replace your art with a cube rather than block out large chunks of the image?) it seems like the bounding box doesn't match up at all with the shape. That might be part of the problem.
Torque Owner Clint S. Brewer
just to rule out the obvious, have you set your player's bounding box in the datablock? not sure if you are using the player style of physics detection or not though since you said you are using a rigid body.
for instance in PlayerBody datablock:
so for you those numbers should be something like
I certainly wouldn't put it past the code to just check whatever terrain square you are on top of, or near... look at the code to see!