You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if(target != null){ //idk what I'm doing, but https://stackoverflow.com/questions/22099490/calculate-vector-after-rotating-it-towards-another-by-angle-θ-in-3d-space
240
237
ArcBulletDatadata = (ArcBulletData)b.data;
241
-
data.updateAccel(b);
238
+
Tmp.v31.set(b.vel, data.zVel); //Current direction
239
+
Tmp.v32.set(target.x() - b.x, target.y() - b.y, -data.z).setLength2(Tmp.v31.len2()); //Target direction
240
+
//TODO better target direction calculation. Take gravity into account for z.
241
+
242
+
floatvel = Tmp.v31.len();
243
+
floatangle = (float)Math.acos(Tmp.v31.dot(Tmp.v32) / (vel * vel)) * Mathf.radDeg;
0 commit comments