예제 #1
0
 public void AddMesh(Mesh mesh)
 {
     for (int index = 0; index < mesh.SubMeshes.Count; index++)
     {
         Mesh.SubMesh subMesh = mesh.SubMeshes[index];
         AddSubMesh(subMesh);
     }
 }
예제 #2
0
 public override void GetShadowCasters(BoundingFrustum frustum, List <Mesh.SubMesh> visibleSubMeshes)
 {
     for (int index = 0; index < _worldSubMeshes.Count; index++)
     {
         Mesh.SubMesh subMesh = _worldSubMeshes[index];
         if (subMesh.Enabled && subMesh.CastShadows &&
             frustum.Intersects(subMesh.GlobalBoundingSphere) &&
             frustum.Intersects(subMesh.GlobalBoundingBox))
         {
             visibleSubMeshes.Add(subMesh);
         }
     }
 }
예제 #3
0
 public override void GetVisibleMeshes(BoundingFrustum frustum, List <Mesh.SubMesh>[] visibleSubMeshes)
 {
     for (int index = 0; index < _worldSubMeshes.Count; index++)
     {
         Mesh.SubMesh subMesh = _worldSubMeshes[index];
         if (subMesh.Enabled &&
             frustum.Intersects(subMesh.GlobalBoundingSphere) &&
             frustum.Intersects(subMesh.GlobalBoundingBox))
         {
             visibleSubMeshes[(int)subMesh.RenderQueue].Add(subMesh);
         }
     }
 }
예제 #4
0
 public void GetShadowCasters(BoundingFrustum frustum, List <Mesh.SubMesh> visibleSubMeshes)
 {
     for (int index = 0; index < meshes.Count; index++)
     {
         Mesh m = meshes[index];
         if (m.GetCastShadows() && frustum.Intersects(m.GlobalBoundingBox))
         {
             for (int si = 0; si < m.SubMeshes.Count; si++)
             {
                 Mesh.SubMesh sm = m.SubMeshes[si];
                 if (sm.Enabled && sm.CastShadows)
                 {
                     visibleSubMeshes.Add(sm);
                 }
             }
         }
     }
 }
예제 #5
0
 public void GetVisibleMeshes(BoundingFrustum frustum, List <Mesh.SubMesh>[] visibleSubMeshes)
 {
     for (int index = 0; index < meshes.Count; index++)
     {
         Mesh m = meshes[index];
         if (frustum.Intersects(m.GlobalBoundingBox))
         {
             for (int si = 0; si < m.SubMeshes.Count; si++)
             {
                 Mesh.SubMesh sm = m.SubMeshes[si];
                 if (sm.Enabled)
                 {
                     visibleSubMeshes[(int)sm.RenderQueue].Add(sm);
                 }
             }
         }
     }
 }
예제 #6
0
 public void RemoveSubMesh(Mesh.SubMesh subMesh)
 {
     _worldSubMeshes.Remove(subMesh);
 }
예제 #7
0
 public void AddSubMesh(Mesh.SubMesh subMesh)
 {
     addSubMeshFunc(subMesh);
     _worldSubMeshes.Add(subMesh);
 }