core

package
v0.0.0-...-6c0504e Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2025 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Object3dDefaultMatrixAutoUpdate = true
View Source
var Object3dDefaultMatrixWorldAutoUpdate = true
View Source
var Object3dDefaultUp = math.NewVector3(0, 1, 0)

Functions

This section is empty.

Types

type BufferAttribute

type BufferAttribute struct {
	Name       string
	ItemSize   int
	Count      int
	Normalized bool
	Version    int
}

func (*BufferAttribute) IsBufferAttribute

func (a *BufferAttribute) IsBufferAttribute() bool

type BufferGeometry

type BufferGeometry struct {
	EventDispatcher
	Id         int
	Uuid       math.UUID
	Name       string
	Type       string
	Index      IBufferAttribute
	Attributes map[string]IBufferAttribute
}

func NewBufferGeometry

func NewBufferGeometry() *BufferGeometry

func (*BufferGeometry) DeleteAttribute

func (g *BufferGeometry) DeleteAttribute(name string) *BufferGeometry

func (*BufferGeometry) GetAttribute

func (g *BufferGeometry) GetAttribute(name string) IBufferAttribute

func (*BufferGeometry) HasAttribute

func (g *BufferGeometry) HasAttribute(name string) bool

func (*BufferGeometry) IsBufferGeometry

func (g *BufferGeometry) IsBufferGeometry() bool

func (*BufferGeometry) SetAttribute

func (g *BufferGeometry) SetAttribute(name string, attribute IBufferAttribute) *BufferGeometry

func (*BufferGeometry) SetIndex

func (g *BufferGeometry) SetIndex(index IBufferAttribute) *BufferGeometry

func (*BufferGeometry) SetIndexUint16

func (g *BufferGeometry) SetIndexUint16(index []uint16) *BufferGeometry

func (*BufferGeometry) SetIndexUint32

func (g *BufferGeometry) SetIndexUint32(index []uint32) *BufferGeometry

type Event

type Event struct {
	TypeName string
	Target   any
}

type EventDispatcher

type EventDispatcher struct {
	This any
	// contains filtered or unexported fields
}

func NewEventDispatcher

func NewEventDispatcher() *EventDispatcher

func (*EventDispatcher) AddListener

func (e *EventDispatcher) AddListener(typeName string, listener *func(event Event))

func (*EventDispatcher) DispatchEvent

func (e *EventDispatcher) DispatchEvent(typeName string)

func (*EventDispatcher) HasEventListener

func (e *EventDispatcher) HasEventListener(typeName string, listener *func(event Event)) bool

func (*EventDispatcher) RemoveListener

func (e *EventDispatcher) RemoveListener(typeName string, listener *func(event Event))

type Float32BufferAttribute

type Float32BufferAttribute struct {
	BufferAttribute
	Array []float32
}

func NewFloat32BufferAttribute

func NewFloat32BufferAttribute(array []float32, itemSize int) *Float32BufferAttribute

func NewFloat32BufferAttributeFromAny

func NewFloat32BufferAttributeFromAny(array any, itemSize int) *Float32BufferAttribute

func NewFloat32BufferAttributeNormalized

func NewFloat32BufferAttributeNormalized(array []float32, itemSize int, normalized bool) *Float32BufferAttribute

func NewFloat32BufferAttributeNormalizedFromAny

func NewFloat32BufferAttributeNormalizedFromAny(array any, itemSize int, normalized bool) *Float32BufferAttribute

func (*Float32BufferAttribute) GetBufferAttribute

func (a *Float32BufferAttribute) GetBufferAttribute() *BufferAttribute

type IBufferAttribute

type IBufferAttribute interface {
	GetBufferAttribute() *BufferAttribute
}

type Layers

type Layers struct {
	Mask uint32
}

func NewLayers

func NewLayers() *Layers

func (*Layers) Disable

func (l *Layers) Disable(channel int)

func (*Layers) DisableAll

func (l *Layers) DisableAll()

func (*Layers) Enable

func (l *Layers) Enable(channel int)

func (*Layers) EnableAll

func (l *Layers) EnableAll()

func (*Layers) IsEnabled

func (l *Layers) IsEnabled(channel int) bool

func (*Layers) Set

func (l *Layers) Set(channel int)

func (*Layers) Test

func (l *Layers) Test(layers *Layers) bool

func (*Layers) Toggle

func (l *Layers) Toggle(channel int)

type Object3D

