|
|
@ -6,13 +6,15 @@ namespace SemiColinGames { |
|
|
|
class LinesOfSight : IDisposable { |
|
|
|
|
|
|
|
const int numEdgeVertices = 60; |
|
|
|
|
|
|
|
readonly VertexBuffer vertexBuffer; |
|
|
|
readonly IndexBuffer indexBuffer; |
|
|
|
// coneVertices[0] is the eye position; the rest are the edge vertices.
|
|
|
|
VertexPositionColor[] coneVertices = new VertexPositionColor[numEdgeVertices + 1]; |
|
|
|
Color color = Color.FromNonPremultiplied(new Vector4(0, 0, 1, 0.6f)); |
|
|
|
readonly VertexPositionColor[] coneVertices = new VertexPositionColor[numEdgeVertices + 1]; |
|
|
|
// The number of total triangles drawn is one less than the number of edge points.
|
|
|
|
int[] indices = new int[(numEdgeVertices - 1) * 3]; |
|
|
|
VertexBuffer vertexBuffer; |
|
|
|
IndexBuffer indexBuffer; |
|
|
|
readonly int[] indices = new int[(numEdgeVertices - 1) * 3]; |
|
|
|
|
|
|
|
Color color = Color.FromNonPremultiplied(new Vector4(0, 0, 1, 0.6f)); |
|
|
|
|
|
|
|
public LinesOfSight(GraphicsDevice graphics) { |
|
|
|
vertexBuffer = new VertexBuffer( |
|
|
@ -72,8 +74,7 @@ namespace SemiColinGames { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
public void Draw(Player player, AABB[] collisionTargets, GraphicsDevice graphics, |
|
|
|
BasicEffect lightingEffect) { |
|
|
|
public void Draw(GraphicsDevice graphics, BasicEffect lightingEffect) { |
|
|
|
|
|
|
|
for (int i = 0; i < numEdgeVertices - 1; i++) { |
|
|
|
indices[i * 3] = 0; |
|
|
|