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.

Dark GDK / position object infront of camera without dbLockObjectOn

Author
Message
Wikaman1
16
Years of Service
User Offline
Joined: 17th Aug 2008
Location: Scotland
Posted: 15th Jul 2009 04:28
I'm making a simple space sim but I'm having trouble with the shooting. Basically I want the bullet to always be infront of the camera until it is fired. I tried using this -



but that doesn't work at all. Is there any other way to do this without using that command?
Mista Wilson
16
Years of Service
User Offline
Joined: 27th Aug 2008
Location: Brisbane, Australia
Posted: 15th Jul 2009 07:42
You could call dbPositionObject and use dbRotateObject or dbPointObject (or I think dbSetObjectToCameraOrientation() could be used to set an object to the camera orientation, to avoid the maths but I dont know how or if that command works so you would need to experiment with it) and pass them the camera's position and look angles and then add/subtract a small amount although you would need to apply some maths to make it stay infront of the camera if the camera wasnt looking ahead level.

If it ain't broke.... DONT FIX IT !!!
Morcilla
21
Years of Service
User Offline
Joined: 1st Dec 2002
Location: Spain
Posted: 17th Jul 2009 12:21
I think that there is a code snippet for this, somewhere in the code snippet forum...

Login to post a reply

Server time is: 2024-10-01 08:30:21
Your offset time is: 2024-10-01 08:30:21