type Object3D struct {
	EventDispatcher
	Id                     int
	Uuid                   math.UUID
	Name                   string
	Type                   string
	Parent                 *Object3D
	Children               []*Object3D
	Up                     math.Vector3
	Position               math.Vector3
	Rotation               math.Euler
	Quaternion             math.Quaternion
	ModelViewMatrix        math.Matrix4
	NormalMatrix           math.Matrix3
	Scale                  math.Vector3
	Matrix                 math.Matrix4
	MatrixWorld            math.Matrix4
	MatrixAutoUpdate       bool
	MatrixWorldAutoUpdate  bool
	MatrixWorldNeedsUpdate bool
	Layers                 Layers
	Visible                bool
	CastShadow             bool
	ReceiveShadow          bool
	FrustumCulled          bool
	RenderOrder            int

	OnBeforeShadow func() // renderer, object, camera, shadowCamera, geometry, depthMaterial, group
	OnAfterShadow  func() // renderer, object, camera, shadowCamera, geometry, depthMaterial, group
	OnBeforeRender func() // renderer, scene, camera, geometry, material, group
	OnAfterRender  func() // renderer, scene, camera, geometry, material, group
}

func NewObject3D

func NewObject3D() *Object3D

func (*Object3D) Add

func (o *Object3D) Add(objects ...*Object3D) *Object3D

func (*Object3D) Clone

func (o *Object3D) Clone() *Object3D

func (*Object3D) CloneRecursive

func (o *Object3D) CloneRecursive(recursive bool) *Object3D

func (*Object3D) Copy

func (o *Object3D) Copy(source *Object3D) *Object3D

func (*Object3D) CopyRecursive

func (o *Object3D) CopyRecursive(source *Object3D, recursive bool) *Object3D

func (*Object3D) GetWorldDirection

func (o *Object3D) GetWorldDirection(target *math.Vector3) *math.Vector3

func (*Object3D) IsObject3D

func (o *Object3D) IsObject3D() bool

func (*Object3D) UpdateMatrix

func (o *Object3D) UpdateMatrix()

func (*Object3D) UpdateMatrixWorld

func (o *Object3D) UpdateMatrixWorld()

func (*Object3D) UpdateMatrixWorldForce

func (o *Object3D) UpdateMatrixWorldForce(force bool)

func (*Object3D) UpdateWorldMatrix

func (o *Object3D) UpdateWorldMatrix(updateParents, updateChildren bool)

type Uint16BufferAttribute

type Uint16BufferAttribute struct {
	BufferAttribute
	Array []uint16
}

func NewUint16BufferAttribute

func NewUint16BufferAttribute(array []uint16, itemSize int) *Uint16BufferAttribute

func NewUint16BufferAttributeFromAny

func NewUint16BufferAttributeFromAny(array any, itemSize int) *Uint16BufferAttribute

func NewUint16BufferAttributeNormalized

func NewUint16BufferAttributeNormalized(array []uint16, itemSize int, normalized bool) *Uint16BufferAttribute

func NewUint16BufferAttributeNormalizedFromAny

func NewUint16BufferAttributeNormalizedFromAny(array any, itemSize int, normalized bool) *Uint16BufferAttribute

func (*Uint16BufferAttribute) GetBufferAttribute

func (a *Uint16BufferAttribute) GetBufferAttribute() *BufferAttribute

type Uint32BufferAttribute

type Uint32BufferAttribute struct {
	BufferAttribute
	Array []uint32
}

func NewUint32BufferAttribute

func NewUint32BufferAttribute(array []uint32, itemSize int) *Uint32BufferAttribute

func NewUint32BufferAttributeFromAny

func NewUint32BufferAttributeFromAny(array any, itemSize int) *Uint32BufferAttribute

func NewUint32BufferAttributeNormalized

func NewUint32BufferAttributeNormalized(array []uint32, itemSize int, normalized bool) *Uint32BufferAttribute

func NewUint32BufferAttributeNormalizedFromAny

func NewUint32BufferAttributeNormalizedFromAny(array any, itemSize int, normalized bool) *Uint32BufferAttribute

func (*Uint32BufferAttribute) AutoDownToUint16

func (a *Uint32BufferAttribute) AutoDownToUint16() IBufferAttribute

func (*Uint32BufferAttribute) GetBufferAttribute

func (a *Uint32BufferAttribute) GetBufferAttribute() *BufferAttribute

Jump to

Keyboard shortcuts

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