Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / Camera Collision?

Author
Message
Dark Flame
19
Years of Service
User Offline
Joined: 15th Feb 2005
Location: England
Posted: 17th Mar 2005 23:05
I have walls around my matrix and ive also got some code that stops the camera going off the matrix, but the walls are slightly in more than the edge of the matrix. Is there a way i can have camera collision so it stops the camera going past the walls?

Thanks

robo cat
20
Years of Service
User Offline
Joined: 23rd Feb 2004
Location: In a cat litter tray, near you...
Posted: 18th Mar 2005 01:09
Either you can move the camera around slowly as if you move an object rather than jumping it to the target in one go. That way you can clide it against the walls with some sliding collision.

Alternatively you can write a ray cast function that projects a line from the player object (such as a man walking around on the matrix) and place the camera in the spot just before it hits the walls.

Simple... yet fun!
Dark Flame
19
Years of Service
User Offline
Joined: 15th Feb 2005
Location: England
Posted: 18th Mar 2005 03:38
What is the coding for the second one?

Thanks

BearCDPOLD
21
Years of Service
User Offline
Joined: 16th Oct 2003
Location: AZ,USA
Posted: 19th Mar 2005 07:15
Or you could use a substitute collision box. Have the control move the box around, make the camera mimic the box's movement, and check for collision box against walls.

Crazy Donut Productions
Current Project: A Redneck game
Dark Flame
19
Years of Service
User Offline
Joined: 15th Feb 2005
Location: England
Posted: 19th Mar 2005 07:53
How would i do that?

Thanks

Dodo
20
Years of Service
User Offline
Joined: 8th Aug 2004
Location: eating lunch
Posted: 20th Mar 2005 18:53
make a dummy object, like a sphere. Every loop you position it at the camera's position. Then, you write a sliding collison routine and detect camera collisions using the dummy object. And don't forget to hide the dummy object.

Part of solving the problem is actually noticing that the problem is there in the first place

Login to post a reply

Server time is: 2024-11-13 19:56:23
Your offset time is: 2024-11-13 19:56:23