Game Development Community

Camera don't collide with single-side mesh?

by Nabarro · in Torque Game Engine · 05/29/2009 (10:03 pm) · 1 replies

Hello, everybody,
I made one single-side mesh ground, but camera doesn't collide with the ground effectively. The camera can easily go below the single-mesh ground.
In ShapeBase.cpp:void ShapeBase::getCameraTransform(F32* pos,MatrixF* mat), it seems that it always gets failed with "if (mContainer->castRay(sp, ep,(0xFFFFFFFF & ~(WaterObjectType |GameBaseObjectType |DefaultObjectType)),&collision) == true)"

How to fix the problem? May anybody give any tips?

Thanks,

#1
05/30/2009 (1:05 am)
I'm away from my dev computer at the moment, but I would guess offhand that the camera is casting a ray from the camera's position to the object's position? Check what the points sp and ep are set to to verify this. If the mesh is single-sided, then maybe the raycast won't hit anything in one direction. Is it possible to test the reverse case? Put the player under the ground and try to move the camera through the ground again?