MCPcopy
hub / github.com/g3n/engine / Init

Method Init

graphic/mesh.go:35–49  ·  view source on GitHub ↗

Init initializes the Mesh and its uniforms.

(igeom geometry.IGeometry, imat material.IMaterial)

Source from the content-addressed store, hash-verified

33
34// Init initializes the Mesh and its uniforms.
35func (m *Mesh) Init(igeom geometry.IGeometry, imat material.IMaterial) {
36
37 m.Graphic.Init(m, igeom, gls.TRIANGLES)
38
39 // Initialize uniforms
40 m.uniMm.Init("ModelMatrix")
41 m.uniMVm.Init("ModelViewMatrix")
42 m.uniMVPm.Init("MVP")
43 m.uniNm.Init("NormalMatrix")
44
45 // Adds single material if not nil
46 if imat != nil {
47 m.AddMaterial(imat, 0, 0)
48 }
49}
50
51// SetMaterial clears all materials and adds the specified material for all vertices.
52func (m *Mesh) SetMaterial(imat material.IMaterial) {

Callers 7

NewLineStripFunction · 0.45
NewSpriteFunction · 0.45
NewRiggedMeshFunction · 0.45
NewMeshFunction · 0.45
CloneMethod · 0.45
NewPointsFunction · 0.45
NewSkyboxFunction · 0.45

Calls 1

AddMaterialMethod · 0.95

Tested by

no test coverage detected