Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function Vector4:toYawPitchRoll ()
- --local ret = self:toYawPitch()
- --ret.roll = 0
- --return ret
- if math.abs(self.z) < 0.99 then
- local ret = self:toYawPitch()
- ret.roll = self.w / RAD
- return ret
- else
- return {
- yaw = self.w / RAD * sif(self.z < 0, 1, -1),
- pitch = sif(self.z > 0, -90, 90),
- roll = 0
- }
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement