core

package
v0.0.0-...-392c9ed Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2019 License: BSD-3-Clause Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Project

func Project(vec *math.Vector3, camera *Camera)

func UnProject

func UnProject(vec *math.Vector3, camera *Camera)

Types

type Camera

type Camera struct {
	Object3
	// contains filtered or unexported fields
}

func NewCamera

func NewCamera() *Camera

func (*Camera) Clone

func (camera *Camera) Clone() *Camera

func (*Camera) Copy

func (camera *Camera) Copy(source *Camera, recursive bool)

func (*Camera) GetMatrixWorldInverse

func (camera *Camera) GetMatrixWorldInverse() *math.Matrix4

func (*Camera) GetProjectionMatrix

func (camera *Camera) GetProjectionMatrix() *math.Matrix4

func (*Camera) GetProjectionMatrixInverse

func (camera *Camera) GetProjectionMatrixInverse() *math.Matrix4

func (*Camera) GetWorldDirection

func (camera *Camera) GetWorldDirection(target *math.Vector3) *math.Vector3

func (*Camera) IsCamera

func (camera *Camera) IsCamera() bool

func (*Camera) UpdateMatrixWorld

func (camera *Camera) UpdateMatrixWorld(force bool)

type CameraObject

type CameraObject interface {
	IsCamera() bool
}

type Face3

type Face3 struct {
	A             math.Vector3
	B             math.Vector3
	C             math.Vector3
	Normal        math.Vector3
	VertexNormals [3]math.Vector3
	Color         math.Color
	MaterialIndex uint
}

func NewDefaultFace3

func NewDefaultFace3(a, b, c *math.Vector3) *Face3

func NewFace3

func NewFace3(a, b, c, normal *math.Vector3, color math.Color, materialIndex uint) *Face3

func (*Face3) Clone

func (face *Face3) Clone() *Face3

func (*Face3) Copy

func (face *Face3) Copy(f *Face3)

type Geometry

type Geometry struct {
	IGeometry
	// contains filtered or unexported fields
}

The basic geometry

func (*Geometry) ApplyMatrix

func (geo *Geometry) ApplyMatrix(matrix *math.Matrix4)

func (*Geometry) Center

func (geo *Geometry) Center()

func (*Geometry) GetBoundingBox

func (geo *Geometry) GetBoundingBox() *math.Box3

func (*Geometry) GetBoundingSphere

func (geo *Geometry) GetBoundingSphere() *math.Sphere

func (*Geometry) LookAt

func (geo *Geometry) LookAt(vector *math.Vector3)

func (*Geometry) Normalize

func (geo *Geometry) Normalize()

func (*Geometry) RotateX

func (geo *Geometry) RotateX(angle math.Angle)

func (*Geometry) RotateY

func (geo *Geometry) RotateY(angle math.Angle)

func (*Geometry) RotateZ

func (geo *Geometry) RotateZ(angle math.Angle)

func (*Geometry) Scale

func (geo *Geometry) Scale(x, y, z float32)

func (*Geometry) Translate

func (geo *Geometry) Translate(x, y, z float32)

func (*Geometry) TranslateVector3

func (geo *Geometry) TranslateVector3(v *math.Vector3)

type IGeometry

type IGeometry interface {
	ApplyMatrix(m *math.Matrix4)
	RotateX(a math.Angle)
	RotateY(a math.Angle)
	RotateZ(a math.Angle)
	Translate(x, y, z float32)
	Scale(x, y, z float32)
	LookAt(v *math.Vector3)
	Center()
	Normalize()
}

type Id

type Id uint

type IdGenerator

type IdGenerator struct {
	// contains filtered or unexported fields
}

func (*IdGenerator) Next

func (id *IdGenerator) Next() Id

type Intersection

type Intersection struct {
	// contains filtered or unexported fields
}

type Layers

type Layers struct {
	// contains filtered or unexported fields
}

func (*Layers) Disable

func (layers *Layers) Disable(channel int)

func (*Layers) Enable

func (layers *Layers) Enable(channel int)

func (*Layers) Set

func (layers *Layers) Set(channel int)

func (*Layers) Test

func (layers *Layers) Test(channel int) bool

func (*Layers) Toggle

