Flip orientation the same way on bezier movement, it is better
authorMircea Kitsune <sonichedgehog_hyperblast00@yahoo.com>
Thu, 24 May 2012 19:30:29 +0000 (22:30 +0300)
committerMircea Kitsune <sonichedgehog_hyperblast00@yahoo.com>
Thu, 24 May 2012 19:30:29 +0000 (22:30 +0300)
qcsrc/server/g_subs.qc
qcsrc/server/t_plats.qc

index 0c1eff1..004cf95 100644 (file)
@@ -204,8 +204,8 @@ void SUB_CalcMove_controller_think (void)
                {
                        vector vel;
                        vel = delta + 2 * delta2 * phasepos;
-                       vel_z = -vel_z; // invert z velocity
                        vel = vectoangles(vel);
+                       vel_x = -vel_x; // flip up / down orientation
                        self.owner.angles = vel;
                }
                self.nextthink = nexttick;
index fb3cb22..f1f8631 100644 (file)
@@ -310,9 +310,10 @@ void train_wait()
                        cp = world;
 
                if(cp) // bezier curves movement
-                       org = vectoangles(cp.origin - (self.origin + self.mins)); // use the origin of the control point of the next path_corner
+                       org = cp.origin - (self.origin + self.mins); // use the origin of the control point of the next path_corner
                else // linear movement
-                       org = vectoangles(targ.origin - (self.origin + self.mins)); // use the origin of the next path_corner
+                       org = targ.origin - (self.origin + self.mins); // use the origin of the next path_corner
+               org = vectoangles(org);
                org_x = -org_x; // flip up / down orientation
 
                if(self.wait >= 0) // slow turning