public LdrBuilder Mesh(string name, Colour32 colour, IList <v4>?verts, IList <v4>?normals = null, IList <Colour32>?colours = null, IList <v2>?tex = null, IList <ushort>?faces = null, IList <ushort>?lines = null, IList <ushort>?tetra = null, bool generate_normals = false, v4?position = null) { Append("*Mesh ", name, " ", colour, " {\n"); if (verts != null) { Append("*Verts {").Append(verts.Select(x => Ldr.Vec3(x))).Append("}\n"); } if (normals != null) { Append("*Normals {").Append(normals.Select(x => Ldr.Vec3(x))).Append("}\n"); } if (colours != null) { Append("*Colours {").Append(colours.Select(x => Ldr.Colour(x))).Append("}\n"); } if (tex != null) { Append("*TexCoords {").Append(tex.Select(x => Ldr.Vec2(x))).Append("}\n"); } if (verts != null && faces != null) { Debug.Assert(faces.All(i => i >= 0 && i < verts.Count)); Append("*Faces {").Append(faces).Append("}\n"); } if (verts != null && lines != null) { Debug.Assert(lines.All(i => i >= 0 && i < verts.Count)); Append("*Lines {").Append(lines).Append("}\n"); } if (verts != null && tetra != null) { Debug.Assert(tetra.All(i => i >= 0 && i < verts.Count)); Append("*Tetra {").Append(tetra).Append("}\n"); } if (generate_normals) { Append("*GenerateNormals\n"); } if (position != null) { Append(Ldr.Position(position.Value)); } Append("}\n"); return(this); }
public LdrBuilder Axis(string name, Colour32 colour, m4x4 basis, float scale) { return(Append("*Matrix3x3 ", name, " ", colour, " {", basis.x * scale, " ", basis.y * scale, " ", basis.z * scale, " ", Ldr.Position(basis.pos), "}\n")); }
public LdrBuilder Rect(string name, Colour32 colour, AxisId axis_id, float width, float height, bool solid, float corner_radius, v4 position) { return(Append("*Rect ", name, " ", colour, " {", width, " ", height, " ", axis_id, " ", Ldr.Solid(solid), " ", Ldr.CornerRadius(corner_radius), " ", Ldr.Position(position), "}\n")); }
public LdrBuilder Quad(string name, Colour32 colour, v4 tl, v4 tr, v4 br, v4 bl, v4 position) { return(Append("*Quad ", name, " ", colour, " {", bl, " ", br, " ", tr, " ", tl, " ", Ldr.Position(position), "}\n")); }
public LdrBuilder Ellipse(string name, Colour32 colour, AxisId axis_id, bool solid, float radiusx, float radiusy, v4 position) { return(Append("*Circle ", name, " ", colour, " {", radiusx, " ", radiusy, " ", axis_id, " ", Ldr.Solid(solid), " ", Ldr.Position(position), "}\n")); }
public LdrBuilder Pie(string name, Colour32 colour, AxisId axis_id, bool solid, float ang0, float ang1, float rad0, float rad1, float sx, float sy, int facets, v4 position) { return(Append("*Pie ", name, " ", colour, " {", ang0, " ", ang1, " ", rad0, " ", rad1, " ", axis_id, " ", Ldr.Solid(solid), " ", Ldr.Facets(facets), " *Scale ", sx, " ", sy, " ", Ldr.Position(position), "}\n")); }
public LdrBuilder Grid(string name, Colour32 colour, AxisId axis_id, int width, int height, int wdiv, int hdiv, v4 position) { return(Append("*Grid ", name, " ", colour, " {", width, " ", height, " ", wdiv, " ", hdiv, " ", axis_id, " ", Ldr.Position(position), "}\n")); }
public LdrBuilder Sphere(string name, Colour32 colour, float radius, v4 position) { return(Append("*Sphere ", name, " ", colour, " {", radius, " ", Ldr.Position(position), "}\n")); }
public void Axis(string name, Colour32 colour, m4x4 basis, float scale) { Append("*Matrix3x3 ", name, " ", colour, " {", basis.x * scale, " ", basis.y * scale, " ", basis.z * scale, " ", Ldr.Position(basis.pos), "}\n"); }
public void Quad(string name, Colour32 colour, v4 tl, v4 tr, v4 br, v4 bl, v4 position) { Append("*Quad ", name, " ", colour, " {", bl, " ", br, " ", tr, " ", tl, " ", Ldr.Position(position), "}\n"); }
public void Rect(string name, Colour32 colour, AxisId axis_id, float width, float height, bool solid, v4 position) { Append("*Rect ", name, " ", colour, " {", width, " ", height, " ", axis_id, " ", Ldr.Solid(solid), " ", Ldr.Position(position), "}\n"); }
public void Circle(string name, Colour32 colour, AxisId axis_id, bool solid, float radius, v4 position) { Append("*Circle ", name, " ", colour, " {", radius, " ", axis_id, " ", Ldr.Solid(solid), " ", Ldr.Position(position), "}\n"); }
public void Sphere(string name, Colour32 colour, float radius, v4 position) { Append("*Sphere ", name, " ", colour, " {", radius, " ", Ldr.Position(position), "}\n"); }