فهرست منبع

Fix preAbsPos not being updated.

clementlandrin 1 سال پیش
والد
کامیت
b7ef1de6e3
1فایلهای تغییر یافته به همراه9 افزوده شده و 2 حذف شده
  1. 9 2
      h3d/scene/Object.hx

+ 9 - 2
h3d/scene/Object.hx

@@ -682,7 +682,7 @@ class Object {
 		return follow = v;
 	}
 
-	function calcAbsPos() {
+	function calcPrevAbsPos() {
 		if ( prevAbsPosFrame == NO_VELOCITY )
 			prevAbsPos = null;
 		else if ( prevAbsPosFrame < hxd.Timer.frameCount ) {
@@ -692,6 +692,11 @@ class Object {
 			else
 				prevAbsPos.load(absPos);
 		}
+	}
+
+	function calcAbsPos() {
+		calcPrevAbsPos();
+
 		qRot.toMatrix(absPos);
 		// prepend scale
 		absPos._11 *= scaleX;
@@ -824,7 +829,9 @@ class Object {
 		if ( !drawn || !ctx.computeVelocity || fixedPosition || culled  )
 			prevAbsPosFrame = NO_VELOCITY;
 		else if ( prevAbsPosFrame == NO_VELOCITY )
-			prevAbsPosFrame = VELOCITY;
+				prevAbsPosFrame = VELOCITY;
+		calcPrevAbsPos();
+
 		if( !culled || ctx.computingStatic ) {
 			emit(ctx);
 			drawn = false;