If everything is static, you can set up an alternate 2D version where you
perform your calculations. Otherwise you can also check the position and size
of each wall to try and figure out these boundaries yourself.
I'm not sure how easy it is to implement, but you might also be able to use a
3D physics engine to tell you about collisions, although that might be overkill.
On Fri, 08 Jan 2010 09:25:05 -0800, dyc <[email protected]> wrote:
Can you elaborate a bit?
On Jan 6, 1:48 pm, Stephen Hopkins <[email protected]> wrote:
If everything is cube sized/2 dimensional, use a tile grid for
collision
On Jan 6, 1:44 pm, dyc <[email protected]> wrote:
> Hey everyone,
> I've been building this 3D room out of cubes for the walls and floor
> and roof...now I have my camera moving around inside of the room with
> the mouse and keyboard, but I dont want the camera to be able to go
> thru the 4 walls.
> Each wall is a different Cube Object...and I am doing movement via
> camera.moveForward(distance)...
> any ideas on what would be the easiest approach?
> I was thinking about doing something like:
> if(camera.distanceTo(_backWall) < MY_MAX_DISTANCE){
> camera.moveForward(distance);
> }
> only problem is, that is not dynamic, and as the user moves around the
> moveForward will be pointing at a different wall and I will need to
> detect the distance to it with a different if statement..
> Thanks so much!
> `Scott