light

package
v0.0.0-...-c2c5ea0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 28, 2017 License: BSD-2-Clause Imports: 4 Imported by: 0

Documentation

Overview

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

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Ambient

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

func NewAmbient

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

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

Color returns the current color of this light

func (*Ambient) Intensity

func (la *Ambient) Intensity() float32

Intensity returns the current intensity of this light

func (*Ambient) RenderSetup

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

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

SetColor sets the color of this light

func (*Ambient) SetIntensity

func (la *Ambient) SetIntensity(intensity float32)

SetIntensity sets the intensity of this light

type Directional

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

func NewDirectional

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

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

Color returns the current color of this light

func (*Directional) Intensity

func (ld *Directional) Intensity() float32

Intensity returns the current intensity of this light

func (*Directional) RenderSetup

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

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

SetColor sets the color of this light

func (*Directional) SetIntensity

func (ld *Directional) SetIntensity(intensity float32)

SetIntensity sets the intensity of this light

type ILight

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

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

func NewPoint

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

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

func (*Point) Color

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

Color returns the current color of this light

func (*Point) Intensity

func (lp *Point) Intensity() float32

Intensity returns the current intensity of this light

func (*Point) LinearDecay

func (lp *Point) LinearDecay() float32

LinearDecay returns the current linear decay factor

func (*Point) QuadraticDecay

func (lp *Point) QuadraticDecay() float32

QuadraticDecay returns the current quadratic decay factor

func (*Point) RenderSetup

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

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

SetColor sets the color of this light

func (*Point) SetIntensity

func (lp *Point) SetIntensity(intensity float32)

SetIntensity sets the intensity of this light

func (*Point) SetLinearDecay

func (lp *Point) SetLinearDecay(decay float32)

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

func (*Point) SetQuadraticDecay

func (lp *Point) SetQuadraticDecay(decay float32)

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

type Spot

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

func NewSpot

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

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

func (*Spot) AngularDecay

func (sl *Spot) AngularDecay() float32

AngularDecay returns the current angular decay exponent

func (*Spot) Color

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

Color returns the current color of this light

func (*Spot) CutoffAngle

func (sl *Spot) CutoffAngle() float32

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

func (*Spot) Direction

func (sp *Spot) Direction(direction *math32.Vector3) math32.Vector3

Direction returns the current direction of this spot light in world coordinates

func (*Spot) Intensity

func (sl *Spot) Intensity() float32

Intensity returns the current intensity of this light

func (*Spot) LinearDecay

func (sl *Spot) LinearDecay() float32

LinearDecay returns the current linear decay factor

func (*Spot) QuadraticDecay

func (sl *Spot) QuadraticDecay() float32

QuadraticDecay returns the current quadratic decay factor

func (*Spot) RenderSetup

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

RenderSetup is called by the engine before rendering the scene

func (*Spot) SetAngularDecay

func (sl *Spot) SetAngularDecay(decay float32)

SetAngularDecay sets the angular decay exponent

func (*Spot) SetColor

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

SetColor sets the color of this light

func (*Spot) SetCutoffAngle

func (sl *Spot) SetCutoffAngle(angle float32)

SetCutoffAngle sets the cutoff angle in degrees from 0 to 90

func (*Spot) SetDirection

func (sp *Spot) SetDirection(direction *math32.Vector3)

SetDirection sets the direction of the spot light in world coordinates

func (*Spot) SetIntensity

func (sl *Spot) SetIntensity(intensity float32)

SetIntensity sets the intensity of this light

func (*Spot) SetLinearDecay

func (sl *Spot) SetLinearDecay(decay float32)

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

func (*Spot) SetQuadraticDecay

func (sl *Spot) SetQuadraticDecay(decay float32)

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL