Documentation
¶
Overview ¶
Package core implements some basic types used by other packages.
Index ¶
- Constants
- type AppExitEvent
- type Callback
- type CharEvent
- type Cursor
- type CursorEvent
- type Dispatcher
- type GuiClickEvent
- type GuiCursorEnterEvent
- type GuiCursorLeaveEvent
- type GuiEnableEvent
- type GuiEvent
- type GuiEventType
- type GuiFocusEvent
- type GuiFocusLostEvent
- type GuiResizeEvent
- type IDispatcher
- type INode
- type Key
- type KeyDownEvent
- type KeyEvent
- type KeyRepeatEvent
- type KeyUpEvent
- type ModifierKey
- type MouseButton
- type MouseDownEvent
- type MouseEvent
- type MouseState
- type MouseUpEvent
- type Node
- func (n *Node) Add(ichild INode) *Node
- func (n *Node) AddAt(idx int, ichild INode) *Node
- func (n *Node) BoundingBox() math32.Box3
- func (n *Node) Changed() bool
- func (n *Node) ChildAt(idx int) INode
- func (n *Node) ChildIndex(ichild INode) int
- func (n *Node) Children() []INode
- func (n *Node) Clone() INode
- func (n *Node) Direction() math32.Vector3
- func (n *Node) Dispose()
- func (n *Node) DisposeChildren(recurs bool)
- func (n *Node) FindLoaderID(id string) INode
- func (n *Node) FindPath(path string) INode
- func (n *Node) GetINode() INode
- func (n *Node) GetNode() *Node
- func (n *Node) Init(inode INode)
- func (n *Node) IsAncestorOf(desc INode) bool
- func (n *Node) LoaderID() string
- func (n *Node) LookAt(target, up *math32.Vector3)
- func (n *Node) LowestCommonAncestor(other INode) INode
- func (n *Node) Matrix() math32.Matrix4
- func (n *Node) MatrixWorld() math32.Matrix4
- func (n *Node) Name() string
- func (n *Node) Parent() INode
- func (n *Node) Position() math32.Vector3
- func (n *Node) Quaternion() math32.Quaternion
- func (n *Node) QuaternionMult(q *math32.Quaternion)
- func (n *Node) Remove(ichild INode) bool
- func (n *Node) RemoveAll(recurs bool)
- func (n *Node) RemoveAt(idx int) INode
- func (n *Node) Render(*gls.GLS)
- func (n *Node) RotateOnAxis(axis *math32.Vector3, angle float32)
- func (n *Node) RotateX(x float32)
- func (n *Node) RotateY(y float32)
- func (n *Node) RotateZ(z float32)
- func (n *Node) Rotation() math32.Vector3
- func (n *Node) Scale() math32.Vector3
- func (n *Node) SetChanged(changed bool)
- func (n *Node) SetDirection(x, y, z float32)
- func (n *Node) SetDirectionVec(vdir math32.Vector3)
- func (n *Node) SetLoaderID(id string)
- func (n *Node) SetMatrix(m *math32.Matrix4)
- func (n *Node) SetName(name string)
- func (n *Node) SetPosition(x, y, z float32)
- func (n *Node) SetPositionVec(vpos math32.Vector3)
- func (n *Node) SetPositionX(x float32)
- func (n *Node) SetPositionY(y float32)
- func (n *Node) SetPositionZ(z float32)
- func (n *Node) SetQuaternion(x, y, z, w float32)
- func (n *Node) SetQuaternionQuat(q *math32.Quaternion)
- func (n *Node) SetQuaternionVec(q math32.Vector4)
- func (n *Node) SetRotation(x, y, z float32)
- func (n *Node) SetRotationQuat(quat *math32.Quaternion)
- func (n *Node) SetRotationVec(vrot math32.Vector3)
- func (n *Node) SetRotationX(x float32)
- func (n *Node) SetRotationY(y float32)
- func (n *Node) SetRotationZ(z float32)
- func (n *Node) SetScale(x, y, z float32)
- func (n *Node) SetScaleVec(scale math32.Vector3)
- func (n *Node) SetScaleX(sx float32)
- func (n *Node) SetScaleY(sy float32)
- func (n *Node) SetScaleZ(sz float32)
- func (n *Node) SetUserData(data any)
- func (n *Node) SetVisible(state bool)
- func (n *Node) TranslateOnAxis(axis *math32.Vector3, dist float32)
- func (n *Node) TranslateX(dist float32)
- func (n *Node) TranslateY(dist float32)
- func (n *Node) TranslateZ(dist float32)
- func (n *Node) UpdateMatrix() bool
- func (n *Node) UpdateMatrixWorld()
- func (n *Node) UserData() any
- func (n *Node) Visible() bool
- func (n *Node) WorldDirection(result *math32.Vector3)
- func (n *Node) WorldPosition(result *math32.Vector3)
- func (n *Node) WorldQuaternion(result *math32.Quaternion)
- func (n *Node) WorldRotation(result *math32.Vector3)
- func (n *Node) WorldScale(result *math32.Vector3)
- type RenderInfo
- type ScrollEvent
- type SubscribeID
- type TimerCallback
- type TimerManager
- type WindowCursorEnterEvent
- type WindowEvent
- type WindowEventType
- type WindowFocusEvent
- type WindowPosEvent
- type WindowSizeEvent
Constants ¶
const ( KeyUnknown = Key(glfw.KeyUnknown) KeySpace = Key(glfw.KeySpace) KeyApostrophe = Key(glfw.KeyApostrophe) KeyComma = Key(glfw.KeyComma) KeyMinus = Key(glfw.KeyMinus) KeyPeriod = Key(glfw.KeyPeriod) KeySlash = Key(glfw.KeySlash) Key0 = Key(glfw.Key0) Key1 = Key(glfw.Key1) Key2 = Key(glfw.Key2) Key3 = Key(glfw.Key3) Key4 = Key(glfw.Key4) Key5 = Key(glfw.Key5) Key6 = Key(glfw.Key6) Key7 = Key(glfw.Key7) Key8 = Key(glfw.Key8) Key9 = Key(glfw.Key9) KeySemicolon = Key(glfw.KeySemicolon) KeyEqual = Key(glfw.KeyEqual) KeyA = Key(glfw.KeyA) KeyB = Key(glfw.KeyB) KeyC = Key(glfw.KeyC) KeyD = Key(glfw.KeyD) KeyE = Key(glfw.KeyE) KeyF = Key(glfw.KeyF) KeyG = Key(glfw.KeyG) KeyH = Key(glfw.KeyH) KeyI = Key(glfw.KeyI) KeyJ = Key(glfw.KeyJ) KeyK = Key(glfw.KeyK) KeyL = Key(glfw.KeyL) KeyM = Key(glfw.KeyM) KeyN = Key(glfw.KeyN) KeyO = Key(glfw.KeyO) KeyP = Key(glfw.KeyP) KeyQ = Key(glfw.KeyQ) KeyR = Key(glfw.KeyR) KeyS = Key(glfw.KeyS) KeyT = Key(glfw.KeyT) KeyU = Key(glfw.KeyU) KeyV = Key(glfw.KeyV) KeyW = Key(glfw.KeyW) KeyX = Key(glfw.KeyX) KeyY = Key(glfw.KeyY) KeyZ = Key(glfw.KeyZ) KeyLeftBracket = Key(glfw.KeyLeftBracket) KeyBackslash = Key(glfw.KeyBackslash) KeyRightBracket = Key(glfw.KeyRightBracket) KeyGraveAccent = Key(glfw.KeyGraveAccent) KeyWorld1 = Key(glfw.KeyWorld1) KeyWorld2 = Key(glfw.KeyWorld2) KeyEscape = Key(glfw.KeyEscape) KeyEnter = Key(glfw.KeyEnter) KeyTab = Key(glfw.KeyTab) KeyBackspace = Key(glfw.KeyBackspace) KeyInsert = Key(glfw.KeyInsert) KeyDelete = Key(glfw.KeyDelete) KeyRight = Key(glfw.KeyRight) KeyLeft = Key(glfw.KeyLeft) KeyDown = Key(glfw.KeyDown) KeyUp = Key(glfw.KeyUp) KeyPageUp = Key(glfw.KeyPageUp) KeyPageDown = Key(glfw.KeyPageDown) KeyHome = Key(glfw.KeyHome) KeyEnd = Key(glfw.KeyEnd) KeyCapsLock = Key(glfw.KeyCapsLock) KeyScrollLock = Key(glfw.KeyScrollLock) KeyNumLock = Key(glfw.KeyNumLock) KeyPrintScreen = Key(glfw.KeyPrintScreen) KeyPause = Key(glfw.KeyPause) KeyF1 = Key(glfw.KeyF1) KeyF2 = Key(glfw.KeyF2) KeyF3 = Key(glfw.KeyF3) KeyF4 = Key(glfw.KeyF4) KeyF5 = Key(glfw.KeyF5) KeyF6 = Key(glfw.KeyF6) KeyF7 = Key(glfw.KeyF7) KeyF8 = Key(glfw.KeyF8) KeyF9 = Key(glfw.KeyF9) KeyF10 = Key(glfw.KeyF10) KeyF11 = Key(glfw.KeyF11) KeyF12 = Key(glfw.KeyF12) KeyF13 = Key(glfw.KeyF13) KeyF14 = Key(glfw.KeyF14) KeyF15 = Key(glfw.KeyF15) KeyF16 = Key(glfw.KeyF16) KeyF17 = Key(glfw.KeyF17) KeyF18 = Key(glfw.KeyF18) KeyF19 = Key(glfw.KeyF19) KeyF20 = Key(glfw.KeyF20) KeyF21 = Key(glfw.KeyF21) KeyF22 = Key(glfw.KeyF22) KeyF23 = Key(glfw.KeyF23) KeyF24 = Key(glfw.KeyF24) KeyF25 = Key(glfw.KeyF25) KeyKP0 = Key(glfw.KeyKP0) KeyKP1 = Key(glfw.KeyKP1) KeyKP2 = Key(glfw.KeyKP2) KeyKP3 = Key(glfw.KeyKP3) KeyKP4 = Key(glfw.KeyKP4) KeyKP5 = Key(glfw.KeyKP5) KeyKP6 = Key(glfw.KeyKP6) KeyKP7 = Key(glfw.KeyKP7) KeyKP8 = Key(glfw.KeyKP8) KeyKP9 = Key(glfw.KeyKP9) KeyKPDecimal = Key(glfw.KeyKPDecimal) KeyKPDivide = Key(glfw.KeyKPDivide) KeyKPMultiply = Key(glfw.KeyKPMultiply) KeyKPSubtract = Key(glfw.KeyKPSubtract) KeyKPAdd = Key(glfw.KeyKPAdd) KeyKPEnter = Key(glfw.KeyKPEnter) KeyKPEqual = Key(glfw.KeyKPEqual) KeyLeftShift = Key(glfw.KeyLeftShift) KeyLeftControl = Key(glfw.KeyLeftControl) KeyLeftAlt = Key(glfw.KeyLeftAlt) KeyLeftSuper = Key(glfw.KeyLeftSuper) KeyRightShift = Key(glfw.KeyRightShift) KeyRightControl = Key(glfw.KeyRightControl) KeyRightAlt = Key(glfw.KeyRightAlt) KeyRightSuper = Key(glfw.KeyRightSuper) KeyMenu = Key(glfw.KeyMenu) KeyLast = Key(glfw.KeyLast) )
const ( ModShift = ModifierKey(glfw.ModShift) ModControl = ModifierKey(glfw.ModControl) ModAlt = ModifierKey(glfw.ModAlt) ModSuper = ModifierKey(glfw.ModSuper) )
const ( MouseButton1 = MouseButton(glfw.MouseButton1) MouseButtonLeft = MouseButton(glfw.MouseButtonLeft) MouseButton2 = MouseButton(glfw.MouseButton2) MouseButtonRight = MouseButton(glfw.MouseButtonRight) MouseButton3 = MouseButton(glfw.MouseButton3) MouseButtonMiddle = MouseButton(glfw.MouseButtonMiddle) MouseButton4 = MouseButton(glfw.MouseButton4) MouseButton5 = MouseButton(glfw.MouseButton5) MouseButton6 = MouseButton(glfw.MouseButton6) MouseButton7 = MouseButton(glfw.MouseButton7) MouseButton8 = MouseButton(glfw.MouseButton8) )
const ( ArrowCursor = Cursor(iota) IBeamCursor CrosshairCursor HandCursor HResizeCursor VResizeCursor DiagResizeTrblCursor DiagResizeTlbrCursor CursorLast = DiagResizeTlbrCursor )
const SubscribeIDNone = SubscribeID(0)
SubscribeIDNone is the default SubscribeID, meaning there is no subscription.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AppExitEvent ¶ added in v0.2.52
type AppExitEvent struct{}
func (AppExitEvent) WindowEventType ¶ added in v0.2.52
func (e AppExitEvent) WindowEventType() WindowEventType
type CharEvent ¶ added in v0.2.18
type CharEvent struct {
Char rune
}
func (CharEvent) GuiEventType ¶ added in v0.2.52
func (e CharEvent) GuiEventType() GuiEventType
func (CharEvent) WindowEventType ¶ added in v0.2.52
func (e CharEvent) WindowEventType() WindowEventType
type Cursor ¶ added in v0.2.18
type Cursor int
Cursor is an enum of mouse cursors supported by G3N. Mouse cursor is the image where the mouse is.
type CursorEvent ¶ added in v0.2.18
func (CursorEvent) GuiEventType ¶ added in v0.2.52
func (e CursorEvent) GuiEventType() GuiEventType
func (CursorEvent) WindowEventType ¶ added in v0.2.52
func (e CursorEvent) WindowEventType() WindowEventType
type Dispatcher ¶
type Dispatcher[T any] struct { // contains filtered or unexported fields }
Dispatcher is an event dispatcher.
func (*Dispatcher[T]) Dispatch ¶
func (e *Dispatcher[T]) Dispatch(ev T) int
Dispatch invokes all subscribed callbacks with the given event. Returns the number of subscribers that consumed the event.
func (*Dispatcher[T]) Subscribe ¶
func (e *Dispatcher[T]) Subscribe(cb Callback[T]) SubscribeID
Subscribe adds the callback to the list invoked when an event is dispatched. Returns a SubscribeID that can be used to Unsubscribe later.
func (*Dispatcher[T]) Unsubscribe ¶ added in v0.2.52
func (e *Dispatcher[T]) Unsubscribe(id SubscribeID)
Unsubscribe removes the callback with the given ID from the list invoked when an event is dispatched.
type GuiClickEvent ¶ added in v0.2.52
type GuiClickEvent struct { X float32 Y float32 Button MouseButton Mods ModifierKey }
func (GuiClickEvent) GetButton ¶ added in v0.2.52
func (e GuiClickEvent) GetButton() MouseButton
func (GuiClickEvent) GetMods ¶ added in v0.2.52
func (e GuiClickEvent) GetMods() ModifierKey
func (GuiClickEvent) GetX ¶ added in v0.2.52
func (e GuiClickEvent) GetX() float32
func (GuiClickEvent) GetY ¶ added in v0.2.52
func (e GuiClickEvent) GetY() float32
func (GuiClickEvent) GuiEventType ¶ added in v0.2.52
func (e GuiClickEvent) GuiEventType() GuiEventType
type GuiCursorEnterEvent ¶ added in v0.2.52
type GuiCursorEnterEvent struct{}
func (GuiCursorEnterEvent) GuiEventType ¶ added in v0.2.52
func (e GuiCursorEnterEvent) GuiEventType() GuiEventType
type GuiCursorLeaveEvent ¶ added in v0.2.52
type GuiCursorLeaveEvent struct{}
func (GuiCursorLeaveEvent) GuiEventType ¶ added in v0.2.52
func (e GuiCursorLeaveEvent) GuiEventType() GuiEventType
type GuiEnableEvent ¶ added in v0.2.52
type GuiEnableEvent struct {
Enabled bool
}
func (GuiEnableEvent) GuiEventType ¶ added in v0.2.52
func (e GuiEnableEvent) GuiEventType() GuiEventType
type GuiEvent ¶ added in v0.2.52
type GuiEvent interface {
GuiEventType() GuiEventType
}
type GuiEventType ¶ added in v0.2.52
type GuiEventType int32
const ( GuiResize GuiEventType = iota GuiEnable GuiFocus GuiFocusLost GuiKeyUp GuiKeyDown GuiKeyRepeat GuiChar GuiCursor GuiCursorEnter GuiCursorLeave GuiMouseDown GuiMouseUp GuiScroll GuiClick )
type GuiFocusEvent ¶ added in v0.2.52
type GuiFocusEvent struct{}
func (GuiFocusEvent) GuiEventType ¶ added in v0.2.52
func (e GuiFocusEvent) GuiEventType() GuiEventType
type GuiFocusLostEvent ¶ added in v0.2.52
type GuiFocusLostEvent struct{}
func (GuiFocusLostEvent) GuiEventType ¶ added in v0.2.52
func (e GuiFocusLostEvent) GuiEventType() GuiEventType
type GuiResizeEvent ¶ added in v0.2.52
type GuiResizeEvent struct{}
func (GuiResizeEvent) GuiEventType ¶ added in v0.2.52
func (e GuiResizeEvent) GuiEventType() GuiEventType
type IDispatcher ¶
type IDispatcher[T any] interface { Subscribe(cb Callback[T]) SubscribeID Unsubscribe(id SubscribeID) Dispatch(ev T) int }
IDispatcher is the interface for event dispatchers.
type INode ¶
type INode interface { GetNode() *Node GetINode() INode Visible() bool SetVisible(state bool) Name() string SetName(string) Parent() INode Children() []INode IsAncestorOf(INode) bool LowestCommonAncestor(INode) INode UpdateMatrixWorld() BoundingBox() math32.Box3 Render(gs *gls.GLS) Clone() INode Dispose() Position() math32.Vector3 Rotation() math32.Vector3 Scale() math32.Vector3 }
INode is the interface for all node types.
type KeyDownEvent ¶ added in v0.2.52
type KeyDownEvent struct { Key Key Mods ModifierKey }
func (KeyDownEvent) GetKey ¶ added in v0.2.52
func (e KeyDownEvent) GetKey() Key
func (KeyDownEvent) GetMods ¶ added in v0.2.52
func (e KeyDownEvent) GetMods() ModifierKey
func (KeyDownEvent) GuiEventType ¶ added in v0.2.52
func (e KeyDownEvent) GuiEventType() GuiEventType
func (KeyDownEvent) WindowEventType ¶ added in v0.2.52
func (e KeyDownEvent) WindowEventType() WindowEventType
type KeyEvent ¶ added in v0.2.18
type KeyEvent interface { GetKey() Key GetMods() ModifierKey }
type KeyRepeatEvent ¶ added in v0.2.52
type KeyRepeatEvent struct { Key Key Mods ModifierKey }
func (KeyRepeatEvent) GetKey ¶ added in v0.2.52
func (e KeyRepeatEvent) GetKey() Key
func (KeyRepeatEvent) GetMods ¶ added in v0.2.52
func (e KeyRepeatEvent) GetMods() ModifierKey
func (KeyRepeatEvent) GuiEventType ¶ added in v0.2.52
func (e KeyRepeatEvent) GuiEventType() GuiEventType
func (KeyRepeatEvent) WindowEventType ¶ added in v0.2.52
func (e KeyRepeatEvent) WindowEventType() WindowEventType
type KeyUpEvent ¶ added in v0.2.52
type KeyUpEvent struct { Key Key Mods ModifierKey }
func (KeyUpEvent) GetKey ¶ added in v0.2.52
func (e KeyUpEvent) GetKey() Key
func (KeyUpEvent) GetMods ¶ added in v0.2.52
func (e KeyUpEvent) GetMods() ModifierKey
func (KeyUpEvent) GuiEventType ¶ added in v0.2.52
func (e KeyUpEvent) GuiEventType() GuiEventType
func (KeyUpEvent) WindowEventType ¶ added in v0.2.52
func (e KeyUpEvent) WindowEventType() WindowEventType
type ModifierKey ¶ added in v0.2.18
type ModifierKey int
ModifierKey is an enum of GLFW modifier keyboard key codes.
type MouseButton ¶ added in v0.2.18
type MouseButton int
MouseButton is an enum of GLFW mouse button codes.
func (MouseButton) GetMouseState ¶ added in v0.2.56
func (b MouseButton) GetMouseState() MouseState
type MouseDownEvent ¶ added in v0.2.52
type MouseDownEvent struct { X float32 Y float32 Button MouseButton Mods ModifierKey }
func (MouseDownEvent) GetButton ¶ added in v0.2.52
func (e MouseDownEvent) GetButton() MouseButton
func (MouseDownEvent) GetMods ¶ added in v0.2.52
func (e MouseDownEvent) GetMods() ModifierKey
func (MouseDownEvent) GetX ¶ added in v0.2.52
func (e MouseDownEvent) GetX() float32
func (MouseDownEvent) GetY ¶ added in v0.2.52
func (e MouseDownEvent) GetY() float32
func (MouseDownEvent) GuiEventType ¶ added in v0.2.52
func (e MouseDownEvent) GuiEventType() GuiEventType
func (MouseDownEvent) WindowEventType ¶ added in v0.2.52
func (e MouseDownEvent) WindowEventType() WindowEventType
type MouseEvent ¶ added in v0.2.18
type MouseEvent interface { GetX() float32 GetY() float32 GetButton() MouseButton GetMods() ModifierKey }
type MouseState ¶ added in v0.2.56
type MouseState int
MouseState is a bit field for mouse buttons.
const ( MouseState1 MouseState = 1 << iota MouseState2 MouseState3 MouseState4 MouseState5 MouseState6 MouseState7 MouseState8 MouseStateLeft = MouseState1 MouseStateRight = MouseState2 MouseStateMiddle = MouseState3 )
func (MouseState) IsSet ¶ added in v0.2.56
func (s MouseState) IsSet(b MouseButton) bool
IsSet returns whether the bit corresponding with a MouseButton is set.
func (MouseState) Set ¶ added in v0.2.56
func (s MouseState) Set(b MouseButton) MouseState
Set sets the bit corresponding with the MouseButton.
func (MouseState) Unset ¶ added in v0.2.56
func (s MouseState) Unset(b MouseButton) MouseState
Unset unsets the bit corresponding with the MouseButton.
type MouseUpEvent ¶ added in v0.2.52
type MouseUpEvent struct { X float32 Y float32 Button MouseButton Mods ModifierKey }
func (MouseUpEvent) GetButton ¶ added in v0.2.52
func (e MouseUpEvent) GetButton() MouseButton
func (MouseUpEvent) GetMods ¶ added in v0.2.52
func (e MouseUpEvent) GetMods() ModifierKey
func (MouseUpEvent) GetX ¶ added in v0.2.52
func (e MouseUpEvent) GetX() float32
func (MouseUpEvent) GetY ¶ added in v0.2.52
func (e MouseUpEvent) GetY() float32
func (MouseUpEvent) GuiEventType ¶ added in v0.2.52
func (e MouseUpEvent) GuiEventType() GuiEventType
func (MouseUpEvent) WindowEventType ¶ added in v0.2.52
func (e MouseUpEvent) WindowEventType() WindowEventType
type Node ¶
type Node struct {
// contains filtered or unexported fields
}
Node represents an object in 3D space existing within a hierarchy.
func (*Node) Add ¶
Add adds the specified node to the list of children and sets its parent pointer. If the specified node had a parent, the specified node is removed from the original parent's list of children.
func (*Node) AddAt ¶
AddAt adds the specified node to the list of children at the specified index and sets its parent pointer. If the specified node had a parent, the specified node is removed from the original parent's list of children.
func (*Node) BoundingBox ¶
BoundingBox satisfies the INode interface. Computes union of own bounding box with those of all descendents.
func (*Node) ChildIndex ¶
ChildIndex returns the index of the specified child (-1 if not found).
func (*Node) DisposeChildren ¶
DisposeChildren removes and disposes of all children. If 'recurs' is true, call DisposeChildren on each child recursively.
func (*Node) FindLoaderID ¶
FindLoaderID looks in the specified node and in all its children for a node with the specified loaderID and if found returns it. Returns nil if not found.
func (*Node) FindPath ¶
FindPath finds a node with the specified path by recursively searching the children. A path is a sequence of names of nested child nodes, separated by a forward slash.
func (*Node) GetNode ¶
GetNode satisfies the INode interface and returns a pointer to the embedded Node.
func (*Node) IsAncestorOf ¶
IsAncestorOf returns whether this node is an ancestor of the specified node. Returns true if they are the same.
func (*Node) LoaderID ¶
LoaderID returns an optional ID set when this node was created by an external loader such as Collada.
func (*Node) LookAt ¶
LookAt rotates the node to look at the specified target position, using the specified up vector.
func (*Node) LowestCommonAncestor ¶
LowestCommonAncestor returns the common ancestor of this node and the specified node if any.
func (*Node) MatrixWorld ¶
MatrixWorld returns a copy of the matrix world of this node.
func (*Node) Quaternion ¶
func (n *Node) Quaternion() math32.Quaternion
Quaternion returns the current quaternion.
func (*Node) QuaternionMult ¶
func (n *Node) QuaternionMult(q *math32.Quaternion)
QuaternionMult multiplies the current quaternion by the specified quaternion.
func (*Node) Remove ¶
Remove removes the specified INode from the list of children. Returns true if found or false otherwise.
func (*Node) RotateOnAxis ¶
RotateOnAxis rotates around the specified local axis the specified angle in radians.
func (*Node) SetChanged ¶
SetChanged sets the matNeedsUpdate flag of the node.
func (*Node) SetDirection ¶
SetDirection sets the direction.
func (*Node) SetDirectionVec ¶
SetDirectionVec sets the direction based on a vector pointer.
func (*Node) SetLoaderID ¶
SetLoaderID is normally used by external loaders, such as Collada, to assign an ID to the node with the ID value in the node description. Can be used to find other loaded nodes.
func (*Node) SetName ¶
SetName sets the (optional) name. The name can be used for debugging or other purposes.
func (*Node) SetPosition ¶
SetPosition sets the position.
func (*Node) SetPositionVec ¶
SetPositionVec sets the position based on the specified vector pointer.
func (*Node) SetPositionX ¶
SetPositionX sets the X coordinate of the position.
func (*Node) SetPositionY ¶
SetPositionY sets the Y coordinate of the position.
func (*Node) SetPositionZ ¶
SetPositionZ sets the Z coordinate of the position.
func (*Node) SetQuaternion ¶
SetQuaternion sets the quaternion based on the specified quaternion unit multiples.
func (*Node) SetQuaternionQuat ¶
func (n *Node) SetQuaternionQuat(q *math32.Quaternion)
SetQuaternionQuat sets the quaternion based on the specified quaternion pointer.
func (*Node) SetQuaternionVec ¶
SetQuaternionVec sets the quaternion based on the specified quaternion unit multiples vector.
func (*Node) SetRotation ¶
SetRotation sets the global rotation in Euler angles (radians).
func (*Node) SetRotationQuat ¶
func (n *Node) SetRotationQuat(quat *math32.Quaternion)
SetRotationQuat sets the global rotation based on the specified quaternion pointer.
func (*Node) SetRotationVec ¶
SetRotationVec sets the global rotation in Euler angles (radians) based on the specified vector pointer.
func (*Node) SetRotationX ¶
SetRotationX sets the global X rotation to the specified angle in radians.
func (*Node) SetRotationY ¶
SetRotationY sets the global Y rotation to the specified angle in radians.
func (*Node) SetRotationZ ¶
SetRotationZ sets the global Z rotation to the specified angle in radians.
func (*Node) SetScaleVec ¶
SetScaleVec sets the scale based on the specified vector pointer.
func (*Node) SetUserData ¶
SetUserData sets the generic user data associated to the node.
func (*Node) SetVisible ¶
SetVisible sets the visibility of the node.
func (*Node) TranslateOnAxis ¶
TranslateOnAxis translates the specified distance on the specified local axis.
func (*Node) TranslateX ¶
TranslateX translates the specified distance on the local X axis.
func (*Node) TranslateY ¶
TranslateY translates the specified distance on the local Y axis.
func (*Node) TranslateZ ¶
TranslateZ translates the specified distance on the local Z axis.
func (*Node) UpdateMatrix ¶
UpdateMatrix updates (if necessary) the local transform matrix of this node based on its position, quaternion, and scale.
func (*Node) UpdateMatrixWorld ¶
func (n *Node) UpdateMatrixWorld()
UpdateMatrixWorld updates this node world transform matrix and of all its children
func (*Node) WorldDirection ¶
WorldDirection updates the world matrix and sets the specified vector to the current world direction of this node.
func (*Node) WorldPosition ¶
WorldPosition updates the world matrix and sets the specified vector to the current world position of this node.
func (*Node) WorldQuaternion ¶
func (n *Node) WorldQuaternion(result *math32.Quaternion)
WorldQuaternion updates the world matrix and sets the specified quaternion to the current world quaternion of this node.
func (*Node) WorldRotation ¶
WorldRotation updates the world matrix and sets the specified vector to the current world rotation of this node in Euler angles.
func (*Node) WorldScale ¶
WorldScale updates the world matrix and sets the specified vector to the current world scale of this node.
type RenderInfo ¶
type RenderInfo struct { ViewMatrix math32.Matrix4 // Current camera view matrix ProjMatrix math32.Matrix4 // Current camera projection matrix }
RenderInfo is passed into Render/RenderSetup calls
type ScrollEvent ¶ added in v0.2.18
func (ScrollEvent) GuiEventType ¶ added in v0.2.52
func (e ScrollEvent) GuiEventType() GuiEventType
func (ScrollEvent) WindowEventType ¶ added in v0.2.52
func (e ScrollEvent) WindowEventType() WindowEventType
type SubscribeID ¶ added in v0.2.52
type SubscribeID int32
SubscribeID identifies a specific subscription to a dispatcher.
type TimerCallback ¶
type TimerCallback func(any)
TimerCallback is the type for timer callback functions
type TimerManager ¶
type TimerManager struct {
// contains filtered or unexported fields
}
TimerManager manages multiple timers
func NewTimerManager ¶
func NewTimerManager() *TimerManager
NewTimerManager creates and returns a new timer manager
func (*TimerManager) ClearTimeout ¶
func (tm *TimerManager) ClearTimeout(id int) bool
ClearTimeout clears the timeout specified by the id. Returns true if the timeout is found.
func (*TimerManager) Initialize ¶
func (tm *TimerManager) Initialize()
Initialize initializes the timer manager. It is normally used when the TimerManager is embedded in another type.
func (*TimerManager) ProcessTimers ¶
func (tm *TimerManager) ProcessTimers()
ProcessTimers should be called periodically to process the timers
func (*TimerManager) SetInterval ¶
func (tm *TimerManager) SetInterval(td time.Duration, arg any, cb TimerCallback) int
SetInterval sets a periodic timeout with the specified duration and callback The function returns the timeout id which can be used to cancel the timeout
func (*TimerManager) SetTimeout ¶
func (tm *TimerManager) SetTimeout(td time.Duration, arg any, cb TimerCallback) int
SetTimeout sets a timeout with the specified duration and callback The function returns the timeout id which can be used to cancel the timeout
type WindowCursorEnterEvent ¶ added in v0.2.57
type WindowCursorEnterEvent struct {
Entered bool
}
func (WindowCursorEnterEvent) WindowEventType ¶ added in v0.2.57
func (e WindowCursorEnterEvent) WindowEventType() WindowEventType
type WindowEvent ¶ added in v0.2.52
type WindowEvent interface {
WindowEventType() WindowEventType
}
type WindowEventType ¶ added in v0.2.52
type WindowEventType int32
const ( AppExit WindowEventType = iota WindowFocus WindowPos WindowSize WindowKeyUp WindowKeyDown WindowKeyRepeat WindowChar WindowCursor WindowCursorEnter WindowMouseUp WindowMouseDown WindowScroll )
type WindowFocusEvent ¶ added in v0.2.52
type WindowFocusEvent struct {
Focused bool
}
func (WindowFocusEvent) WindowEventType ¶ added in v0.2.52
func (e WindowFocusEvent) WindowEventType() WindowEventType
type WindowPosEvent ¶ added in v0.2.52
func (WindowPosEvent) WindowEventType ¶ added in v0.2.52
func (e WindowPosEvent) WindowEventType() WindowEventType
type WindowSizeEvent ¶ added in v0.2.52
func (WindowSizeEvent) WindowEventType ¶ added in v0.2.52
func (e WindowSizeEvent) WindowEventType() WindowEventType