浏览代码

Better debug obj for h3d/col/Sphere.hx

clementlandrin 4 月之前
父节点
当前提交
5c5dd21083
共有 1 个文件被更改,包括 5 次插入4 次删除
  1. 5 4
      h3d/col/Sphere.hx

+ 5 - 4
h3d/col/Sphere.hx

@@ -114,10 +114,11 @@ class Sphere extends Collider {
 
 
 	#if !macro
 	#if !macro
 	public function makeDebugObj() : h3d.scene.Object {
 	public function makeDebugObj() : h3d.scene.Object {
-		var prim = new h3d.prim.Sphere(r, 20, 15);
-		prim.translate(x, y, z);
-		prim.addNormals();
-		return new h3d.scene.Mesh(prim);
+		var prim = h3d.prim.Sphere.defaultUnitSphere();
+		var mesh = new h3d.scene.Mesh(prim);
+		mesh.scale(r);
+		mesh.setPosition(x,y,z);
+		return mesh;
 	}
 	}
 	#end
 	#end