Documentation ¶
Overview ¶
Package geometry implements several primitive geometry generators.
Index ¶
- type Box
- type Circle
- type Cylinder
- type Geometry
- func (g *Geometry) AddGroup(start, count, matIndex int) *Group
- func (g *Geometry) AddGroupList(groups []Group)
- func (g *Geometry) AddVBO(vbo *gls.VBO)
- func (g *Geometry) ApplyMatrix(m *math32.Matrix4)
- func (g *Geometry) BoundingBox() math32.Box3
- func (g *Geometry) BoundingSphere() math32.Sphere
- func (g *Geometry) Dispose()
- func (g *Geometry) GetGeometry() *Geometry
- func (g *Geometry) GroupAt(idx int) *Group
- func (g *Geometry) GroupCount() int
- func (g *Geometry) Incref() *Geometry
- func (g *Geometry) Indices() math32.ArrayU32
- func (g *Geometry) Init()
- func (g *Geometry) Items() int
- func (g *Geometry) RenderSetup(gs *gls.GLS)
- func (g *Geometry) SetIndices(indices math32.ArrayU32)
- func (g *Geometry) VBO(attrib string) *gls.VBO
- type Group
- type IGeometry
- type Plane
- type Sphere
- type Torus
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Box ¶
type Circle ¶
func NewCircle ¶
NewCircle creates and returns a pointer to a new Circle geometry object. The geometry is defined by its radius, the number of segments (triangles), minimum = 3, the start angle in radians for the first segment (thetaStart) and the central angle in radians (thetaLength) of the circular sector.
type Cylinder ¶
type Geometry ¶
type Geometry struct {
// contains filtered or unexported fields
}
func NewGeometry ¶
func NewGeometry() *Geometry
func (*Geometry) AddGroupList ¶
AddGroupList adds the specified list of groups to this geometry
func (*Geometry) ApplyMatrix ¶
ApplyMatrix multiplies each of the geometry position vertices by the specified matrix and apply the correspondent normal transform matrix to the geometry normal vectors. The geometry's bounding box and sphere are recomputed if needed.
func (*Geometry) BoundingBox ¶
BoundingBox computes the bounding box of the geometry if necessary and returns is value
func (*Geometry) BoundingSphere ¶
BoundingSphere computes the bounding sphere of this geometry if necessary and returns its value.
func (*Geometry) Dispose ¶
func (g *Geometry) Dispose()
Dispose decrements this geometry reference count and if necessary releases OpenGL resources, C memory and VBOs associated with this geometry.
func (*Geometry) GetGeometry ¶
func (*Geometry) GroupCount ¶
GroupCount returns the number of geometry groups (for multimaterial)
func (*Geometry) Incref ¶
Incref increments the reference count for this geometry and returns a pointer to the geometry. It should be used when this geometry is shared by another Graphic object.
func (*Geometry) Items ¶
Returns the number of items in the first VBO (The number of items should be same for all VBOs) An item is a complete vertex position (3 floats) for example
func (*Geometry) RenderSetup ¶
RenderSetup is called by the renderer before drawing the geometry
func (*Geometry) SetIndices ¶
SetIndices sets the indices array for this geometry
type Group ¶
type Group struct { Start int // Index of first element of the group Count int // Number of elements in the group Matindex int // Material index for this group Matid string // Material id used when loading external models }
Geometry group object