public static void DrawRect(GUILayer.SimpleRenderingContext context, Matrix4F xform, Color color) { GameEngine.DrawPrimitive(context, PrimitiveType.LineList, s_linesVertId, s_rectStartVertex, s_rectVertexCount, color, xform); }
public static void DrawPivot(GUILayer.SimpleRenderingContext context, Matrix4F xform, Color c) { GameEngine.DrawPrimitive(context, PrimitiveType.LineStrip, s_pivotVerts, 0, s_pivotVertexCount, c, xform); }
public static void DrawCircle(GUILayer.SimpleRenderingContext context, Matrix4F xform, Color color) { GameEngine.DrawPrimitive(context, PrimitiveType.LineStrip, s_circleVerts, 0, s_circleVertexCount, color, xform); }
public static void DrawRect(Matrix4F xform, Color color) { GameEngine.DrawPrimitive(PrimitiveType.LineList, s_linesVertId, s_rectStartVertex, s_rectVertexCount, color, xform); }
public static void DrawZ(GUILayer.SimpleRenderingContext context, Matrix4F xform, Color color) { GameEngine.DrawPrimitive(context, PrimitiveType.LineList, s_linesVertId, s_axisStartVertex + 4, 2, color, xform); }
public static void DrawUnitSquare(Matrix4F xform, Color color) { GameEngine.DrawPrimitive(PrimitiveType.LineList, s_linesVertId, s_unitSquareStartVertex, s_unitSquareVertexCount, color, xform); }
public static void DrawCircle(Matrix4F xform, Color color) { GameEngine.DrawPrimitive(PrimitiveType.LineStrip, s_circleVerts, 0, s_circleVertexCount, color, xform); }
public static void DrawPivot(Matrix4F xform, Color c) { GameEngine.DrawPrimitive(PrimitiveType.LineStrip, s_pivotVerts, 0, s_pivotVertexCount, c, xform); }
public static void DrawZ(Matrix4F xform, Color color) { GameEngine.DrawPrimitive(PrimitiveType.LineList, s_linesVertId, s_axisStartVertex + 4, 2, color, xform); }
//public static void DrawLine() public static void DrawAxis(Matrix4F xform, Color color) { GameEngine.DrawPrimitive(PrimitiveType.LineList, s_linesVertId, s_axisStartVertex, s_axisVertexCount, color, xform, RenderFlag ); }
public void Render(Camera cam) { GameEngine.SetRendererFlag(BasicRendererFlags.WireFrame); IGrid grid = this.As <IGrid>(); if (grid.Visible == false) { return; } float s = grid.Size; Matrix4F scale = new Matrix4F(); scale.Scale(new Vec3F(s, s, s)); Matrix4F gridXform = new Matrix4F(); if (cam.Frustum.IsOrtho) { float dist = cam.ViewMatrix.Translation.Z; ViewTypes vt = cam.ViewType; if (vt == ViewTypes.Top) { gridXform.Translation = new Vec3F(0, dist, 0); } else if (vt == ViewTypes.Bottom) { gridXform.Translation = new Vec3F(0, -dist, 0); } else if (vt == ViewTypes.Right) { gridXform.RotZ(MathHelper.PiOver2); gridXform.Translation = new Vec3F(dist, 0, 0); } else if (vt == ViewTypes.Left) { gridXform.RotZ(MathHelper.PiOver2); gridXform.Translation = new Vec3F(-dist, 0, 0); } else if (vt == ViewTypes.Front) { gridXform.RotX(MathHelper.PiOver2); gridXform.Translation = new Vec3F(0, 0, dist); } else if (vt == ViewTypes.Back) { gridXform.RotX(MathHelper.PiOver2); gridXform.Translation = new Vec3F(0, 0, -dist); } gridXform.Mul(scale, gridXform); } else { Matrix4F trans = new Matrix4F(); trans.Translation = new Vec3F(0, grid.Height, 0); gridXform = Matrix4F.Multiply(scale, trans); } GameEngine.DrawPrimitive(PrimitiveType.LineList, m_gridVBId, 0, m_gridVertexCount, Color.LightGray, gridXform); }