func (layers *Layers) Toggle(channel int)

type Light

type Light struct {
	Object3
	// contains filtered or unexported fields
}

func NewLight

func NewLight(color math.Color, intensity float32) *Light

func (*Light) GetColor

func (light *Light) GetColor() *math.Color

func (*Light) GetIntensity

func (light *Light) GetIntensity() float32

type Material

type Material struct {
	Object3

	Fog    bool
	Lights bool
	// contains filtered or unexported fields
}

func NewMaterial

func NewMaterial() *Material

func (*Material) Clone

func (mat *Material) Clone() *Material

func (*Material) Copy

func (mat *Material) Copy(source *Material)

type Object3

type Object3 struct {
	Name string

	Position math.Vector3
	Rotation math.Euler

	Scale math.Vector3

	Visible bool

	RenderOrder uint
	// contains filtered or unexported fields
}

func NewObject

func NewObject() *Object3

func (*Object3) Add

func (obj *Object3) Add(object *Object3)

func (*Object3) AddAll

func (obj *Object3) AddAll(objects []*Object3)

func (*Object3) ApplyMatrix

func (obj *Object3) ApplyMatrix(matrix *math.Matrix4)

func (*Object3) ApplyQuaternion

func (obj *Object3) ApplyQuaternion(q *math.Quaternion)

func (*Object3) Clone

func (obj *Object3) Clone(recursive bool) *Object3

func (*Object3) Copy

func (obj *Object3) Copy(source *Object3, recursive bool)

Recursive = TRUE by default

func (*Object3) CopyWorldDirection

func (obj *Object3) CopyWorldDirection(target *math.Vector3)

func (*Object3) CopyWorldPosition

func (obj *Object3) CopyWorldPosition(target *math.Vector3)

func (*Object3) CopyWorldQuaternion

func (obj *Object3) CopyWorldQuaternion(target *math.Quaternion)

func (*Object3) CopyWorldScale

func (obj *Object3) CopyWorldScale(target *math.Vector3)

func (*Object3) GetChildren

func (obj *Object3) GetChildren() []*Object3

func (*Object3) GetChildrenById

func (obj *Object3) GetChildrenById(id Id) *Object3

func (*Object3) GetChildrenByName

func (obj *Object3) GetChildrenByName(name string) *Object3

func (*Object3) GetId

func (obj *Object3) GetId() Id

func (*Object3) GetMatrixWorld

func (obj *Object3) GetMatrixWorld() *math.Matrix4

func (*Object3) GetParent

func (obj *Object3) GetParent() *Object3

func (*Object3) GetWorldDirection

func (obj *Object3) GetWorldDirection() *math.Vector3

func (*Object3) GetWorldPosition

func (obj *Object3) GetWorldPosition() *math.Vector3

func (*Object3) GetWorldQuaternion

func (obj *Object3) GetWorldQuaternion() *math.Quaternion

func (*Object3) GetWorldScale

func (obj *Object3) GetWorldScale() *math.Vector3

func (*Object3) IsCamera

func (obj *Object3) IsCamera() bool

func (*Object3) IsVisible

func (obj *Object3) IsVisible() bool

func (*Object3) LocalToWorld

func (obj *Object3) LocalToWorld(vector *math.Vector3)

func (*Object3) LookAt

func (obj *Object3) LookAt(x *math.Vector3)

func (*Object3) LookAtComponents

func (obj *Object3) LookAtComponents(x, y, z float32)

func (*Object3) OnAfterRender

func (obj *Object3) OnAfterRender() *event.Handler

func (*Object3) OnBeforeRender

func (obj *Object3) OnBeforeRender() *event.Handler

func (*Object3) Remove

func (obj *Object3) Remove(object *Object3)

func (*Object3) RemoveAll

func (obj *Object3) RemoveAll(objects []*Object3)

func (*Object3) RotateOnAxis

func (obj *Object3) RotateOnAxis(axis *math.Vector3, angle math.Angle)

func (*Object3) RotateOnWorldAxis

func (obj *Object3) RotateOnWorldAxis(axis *math.Vector3, angle math.Angle)

func (*Object3) RotateX

func (obj *Object3) RotateX(angle math.Angle)

func (*Object3) RotateY

