public bool Overlaps(BBox b) { bool x = (pMax.x >= b.pMin.x) && (pMin.x <= b.pMax.x); bool y = (pMax.y >= b.pMin.y) && (pMin.y <= b.pMax.y); bool z = (pMax.z >= b.pMin.z) && (pMin.z <= b.pMax.z); return (x && y && z); }
public BBox MotionBounds(BBox bBox, bool p) { throw new NotImplementedException(); }
public BBox Apply(BBox b) { BBox ret = new BBox(Apply(new Point(b.pMin.x, b.pMin.y, b.pMin.z))); ret = Geometry.Union(ret, Apply(new Point(b.pMax.x, b.pMin.y, b.pMin.z))); ret = Geometry.Union(ret, Apply(new Point(b.pMin.x, b.pMax.y, b.pMin.z))); ret = Geometry.Union(ret, Apply(new Point(b.pMin.x, b.pMin.y, b.pMax.z))); ret = Geometry.Union(ret, Apply(new Point(b.pMin.x, b.pMax.y, b.pMax.z))); ret = Geometry.Union(ret, Apply(new Point(b.pMax.x, b.pMax.y, b.pMin.z))); ret = Geometry.Union(ret, Apply(new Point(b.pMax.x, b.pMin.y, b.pMax.z))); ret = Geometry.Union(ret, Apply(new Point(b.pMax.x, b.pMax.y, b.pMax.z))); return ret; }
public override BBox WorldBound() { BBox worldBounds = new BBox(); for (int i = 0; i < nverts; i++) worldBounds = Geometry.Union(worldBounds, p[i]); return worldBounds; }
public override BBox ObjectBound() { BBox objectBounds = new BBox(); for (int i = 0; i < nverts; i++) objectBounds = Geometry.Union(objectBounds, WorldToObject.Apply(p[i])); return objectBounds; }
public static BBox Union(BBox b, BBox b2) { BBox ret = new BBox(); ret.pMin.x = Math.Min(b.pMin.x, b2.pMin.x); ret.pMin.y = Math.Min(b.pMin.y, b2.pMin.y); ret.pMin.z = Math.Min(b.pMin.z, b2.pMin.z); ret.pMax.x = Math.Max(b.pMax.x, b2.pMax.x); ret.pMax.y = Math.Max(b.pMax.y, b2.pMax.y); ret.pMax.z = Math.Max(b.pMax.z, b2.pMax.z); return ret; }
public static BBox Union(BBox b, Point p) { BBox ret = new BBox(); ret.pMin.x = Math.Min(b.pMin.x, p.x); ret.pMin.y = Math.Min(b.pMin.y, p.y); ret.pMin.z = Math.Min(b.pMin.z, p.z); ret.pMax.x = Math.Max(b.pMax.x, p.x); ret.pMax.y = Math.Max(b.pMax.y, p.y); ret.pMax.z = Math.Max(b.pMax.z, p.z); return ret; }