math.atan2
Posted: 31 Jul 2014, 12:17
Im tryint to y-turn a units leg towards a point..(both are in worldspace) .. so i assumed using math atan2 i could get the degree in rad where to turn the leg.
However this did not work out.
What was the magic dance one had to do, to get spring, to behave correct?
Did i miss out on one step?

However this did not work out.
What was the magic dance one had to do, to get spring, to behave correct?
Did i miss out on one step?
Code: Select all
function resolveKinematics(x,y,z, tPx,tPy,tPz, lorgx,lorgy,lorgz, number,targPoint)
zvx,zvy,zvz=tPx-lorgx,tPy-lorgy,tPz-lorgz
Norm=math.sqrt(zvx*zvx+ zvy*zvy)
yaw=math.atan2(zvz, Norm)
Turn(StriTable[number].UpLeg,y_axis,yaw,0,true)