Versions in this module Expand all Collapse all v0 v0.1.2 Aug 27, 2024 v0.1.0 Aug 27, 2024 Changes in this version + const PrefixFace + const PrefixGroup + const PrefixVertex + var ErrInvalidFace = errors.New("invalid face") + var ErrInvalidVertex = errors.New("invalid vertex") + var ErrNonManifold = errors.New("non-manifold mesh") + type AABB struct + Center Vector + HalfSize Vector + func NewAABB(center, halfSize Vector) AABB + func NewAABBFromBounds(minBound, maxBound Vector) AABB + func NewAABBFromVectors(vectors []Vector) AABB + func (a AABB) Buffer(s float64) AABB + func (a AABB) GetMaxBound() Vector + func (a AABB) GetMinBound() Vector + func (a AABB) IntersectsAABB(query AABB) bool + func (a AABB) Octant(octant int) AABB + type IntersectsAABB interface + IntersectsAABB func(AABB) bool + type IntersectsRay interface + IntersectsRay func(Ray) bool + type IntersectsTriangle interface + IntersectsTriangle func(Triangle) bool + type MeshReader interface + GetFace func(int) []int + GetFacePatch func(int) int + GetNumberOfFaceEdges func() int + GetNumberOfFaces func() int + GetNumberOfPatches func() int + GetNumberOfVertices func() int + GetPatch func(int) string + GetVertex func(int) Vector + Read func() error + type MeshWriter interface + SetFacePatches func([]int) + SetFaces func([][]int) + SetPatches func([]string) + SetVertices func([]Vector) + Write func() error + type OBJReader struct + func NewOBJReader(reader io.Reader) *OBJReader + func ReadOBJFromPath(path string) (*OBJReader, error) + func (r *OBJReader) GetFace(index int) []int + func (r *OBJReader) GetFacePatch(index int) int + func (r *OBJReader) GetNumberOfFaceEdges() int + func (r *OBJReader) GetNumberOfFaces() int + func (r *OBJReader) GetNumberOfPatches() int + func (r *OBJReader) GetNumberOfVertices() int + func (r *OBJReader) GetPatch(index int) string + func (r *OBJReader) GetVertex(index int) Vector + func (r *OBJReader) Read() error + type OBJWriter struct + func NewOBJWriter(writer io.Writer) *OBJWriter + func (w *OBJWriter) SetEdges(edges [][2]int) + func (w *OBJWriter) SetFacePatches(facePatches []int) + func (w *OBJWriter) SetFaces(faces [][]int) + func (w *OBJWriter) SetPatches(patches []string) + func (w *OBJWriter) SetVertices(vertices []Vector) + func (w *OBJWriter) Write() error + type Ray struct + Direction Vector + Origin Vector + func NewRay(origin, direction Vector) Ray + func (r Ray) IntersectsAABB(query AABB) bool + func (r Ray) IntersectsTriangle(query Triangle) bool + type Triangle struct + P Vector + Q Vector + R Vector + func NewTriangle(p, q, r Vector) Triangle + func (t Triangle) Area() float64 + func (t Triangle) IntersectsAABB(query AABB) bool + func (t Triangle) IntersectsRay(query Ray) bool + func (t Triangle) Normal() Vector + func (t Triangle) UnitNormal() Vector + type Vector [3]float64 + func NewVector(x, y, z float64) Vector + func NewVectorFromArray(values [3]float64) Vector + func (v Vector) Abs() Vector + func (v Vector) Add(w Vector) Vector + func (v Vector) AddScalar(s float64) Vector + func (v Vector) AngleTo(w Vector) float64 + func (v Vector) Cross(w Vector) Vector + func (v Vector) Div(w Vector) Vector + func (v Vector) DivScalar(s float64) Vector + func (v Vector) Dot(w Vector) float64 + func (v Vector) IntersectsAABB(query AABB) bool + func (v Vector) Inv() Vector + func (v Vector) Mag() float64 + func (v Vector) Mul(w Vector) Vector + func (v Vector) MulScalar(s float64) Vector + func (v Vector) Sub(w Vector) Vector + func (v Vector) SubScalar(s float64) Vector + func (v Vector) Unit() Vector