Browse Source

Merge pull request #160 from sepharoth213/point

Add SetLength to h3d.col.Point
Nicolas Cannasse 9 years ago
parent
commit
17a93f5bd2
1 changed files with 7 additions and 0 deletions
  1. 7 0
      h3d/col/Point.hx

+ 7 - 0
h3d/col/Point.hx

@@ -51,6 +51,13 @@ class Point {
 		return x * x + y * y + z * z;
 	}
 
+	public inline function setLength(len:Float) {
+		normalizeFast();
+		x *= len;
+		y *= len;
+		z *= len;
+	}
+
 	public inline function length() {
 		return lengthSq().sqrt();
 	}