Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
So i've been trying to use the new actions for sfx Pitch/roll/yaw but none of them seem to edit the correct value, like editing pitch will change yaw and roll etc just doesn't work properly, am i doing something wrong or is it just glitched in the normal (Non ptr) patch atm?
This should work when x and y are not equal to 0 but it should be fairly easy to implement a solution for those cases. There is probably a more optimized way of doing what I am doing here.
I will do so when I have the time to work on the system again.
JASS:
struct MissileVector3
real x
real y
real z
//yaw
//zero safety in case of y==0 or (y==0 and x==0)
method operator angleX takes nothing returns real
local real ix = RAbsBJ(this.x)
local real iy = RAbsBJ(this.y)
return Atan(this.z/this.y)*(1-(ix/(ix+iy)))
endmethod
//pitch
//zero safety in case of x==0 or (x==0 and y==0)
method operator angleY takes nothing returns real
local real ix = RAbsBJ(this.x)
local real iy = RAbsBJ(this.y)
return -Atan(this.z/this.x)*(1-(iy/(ix+iy)))//the - is not a mistake
endmethod
//roll
method operator angleZ takes nothing returns real
return Atan2(this.y,this.x)
endmethod
endstruct
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.