Пример #1
0
 public Sphere(Vector3 center, float radius, Material material)
     : base(material)
 {
     Center = center;
     Radius = radius;
     _rad2 = radius*radius;
     var radVector = new Vector3(radius);
     BoundingBox = new BoundingBox(center - radVector, center + radVector);
 }
Пример #2
0
 public static BoundingBox Combine(BoundingBox b1, BoundingBox b2)
 {
     return new BoundingBox(
         Vector3.ComponentMin(b1.Min, b2.Min),
         Vector3.ComponentMax(b1.Max, b2.Max));
 }