Beispiel #1
0
        public static void CalcBoundingBox(this RSM.Mesh m, ref BoundingBox box)
        {
            Vector4[] Matrix = m.Matrix.Matrix3x3;
            Vector3   vi     = Vector3.Zero;
            Vector3   v      = Vector3.Zero;

            box.Min.X = box.Min.Y = box.Min.Z = 999999.0f;
            box.Max.X = box.Max.Y = box.Max.Z = -999999.0f;

            for (int i = 0; i < m.MainVectorCount; i++)
            {
                v = m.MainVectors[i].MultipleMatrix(Matrix);
                if (m.IsOnly == false)
                {
                    v.X += m.Matrix.Translate1.X + m.Matrix.Translate2.X;
                    v.Y += m.Matrix.Translate1.Y + m.Matrix.Translate2.Y;
                    v.Z += m.Matrix.Translate1.Z + m.Matrix.Translate2.Z;

                    box.Min = box.Min.MinFrom(v);
                    box.Max = box.Max.MaxFrom(v);
                }
            }
        }
Beispiel #2
0
 /// <summary>
 /// is the Parent from <see cref="Mesh"/> == MainMesh ?
 /// </summary>
 /// <param name="MainMesh"></param>
 /// <param name="Mesh"></param>
 /// <returns></returns>
 public static bool IsParent(this RSM.Mesh MainMesh, RSM.Mesh Mesh)
 {
     return(MainMesh.Head.Name == Mesh.Head.ParentName);
 }