Ejemplo n.º 1
0
 public static void Draw(Matrix View, Matrix Projection, Vector3 camPos)
 {
     for (int i = 0; i < listWater.Count; i++)
     {
         listWater[i].Draw(View, Projection, camPos);
         if (selectedWater == i)
         {
             CSimpleShapes.AddBoundingBox(listWater[i].RealBoundingBox, Color.Black);
         }
     }
 }
Ejemplo n.º 2
0
        public static void Draw(CCamera cam, GameTime gameTime)
        {
            //renderer.ShadowLightPosition = CLightsManager.lights[0].Position;
            //renderer.ShadowLightTarget = new Vector3(renderer.ShadowLightTarget.X, renderer.ShadowLightTarget.Y - 0.1f, renderer.ShadowLightTarget.Z);
            foreach (CModel model in modelsList)
            {
                if (cam.BoundingVolumeIsInView(model.BoundingSphere))
                {
                    model.Draw(cam._view, cam._projection, cam._cameraPos);

                    if (selectModelId != -1 && modelsList[selectModelId] == model)
                    {
                        CSimpleShapes.AddBoundingBox(modelsList[selectModelId]._boundingBox, Color.Black);
                    }

                    if (DebugActivated)
                    {
                        Matrix worldMatrix = model.GetModelMatrix();
                        foreach (Triangle tri in model._trianglesPositions)
                        {
                            Triangle realTri = tri.NewByMatrix(worldMatrix);
                            CSimpleShapes.AddTriangle(realTri.V0, realTri.V1, realTri.V2, Color.Black);
                        }
                    }
                }
            }

            /*for (int i = 0; i < cam._physicsMap._triangleList.Count; i++) // Debug triangles collision
             *  CSimpleShapes.AddTriangle(cam._physicsMap._triangleList[i].V0, cam._physicsMap._triangleList[i].V1, cam._physicsMap._triangleList[i].V2, Color.Blue);
             * for (int i = 0; i < cam._physicsMap._triangleNormalsList.Count; i++) // Debug triangles collision
             *  CSimpleShapes.AddLine(cam._physicsMap._triangleNormalsList[i], cam._physicsMap._triangleNormalsList[i] * 2, Color.Red);*/

            /*Matrix modelMatrix = modelsList[0].GetModelMatrix();
             * for (int i = 0; i < modelsList[0]._trianglesPositions.Count; i++)
             *  CSimpleShapes.AddTriangle(Vector3.Transform(modelsList[0]._trianglesPositions[i].V0, modelMatrix),
             *      Vector3.Transform(modelsList[0]._trianglesPositions[i].V1, modelMatrix),
             *      Vector3.Transform(modelsList[0]._trianglesPositions[i].V2, modelMatrix), Color.Red);*/
        }