Procházet zdrojové kódy

LookAt: remove alloc

Tom SPIRA před 4 roky
rodič
revize
ffc9afa9fd
1 změnil soubory, kde provedl 2 přidání a 1 odebrání
  1. 2 1
      hrt/prefab/fx/LookAt.hx

+ 2 - 1
hrt/prefab/fx/LookAt.hx

@@ -13,6 +13,7 @@ class LookAtObject extends h3d.scene.Object {
 
 
 	static var tmpMat = new h3d.Matrix();
 	static var tmpMat = new h3d.Matrix();
 	static var tmpVec = new h3d.Vector();
 	static var tmpVec = new h3d.Vector();
+	static var tmpScale = new h3d.Vector();
 	static var deltaVec = new h3d.Vector();
 	static var deltaVec = new h3d.Vector();
 	static var lookAtPos = new h3d.Vector();
 	static var lookAtPos = new h3d.Vector();
 	static var lockAxis = new h3d.Vector();
 	static var lockAxis = new h3d.Vector();
@@ -69,7 +70,7 @@ class LookAtObject extends h3d.scene.Object {
 		else
 		else
 		{
 		{
 			tmpMat.load(absPos);
 			tmpMat.load(absPos);
-			var scale = tmpMat.getScale();
+			var scale = tmpMat.getScale(tmpScale);
 			qRot.initDirection(deltaVec);
 			qRot.initDirection(deltaVec);
 			qRot.toMatrix(absPos);
 			qRot.toMatrix(absPos);
 			absPos._11 *= scale.x;
 			absPos._11 *= scale.x;