Browse Source

Object.setTransform: prevent Vector alloc

trethaller 6 years ago
parent
commit
69139b01df
1 changed files with 2 additions and 1 deletions
  1. 2 1
      h3d/scene/Object.hx

+ 2 - 1
h3d/scene/Object.hx

@@ -770,8 +770,9 @@ class Object implements hxd.impl.Serializable {
 		Set the position, scale and rotation of the object relative to its parent based on the specified transform matrix.
 	**/
 	static var tmpMat = new h3d.Matrix();
+	static var tmpVec = new h3d.Vector();
 	public function setTransform( mat : h3d.Matrix ) {
-		var s = mat.getScale();
+		var s = mat.getScale(tmpVec);
 		this.x = mat.tx;
 		this.y = mat.ty;
 		this.z = mat.tz;