playMaker

Author Topic: Action that converts Quaternion to Euler  (Read 4110 times)

eddieq

  • Playmaker Newbie
  • *
  • Posts: 4
Action that converts Quaternion to Euler
« on: July 21, 2013, 08:45:31 AM »
Hi,

I understand that Unity calculates rotation internally in Quaternion. But my program operates in Euler Angles by taking the existing object's XYZ rotation & adding a variable XYZ rotation before setting the new component into the object.

The problem is after adding & setting the rotation, the next time I get the rotation, it becomes different as it is converted internally from Quaternion.
Often I am faced with issues like z-axis flipped from 0 to 180 deg when my x exceeds 90 deg, or 0 to -90 degrees becoming 360 to 270 & beyond 270 and below flips the z-axis again to 180.

It will be very helpful to have an Action that converts Quaternion to Euler. ( I know there is a custom Action that converts Euler to Quaternion but that won't solve the problem )

Thanks,
Eddie

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Action that converts Quaternion to Euler
« Reply #1 on: July 28, 2013, 11:42:51 AM »
hi,

 good point, I am not sure why I haven't included this in the quaternion set of custom actions I did. Anyway, it's now available in the following package.

https://hutonggames.fogbugz.com/default.asp?W967

bye,

 Jean