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 Physics & Dark A.I. & Dark Dynamix / Return value for OBJECT ANGLE Y maxes out at 90 deg when using Dark Physics.

Author
Message
pdq
17
Years of Service
User Offline
Joined: 20th Jul 2006
Location:
Posted: 21st Aug 2006 19:38 Edited at: 22nd Aug 2006 21:39
Why is this? Is there a way to return the value with a range from 0 to 360?

The reason I am asking is because of an earlier post regarding the possibility of adding "AI Set Entity Angle Y" to DarkAI. And since the AI will return a Y angle value from 0 to 360, this of course will lead to problems integrating Dark Physics with DarkAI regarding rotation if the return values are not going to agree.



THX
pdq
17
Years of Service
User Offline
Joined: 20th Jul 2006
Location:
Posted: 22nd Aug 2006 21:47
I have updated the code above to show two cubes rotating. One by DBPro method and the other by DBPhysics. You'll notice that the return values are different (in fact one reports back as float and the other as integer) even though they rotate at the same speed.

I quess the real question is why doesnt DBPro report back the same return val, regardless of the method of rotation?

I quess this would also be a problem for someone making a physics game simulation that involves a cockpit view (car, plane...). Because the cockpit camera would only rotate to 90 deg and then reverse because that is what it is being told to do. I know this, because I tried it already.
Fallout
21
Years of Service
User Offline
Joined: 1st Sep 2002
Location: Basingstoke, England
Posted: 23rd Aug 2006 12:18
I almost made the exact same post you've just made. About a week ago I was playing with some code and noticed this issue and thought it was some weird angle incompatibility bug. But I checked out all the angles being returned and realised it was returning them correctly, of sorts. The angles returned definitely are valid Euler angles it's just that at the -90/+90 degree threshhold, it flips the X and Z angles 180 degrees (if I remember rightly) which means the y angle then stays in that 180 degree range.

I'd imagine the problem is the formula used to convert whatever angular system PhysX uses to DBP. Strictly speaking the angles are correct and fine, but it just means if you're operating largely in a 2D world (along the x and z axis), the y angle is the most important angle so it'd be nicer if it was returned between 0 and 360 degrees. I think I solved my own personal problem with it using EZRotate which obviously deals with this issue fine.

I don't know whether the angle conversion maths can be changed so that the yangle stays in a 360 degree range rather than a 180 one. If so, it could make things a bit easier for most games.

pdq
17
Years of Service
User Offline
Joined: 20th Jul 2006
Location:
Posted: 23rd Aug 2006 18:34
Fallout,

I dont have EZRotate, but I will get it if it will solve the problem. Is there a function call in EZRotate for the Y angle of an object that will return a 0-360 degree especially when PhysX is being used?

THX
Fallout
21
Years of Service
User Offline
Joined: 1st Sep 2002
Location: Basingstoke, England
Posted: 24th Aug 2006 01:06
I did a quick investigation. EZrotate will not return a Euler angle with a Y value from 0-360. It seems to return the same value as DBP, but you can use it's AxisAngles rotation system to derive the angle you're specifically after. Here's a little demo. You can't run it, but you can see how easy it is:



Here's the EZRotate definition for axis angles:
Quote: "Axis angles are defined by an XYZ angle value. The Y angle defines the global Heading angle (0-360 degrees) of the forward axis (Z). The X angle value defines pitch (-90 to 90 degrees) of the forward axis (z). The Z angle defines the amount of “roll” on the axis defined by the Y and X angle values."


This is actually much how people expect DB Euler angles to work, and lots of peeps over the years have questioned if DBs angles were buggy. Well, they were at one point, but they're not now. It's just Euler angles mess with your head. EZRotates axis angles seem like a good way to work with angles in 3D in a way that makes sense. Then all you do is call the EZRo_FindEuler command, and rotate your object in DBP using the calculated Euler angles. Easy stuff.

I've had EzRotate for a while now, but not really used it. It's definitely proving its worth each time I do though.

pdq
17
Years of Service
User Offline
Joined: 20th Jul 2006
Location:
Posted: 24th Aug 2006 02:47
Thanks Fallout. I think I'll download EZRotate.
Fallout
21
Years of Service
User Offline
Joined: 1st Sep 2002
Location: Basingstoke, England
Posted: 24th Aug 2006 13:23
No probs. This'll probably be a solution I use to the problem aswell.

Login to post a reply

Server time is: 2024-04-20 14:22:36
Your offset time is: 2024-04-20 14:22:36