MCPcopy Index your code
hub / github.com/g3n/engine / NewPoint

Function NewPoint

light/point.go:29–43  ·  view source on GitHub ↗

NewPoint creates and returns a point light with the specified color and intensity

(color *math32.Color, intensity float32)

Source from the content-addressed store, hash-verified

27
28// NewPoint creates and returns a point light with the specified color and intensity
29func NewPoint(color *math32.Color, intensity float32) *Point {
30
31 lp := new(Point)
32 lp.Node.Init(lp)
33 lp.color = *color
34 lp.intensity = intensity
35
36 // Creates uniform and sets initial values
37 lp.uni.Init("PointLight")
38 lp.SetColor(color)
39 lp.SetIntensity(intensity)
40 lp.SetLinearDecay(1.0)
41 lp.SetQuadraticDecay(1.0)
42 return lp
43}
44
45// SetColor sets the color of this light
46func (lp *Point) SetColor(color *math32.Color) {

Callers

nothing calls this directly

Calls 5

InitMethod · 0.45
SetColorMethod · 0.45
SetIntensityMethod · 0.45
SetLinearDecayMethod · 0.45
SetQuadraticDecayMethod · 0.45

Tested by

no test coverage detected