Browse Source

Adding clone on sphere collider.

clementlandrin 1 year ago
parent
commit
d9ea72705b
1 changed files with 9 additions and 0 deletions
  1. 9 0
      h3d/col/Sphere.hx

+ 9 - 0
h3d/col/Sphere.hx

@@ -101,6 +101,15 @@ class Sphere extends Collider {
 		return r;
 	}
 
+	public inline function clone() {
+		var s = new Sphere();
+		s.x = x;
+		s.y = y;
+		s.z = z;
+		s.r = r;
+		return s;
+	}
+
 	#if !macro
 	public function makeDebugObj() : h3d.scene.Object {
 		var prim = new h3d.prim.Sphere(r, 20, 15);