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 / dbSetXAngle() ???

Author
Message
randal
16
Years of Service
User Offline
Joined: 18th Nov 2008
Location:
Posted: 24th Jun 2009 12:18
Is there no dbSetXAngle() in darkGDK? Why not?

I have tried to work around this by looping dbPitchUp()until the object's angle equals the angle I want it to be in, but because of the float values I end up in infinite loops.
Mista Wilson
16
Years of Service
User Offline
Joined: 27th Aug 2008
Location: Brisbane, Australia
Posted: 24th Jun 2009 16:16
wouldnt a combo of :

// set x, y, z rotation of object
dbRotateObject( int iObject, float fX, float fY, float fZ )

// set X, Y, Z angles of object
dbXRotateObject ( int iObject, float fX )
dbYRotateObject ( int iObject, float fY )
dbZRotateObject ( int iObject, float fZ )

// tells object which axis to rotate around first while rotating
dbSetObjectRotationXYZ ( int iObject )
dbSetObjectRotationZYX ( int iObject )

dbRollObject
dbPitchObject
dbTurnObject
commands might help aswell as they allow free rotation independantly of any axis rotation, ie, free movement

Lastly, if you are getting stuck in an infinite loop because of floating point inprescision, I would suggest looking at another way of performing your iteration that doesnt rely on its condition being a floating point that can become imprescise.

If it ain't broke.... DONT FIX IT !!!

Login to post a reply

Server time is: 2024-11-25 08:31:38
Your offset time is: 2024-11-25 08:31:38