Exemple #1
0
 public BVHAABB3Object(Vector3 min, Vector3 max)
     : base(GeoShape.GeoAABB3)
 {
     mAABB3  = new GeoAABB3(min, max);
     mCenter = (min + max) * 0.5f;
     mExtent = max - min;
 }
Exemple #2
0
 public BVHTriangle3Object(Vector3 p1, Vector3 p2, Vector3 p3, int meshIndex = 0, int faceIndex = 0)
     : base(GeoShape.GeoTriangle3)
 {
     mP1        = p1;
     mP2        = p2;
     mP3        = p3;
     mCenter    = (mP1 + mP2 + mP3) * 0.333333f;
     mAABB      = new GeoAABB3(Vector3.Min(Vector3.Min(mP1, mP2), mP3), Vector3.Max(Vector3.Max(mP1, mP2), mP3));
     mMeshIndex = meshIndex;
     mFaceIndex = faceIndex;
 }
Exemple #3
0
 public void ExpandToInclude(GeoAABB3 b)
 {
     mMin    = Vector3.Min(mMin, b.mMin);
     mMax    = Vector3.Max(mMax, b.mMax);
     mExtent = mMax - mMin;
 }