func (obj *Object3) RotateY(angle math.Angle)

func (*Object3) RotateZ

func (obj *Object3) RotateZ(angle math.Angle)

func (*Object3) SetRotationFromAxisAngle

func (obj *Object3) SetRotationFromAxisAngle(axis *math.Vector3, angle math.Angle)

func (*Object3) SetRotationFromEuler

func (obj *Object3) SetRotationFromEuler(euler *math.Euler)

func (*Object3) SetRotationFromMatrix

func (obj *Object3) SetRotationFromMatrix(m *math.Matrix4)

func (*Object3) SetRotationFromQuaternion

func (obj *Object3) SetRotationFromQuaternion(q *math.Quaternion)

func (*Object3) TranslateOnAxis

func (obj *Object3) TranslateOnAxis(axis *math.Vector3, distance float32)

func (*Object3) TranslateX

func (obj *Object3) TranslateX(distance float32)

func (*Object3) TranslateY

func (obj *Object3) TranslateY(distance float32)

func (*Object3) TranslateZ

func (obj *Object3) TranslateZ(distance float32)

func (*Object3) TraverseAncestorsIterator

func (obj *Object3) TraverseAncestorsIterator() *object3Iterator

func (*Object3) TraverseIterator

func (obj *Object3) TraverseIterator(onlyVisible bool) *object3Iterator

func (*Object3) UpdateMatrix

func (obj *Object3) UpdateMatrix()

func (*Object3) UpdateMatrixWorld

func (obj *Object3) UpdateMatrixWorld(force bool)

func (*Object3) WorldToLocal

func (obj *Object3) WorldToLocal(vector *math.Vector3)

type RaycastCamera

type RaycastCamera interface {
	GetRay(coordinates *math.Vector2) *math.Ray
}

type RaycastObject

type RaycastObject interface {
	IsVisible() bool
	RayCast(*Raycaster) []Intersection
	GetChildren() []*Object3
}

type Raycaster

type Raycaster struct {
	// contains filtered or unexported fields
}

func NewDefaultRaycaster

func NewDefaultRaycaster(origin *math.Vector3, direction *math.Vector3) *Raycaster

func NewRaycaster

func NewRaycaster(origin *math.Vector3, direction *math.Vector3, near float32, far float32, linePrecision uint) *Raycaster

func (*Raycaster) IntersectObject

func (ray *Raycaster) IntersectObject(object interface{ RaycastObject }, recursive bool) []Intersection

func (*Raycaster) IntersectObjects

func (ray *Raycaster) IntersectObjects(objects []interface{ RaycastObject }, recursive bool) []Intersection

func (*Raycaster) Set

func (ray *Raycaster) Set(origin *math.Vector3, direction *math.Vector3)

func (*Raycaster) SetFromCamera

func (ray *Raycaster) SetFromCamera(coordinates *math.Vector2, camera RaycastCamera)

type Scene

type Scene struct {
	Object3
	AutoUpdateRender bool
}

func NewScene

func NewScene() *Scene

func (*Scene) Copy

func (scene *Scene) Copy(source *Scene, recursive bool)

type SortableIntersections

type SortableIntersections []Intersection

func (SortableIntersections) Len

func (s SortableIntersections) Len() int

func (SortableIntersections) Less

func (s SortableIntersections) Less(i, j int) bool

func (SortableIntersections) Swap

func (s SortableIntersections) Swap(i, j int)

type Texture

type Texture struct {
	GenerateMipmaps bool
}

func NewTexture

func NewTexture(image *textures.Image, mapping constant.Mapping, wrapS constant.Wrapping, wrapT constant.Wrapping,
	magFilter constant.MagFilter, minFilter constant.MinFilter, format constant.Format, ttype constant.Type, anisotropy uint, encoding constant.Encoding) *Texture

func (*Texture) Clone

func (texture *Texture) Clone() *Texture

type TextureOptions

type TextureOptions struct {
	WrapS       constant.Wrapping
	WrapT       constant.Wrapping
	MagFilter   constant.MagFilter
	MinFilter   constant.MinFilter
	Format      constant.Format
	TextureType constant.Type
	Anisotropy  uint
	Encoding    constant.Encoding
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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