|
@@ -78,6 +78,17 @@ class Sphere extends Collider {
|
|
|
return res;
|
|
|
}
|
|
|
|
|
|
+ public function transform( m : h3d.Matrix ) {
|
|
|
+ var s = m.getScale();
|
|
|
+ var smax = hxd.Math.max(hxd.Math.max(hxd.Math.abs(s.x), hxd.Math.abs(s.y)), hxd.Math.abs(s.z));
|
|
|
+ r *= smax;
|
|
|
+ var pt = new h3d.col.Point(x,y,z);
|
|
|
+ pt.transform(m);
|
|
|
+ x = pt.x;
|
|
|
+ y = pt.y;
|
|
|
+ z = pt.z;
|
|
|
+ }
|
|
|
+
|
|
|
public inline function inSphere( s : Sphere ) {
|
|
|
return new Point(x,y,z).distanceSq(new Point(s.x,s.y,s.z)) < (s.r + r)*(s.r + r);
|
|
|
}
|