Documentation
¶
Index ¶
- Constants
- func IndexType(size int) core1_0.IndexType
- func Max[V VertexFormat](vertices []V) vec3.T
- func Min[V VertexFormat](vertices []V) vec3.T
- type Args
- type CullMode
- type GeneratedMesh
- type IndexFormat
- type Mesh
- type MutableMesh
- func NewLines[T VertexFormat, K IndexFormat](key string, vertices []T, indices []K) MutableMesh[T, K]
- func NewMesh[V VertexFormat, I IndexFormat](key string, primitive Primitive, vertices []V, indices []I) MutableMesh[V, I]
- func NewTriangles[V VertexFormat, I IndexFormat](key string, vertices []V, indices []I) MutableMesh[V, I]
- type Pointer
- type Pointers
- type Primitive
- type Tag
- type Triangle
- type Vertex
- type VertexFormat
Constants ¶
View Source
const ( CullNone = CullMode(core1_0.CullModeFlags(0)) CullFront = CullMode(core1_0.CullModeFront) CullBack = CullMode(core1_0.CullModeBack) )
View Source
const ( Triangles Primitive = Primitive(core1_0.PrimitiveTopologyTriangleList) Lines = Primitive(core1_0.PrimitiveTopologyLineList) Points = Primitive(core1_0.PrimitiveTopologyPointList) )
Variables ¶
This section is empty.
Functions ¶
func Max ¶
func Max[V VertexFormat](vertices []V) vec3.T
func Min ¶
func Min[V VertexFormat](vertices []V) vec3.T
Types ¶
type CullMode ¶
type CullMode core1_0.CullModeFlags
type GeneratedMesh ¶
type GeneratedMesh[A Args, V VertexFormat, I IndexFormat] interface { Mesh Update(A) }
func NewGenerated ¶
func NewGenerated[A Args, V VertexFormat, I IndexFormat](key string, args A, generator func(A) (V, I)) GeneratedMesh[A, V, I]
type IndexFormat ¶
type Mesh ¶
type Mesh interface { Key() string Version() int Primitive() Primitive Pointers() Pointers VertexCount() int VertexData() any VertexSize() int IndexCount() int IndexData() any IndexSize() int Min() vec3.T Max() vec3.T // Bounds returns a bounding sphere containing the mesh, centered at the given origin. Bounds(vec3.T) shape.Sphere Positions() iter.Seq[vec3.T] Triangles() iter.Seq[Triangle] // Self-referential LoadMesh(fs.Filesystem) Mesh }
type MutableMesh ¶
type MutableMesh[V VertexFormat, I IndexFormat] interface { Mesh Vertices() []V Indices() []I Update(vertices []V, indices []I) }
func NewLines ¶
func NewLines[T VertexFormat, K IndexFormat](key string, vertices []T, indices []K) MutableMesh[T, K]
func NewMesh ¶
func NewMesh[V VertexFormat, I IndexFormat](key string, primitive Primitive, vertices []V, indices []I) MutableMesh[V, I]
func NewTriangles ¶
func NewTriangles[V VertexFormat, I IndexFormat](key string, vertices []V, indices []I) MutableMesh[V, I]
type Pointer ¶
type Pointers ¶
type Pointers []Pointer
func ParsePointers ¶
func ParsePointers(data interface{}) Pointers
func (Pointers) BufferString ¶
type Primitive ¶
type Primitive core1_0.PrimitiveTopology
type Vertex ¶
type Vertex struct { P vec3.T `vtx:"position,float,3"` N vec3.T `vtx:"normal,float,3"` T vec2.T `vtx:"tex,float,2"` C color.T `vtx:"color,float,4"` // contains filtered or unexported fields }
Standard vertex format
type VertexFormat ¶
Click to show internal directories.
Click to hide internal directories.