Static shape collision mesh not affecting cameras
by Sangwoo Hong · in Torque Game Engine · 10/15/2004 (10:17 am) · 4 replies
I'm experimenting with using a static shape as my terrain object.
(Don't ask why. I have my reasons for experimenting and I'm not
interested in having a discussion about how using static shapes
for terrain is wrong.)
I brought in a static shape of a simple hill and dropped my player
character on it. The player character walks fine. However, the
3rd person camera doesn't seem to react to the hill's collision
mesh and I consequently end up looking at the back of my
character from inside the hill.
Does anyone have any idea about how to get the 3rd person camera
to honor the static shape's collision mesh? I'm thinking this must
be a engine level "change some .cc file and recompile" issue. Maybe
I have to steal some code that makes the camera react to the
terrain...
(Don't ask why. I have my reasons for experimenting and I'm not
interested in having a discussion about how using static shapes
for terrain is wrong.)
I brought in a static shape of a simple hill and dropped my player
character on it. The player character walks fine. However, the
3rd person camera doesn't seem to react to the hill's collision
mesh and I consequently end up looking at the back of my
character from inside the hill.
Does anyone have any idea about how to get the 3rd person camera
to honor the static shape's collision mesh? I'm thinking this must
be a engine level "change some .cc file and recompile" issue. Maybe
I have to steal some code that makes the camera react to the
terrain...
#2
I think I can best describe what's going on with the camera by saying this.
When you're in 3rd person view, if you pull your mouse down, the camera
rolls under the character showing the character's underside but not the
bottom of the character's feet since the camera is colliding with the floor.
However, when I roll the camera under the character's feet when they are
standing on the static shape floor, the camera rolls to where I can see the
bottom of my character's feet telling me that the camera is not colliding with
the floor.
What's even more confusing is the fact that if I fire the crossbow at the static
shape ground, the bolt flies right through the floor telling me it's not colliding
with the static shape floor either.
But if that's the case and there is no collision happening, how can my character
be standing on the floor in the first place?!?
I can send you the dts file if you'd like but I don't have your e-mail address...
10/15/2004 (12:46 pm)
I am using the stock camera code and have not made any changes. I think I can best describe what's going on with the camera by saying this.
When you're in 3rd person view, if you pull your mouse down, the camera
rolls under the character showing the character's underside but not the
bottom of the character's feet since the camera is colliding with the floor.
However, when I roll the camera under the character's feet when they are
standing on the static shape floor, the camera rolls to where I can see the
bottom of my character's feet telling me that the camera is not colliding with
the floor.
What's even more confusing is the fact that if I fire the crossbow at the static
shape ground, the bolt flies right through the floor telling me it's not colliding
with the static shape floor either.
But if that's the case and there is no collision happening, how can my character
be standing on the floor in the first place?!?
I can send you the dts file if you'd like but I don't have your e-mail address...
#3
10/15/2004 (12:57 pm)
Humm, OK I'm just about to head home so I will try that in an hour or so. Yeh, send me the dts, and I'll give that a go. I updated by profile so you have my email now. PS. dont forget to remove the REMOVE :)
#4
08/25/2005 (7:55 pm)
I haven't tried this out yet, but would adding a LOS Collision mesh solve this problem? (id like to find out for myself too)
Torque Owner CdnGater
Duggan Software Studio
The current version of camera code does react to collision with a static mesh in 3rd person camera.
This is the mask used in Camera::validateEyePoint.
U32 mask = TerrainObjectType | InteriorObjectType | WaterObjectType | StaticShapeObjectType | PlayerObjectType | ItemObjectType | VehicleObjectType;I don't know if you are using the normal camera code, or if you have made changes. Anyway, find the collision mask, and make sure StaticShapeObjectType is included and that infact the terrain you are adding is a StaticShape.
Lastly, if you want, send me the terrain, or tell me what you did, and I will do a test myself to see if I can recreate the problem.