14 TriangleIndices.Count += count3;
15 for (
int i = 0; i < count3; i++) {
32 foreach (
Vector3 point
in points) {
61 LineIndices.Count += count3;
62 for (
int i = 0; i < count3; i++) {
79 foreach (
Vector3 point
in points) {
90 public void QueueLines(IEnumerable<VertexPositionColor> vertices) {
117 bool notFirst =
false;
118 foreach (
Vector2 point
in points) {
130 bool notFirst =
false;
162 float startAngle = 0f,
163 float endAngle = (
float)Math.PI * 2f) {
165 for (
int i = 0; i <= sides; i++) {
166 float x =
MathUtils.
Lerp(startAngle, endAngle, i / (
float)sides);
167 Vector2 vector = center + radius *
new Vector2(MathF.Sin(x), 0f - MathF.Cos(x));
180 float startAngle = 0f,
181 float endAngle = (
float)Math.PI * 2f) {
183 for (
int i = 0; i <= sides; i++) {
184 float x =
MathUtils.
Lerp(startAngle, endAngle, i / (
float)sides);
185 Vector2 vector = center + radius *
new Vector2(MathF.Sin(x), 0f - MathF.Cos(x));
200 float startAngle = 0f,
201 float endAngle = (
float)Math.PI * 2f) {
204 for (
int i = 0; i <= sides; i++) {
205 float x =
MathUtils.
Lerp(startAngle, endAngle, i / (
float)sides);
206 Vector2 v =
new(MathF.Sin(x), 0f - MathF.Cos(x));
207 Vector2 vector = center + outerRadius * v;
208 Vector2 vector2 = center + innerRadius * v;
276 TriangleVertices.Count += 4;
282 TriangleIndices.Count += 6;
301 TriangleVertices.Count += 4;
307 TriangleIndices.Count += 6;
316 public void Flush(
bool clearAfterFlush =
true) {
readonly DynamicArray< int > LineIndices
readonly DynamicArray< int > TriangleIndices
void TransformLines(Matrix matrix, int start=0, int end=-1)
readonly DynamicArray< VertexPositionColor > TriangleVertices
void TransformTrianglesColors(Color color, int start=0, int end=-1)
void TransformLinesColors(Color color, int start=0, int end=-1)
readonly DynamicArray< VertexPositionColor > LineVertices
void TransformTriangles(Matrix matrix, int start=0, int end=-1)
static readonly BlendState AlphaBlend
static readonly DepthStencilState None
void QueueQuad(Vector2 corner1, Vector2 corner2, float depth, Color color)
void QueueQuad(Vector2 p1, Vector2 p2, Vector2 p3, Vector2 p4, float depth, Color color1, Color color2, Color color3, Color color4)
void QueueDisc(Vector2 center, Vector2 outerRadius, Vector2 innerRadius, float depth, Color outerColor, Color innerColor, int sides=32, float startAngle=0f, float endAngle=(float) Math.PI *2f)
void QueueQuad(Vector2 p1, Vector2 p2, Vector2 p3, Vector2 p4, float depth, Color color)
void QueueEllipse(Vector2 center, Vector2 radius, float depth, Color color, int sides=32, float startAngle=0f, float endAngle=(float) Math.PI *2f)
void QueueLine(Vector2 p1, Vector2 p2, float depth, Color color)
void QueueBatchTriangles(FlatBatch2D batch, Matrix? matrix=null, Color? color=null)
void Flush(bool clearAfterFlush=true)
void QueueBatchLines(FlatBatch2D batch, Matrix? matrix=null, Color? color=null)
void QueueTriangle(Vector2 p1, Vector2 p2, Vector2 p3, float depth, Color color)
void QueueDisc(Vector2 center, Vector2 radius, float depth, Color color, int sides=32, float startAngle=0f, float endAngle=(float) Math.PI *2f)
void QueueTriangles(IEnumerable< VertexPositionColor > vertices)
每三个顶点为一个三角形,请确保输入的顶点数量为 3 的倍数
void QueueLineStrip(IEnumerable< VertexPositionColor > vertices)
void QueueLineStrip(IEnumerable< Vector2 > points, float depth, Color color)
void QueueTriangle(Vector2 p1, Vector2 p2, Vector2 p3, float depth, Color color1, Color color2, Color color3)
void QueueLines(IEnumerable< Vector3 > points, Color color)
每两个顶点为一个线段,请确保输入的顶点数量为 2 的倍数
void QueueLines(IEnumerable< VertexPositionColor > vertices)
每两个顶点为一个线段,请确保输入的顶点数量为 2 的倍数
void QueueTriangles(IEnumerable< Vector3 > points, Color color)
每三个顶点为一个三角形,请确保输入的顶点数量为 3 的倍数
void QueueRectangle(Vector2 corner1, Vector2 corner2, float depth, Color color)
void QueueBatch(FlatBatch2D batch, Matrix? matrix=null, Color? color=null)
static Matrix ViewportMatrix()
static readonly RasterizerState CullNoneScissor
static float Lerp(float x1, float x2, float f)
static readonly Matrix Identity
static readonly Vector2 Zero