engine: github.com/g3n/engine/light Index | Files

package light

import "github.com/g3n/engine/light"

Package light contains common light types which can be add to a 3D scene to illuminate it.

Index

Package Files

ambient.go directional.go doc.go ilight.go logger.go point.go spot.go

type Ambient Uses

type Ambient struct {
    core.Node // Embedded node
    // contains filtered or unexported fields
}

Ambient represents an ambient light

func NewAmbient Uses

func NewAmbient(color *math32.Color, intensity float32) *Ambient

NewAmbient returns a pointer to a new ambient color with the specified color and intensity

func (*Ambient) Color Uses

func (la *Ambient) Color() math32.Color

Color returns the current color of this light

func (*Ambient) Intensity Uses

func (la *Ambient) Intensity() float32

Intensity returns the current intensity of this light

func (*Ambient) RenderSetup Uses

func (la *Ambient) RenderSetup(gs *gls.GLS, rinfo *core.RenderInfo, idx int)

RenderSetup is called by the engine before rendering the scene

func (*Ambient) SetColor Uses

func (la *Ambient) SetColor(color *math32.Color)

SetColor sets the color of this light

func (*Ambient) SetIntensity Uses

func (la *Ambient) SetIntensity(intensity float32)

SetIntensity sets the intensity of this light

type Directional Uses

type Directional struct {
    core.Node // Embedded node
    // contains filtered or unexported fields
}

Directional represents a directional, positionless light

func NewDirectional Uses

func NewDirectional(color *math32.Color, intensity float32) *Directional

NewDirectional creates and returns a pointer of a new directional light the specified color and intensity.

func (*Directional) Color Uses

func (ld *Directional) Color() math32.Color

Color returns the current color of this light

func (*Directional) Intensity Uses

func (ld *Directional) Intensity() float32

Intensity returns the current intensity of this light

func (*Directional) RenderSetup Uses

func (ld *Directional) RenderSetup(gs *gls.GLS, rinfo *core.RenderInfo, idx int)

RenderSetup is called by the engine before rendering the scene

func (*Directional) SetColor Uses

func (ld *Directional) SetColor(color *math32.Color)

SetColor sets the color of this light

func (*Directional) SetIntensity Uses

func (ld *Directional) SetIntensity(intensity float32)

SetIntensity sets the intensity of this light

type ILight Uses

type ILight interface {
    RenderSetup(gs *gls.GLS, rinfo *core.RenderInfo, idx int)
}

ILight is the interface that must be implemented for all light types.

type Point Uses

type Point struct {
    core.Node // Embedded node
    // contains filtered or unexported fields
}

Point is an omnidirectional light source

func NewPoint Uses

func NewPoint(color *math32.Color, intensity float32) *Point

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

func (*Point) Color Uses

func (lp *Point) Color() math32.Color

Color returns the current color of this light

func (*Point) Intensity Uses

func (lp *Point) Intensity() float32

Intensity returns the current intensity of this light

func (*Point) LinearDecay Uses

func (lp *Point) LinearDecay() float32

LinearDecay returns the current linear decay factor

func (*Point) QuadraticDecay Uses

func (lp *Point) QuadraticDecay() float32

QuadraticDecay returns the current quadratic decay factor

func (*Point) RenderSetup Uses

func (lp *Point) RenderSetup(gs *gls.GLS, rinfo *core.RenderInfo, idx int)

RenderSetup is called by the engine before rendering the scene

func (*Point) SetColor Uses

func (lp *Point) SetColor(color *math32.Color)

SetColor sets the color of this light

func (*Point) SetIntensity Uses

func (lp *Point) SetIntensity(intensity float32)

SetIntensity sets the intensity of this light

func (*Point) SetLinearDecay Uses

func (lp *Point) SetLinearDecay(decay float32)

SetLinearDecay sets the linear decay factor as a function of the distance

func (*Point) SetQuadraticDecay Uses

func (lp *Point) SetQuadraticDecay(decay float32)

SetQuadraticDecay sets the quadratic decay factor as a function of the distance

type Spot Uses

type Spot struct {
    core.Node // Embedded node
    // contains filtered or unexported fields
}

Spot represents a spotlight

func NewSpot Uses

func NewSpot(color *math32.Color, intensity float32) *Spot

NewSpot creates and returns a spot light with the specified color and intensity

func (*Spot) AngularDecay Uses

func (l *Spot) AngularDecay() float32

AngularDecay returns the current angular decay exponent

func (*Spot) Color Uses

func (l *Spot) Color() math32.Color

Color returns the current color of this light

func (*Spot) CutoffAngle Uses

func (l *Spot) CutoffAngle() float32

CutoffAngle returns the current cutoff angle in degrees from 0 to 90

func (*Spot) Intensity Uses

func (l *Spot) Intensity() float32

Intensity returns the current intensity of this light

func (*Spot) LinearDecay Uses

func (l *Spot) LinearDecay() float32

LinearDecay returns the current linear decay factor

func (*Spot) QuadraticDecay Uses

func (l *Spot) QuadraticDecay() float32

QuadraticDecay returns the current quadratic decay factor

func (*Spot) RenderSetup Uses

func (l *Spot) RenderSetup(gs *gls.GLS, rinfo *core.RenderInfo, idx int)

RenderSetup is called by the engine before rendering the scene

func (*Spot) SetAngularDecay Uses

func (l *Spot) SetAngularDecay(decay float32)

SetAngularDecay sets the angular decay exponent

func (*Spot) SetColor Uses

func (l *Spot) SetColor(color *math32.Color)

SetColor sets the color of this light

func (*Spot) SetCutoffAngle Uses

func (l *Spot) SetCutoffAngle(angle float32)

SetCutoffAngle sets the cutoff angle in degrees from 0 to 90

func (*Spot) SetIntensity Uses

func (l *Spot) SetIntensity(intensity float32)

SetIntensity sets the intensity of this light

func (*Spot) SetLinearDecay Uses

func (l *Spot) SetLinearDecay(decay float32)

SetLinearDecay sets the linear decay factor as a function of the distance

func (*Spot) SetQuadraticDecay Uses

func (l *Spot) SetQuadraticDecay(decay float32)

SetQuadraticDecay sets the quadratic decay factor as a function of the distance

Package light imports 5 packages (graph) and is imported by 16 packages. Updated 2018-06-11. Refresh now. Tools for package owners.