Esempio n. 1
0
 public void SetNewWorldTranslation(ref Vector3 translation, bool applyToAllMeshes)
 {
     _world.Translation = translation;
     if (applyToAllMeshes)
     {
         for (int i = 0; i < _meshes.Length; i++)
         {
             var mesh = _meshes[i];
             mesh.SetNewWorldTranslation(ref translation);
             _meshesBVH[i] = new MeshBVH <T>(mesh, ref _world);
         }
     }
 }
Esempio n. 2
0
 public void SetNewWorldTransformation(ref Matrix4x4 world, bool applyToAllMeshes)
 {
     _world = world;
     if (applyToAllMeshes)
     {
         for (int i = 0; i < _meshes.Length; i++)
         {
             var mesh = _meshes[i];
             mesh.SetNewWorldTransformation(ref world);
             _meshesBVH[i] = new MeshBVH <T>(mesh, ref world);
         }
     }
 }
Esempio n. 3
0
        public Model(string directoy, Mesh <T> meshIn, U material)
        {
            IsCulled = false;
            BaseDir  = directoy;

            _meshes    = new Mesh <T> [1];
            _meshes[0] = meshIn;

            _meshesBVH    = new MeshBVH <T> [1];
            _meshesBVH[0] = new MeshBVH <T>(meshIn);

            _materials    = new U[1];
            _materials[0] = material;
        }
Esempio n. 4
0
        public Model(Mesh <T>[] meshesIn, U[] materials)
        {
            IsCulled = false;
            BaseDir  = string.Empty;

            _meshes = new Mesh <T> [meshesIn.Length];
            for (int i = 0; i < meshesIn.Length; i++)
            {
                _meshes[i] = meshesIn[i];
            }

            _meshesBVH = new MeshBVH <T> [meshesIn.Length];
            for (int i = 0; i < meshesIn.Length; i++)
            {
                _meshesBVH[i] = new MeshBVH <T>(meshesIn[i]);
            }
            _materials = materials;
        }
Esempio n. 5
0
        public Model(string directory, Mesh <T>[] meshes, U[] materials)
        {
            IsCulled = false;
            BaseDir  = directory;

            _meshes = new Mesh <T> [meshes.Length];
            for (int i = 0; i < meshes.Length; i++)
            {
                _meshes[i] = meshes[i];
            }

            _meshesBVH = new MeshBVH <T> [meshes.Length];
            for (int i = 0; i < meshes.Length; i++)
            {
                _meshesBVH[i] = new MeshBVH <T>(meshes[i]);
            }
            _materials = materials;
        }
Esempio n. 6
0
 public void SetMeshBVH(int index, MeshBVH <T> meshBVH)
 {
     _meshesBVH[index] = meshBVH;
 }