Documentation ¶
Index ¶
- Variables
- type Camera
- type EulerCamera
- func (c *EulerCamera) Move(delta mgl.Vec3)
- func (c *EulerCamera) Position() mgl.Vec3
- func (c *EulerCamera) Projection() mgl.Mat4
- func (c *EulerCamera) Rotate(delta mgl.Vec3)
- func (c *EulerCamera) RotateTo(center mgl.Vec3)
- func (c *EulerCamera) SetPerspective(fovy, aspect, near, far float32)
- func (c *EulerCamera) String() string
- func (c *EulerCamera) View() mgl.Mat4
- type FixedCamera
- type QuatCamera
- func (c *QuatCamera) Center() mgl.Vec3
- func (c *QuatCamera) Lerp(position mgl.Vec3, center mgl.Vec3, amount float32)
- func (c *QuatCamera) Move(delta mgl.Vec3)
- func (c *QuatCamera) MoveTo(position mgl.Vec3)
- func (c *QuatCamera) Position() mgl.Vec3
- func (c *QuatCamera) Projection() mgl.Mat4
- func (c *QuatCamera) Rotate(delta mgl.Vec3)
- func (c *QuatCamera) RotateTo(center mgl.Vec3)
- func (c *QuatCamera) SetPerspective(fovy, aspect, near, far float32)
- func (c *QuatCamera) String() string
- func (c *QuatCamera) Up() mgl.Vec3
- func (c *QuatCamera) View() mgl.Mat4
Constants ¶
This section is empty.
Variables ¶
Functions ¶
This section is empty.
Types ¶
type EulerCamera ¶
type EulerCamera struct {
// contains filtered or unexported fields
}
func (*EulerCamera) Move ¶
func (c *EulerCamera) Move(delta mgl.Vec3)
Move adjusts the position of the camera by a delta vector relative to the camera is facing.
func (*EulerCamera) Position ¶
func (c *EulerCamera) Position() mgl.Vec3
func (*EulerCamera) Projection ¶
func (c *EulerCamera) Projection() mgl.Mat4
Projection returns the projection matrix for the camera perspective
func (*EulerCamera) Rotate ¶
func (c *EulerCamera) Rotate(delta mgl.Vec3)
Rotate adjusts the direction vectors by a delta vector of {pitch, yaw, roll}. Roll is ignored for now.
func (*EulerCamera) RotateTo ¶
func (c *EulerCamera) RotateTo(center mgl.Vec3)
RotateTo adjusts the yaw and pitch to face a point.
func (*EulerCamera) SetPerspective ¶
func (c *EulerCamera) SetPerspective(fovy, aspect, near, far float32)
Perspective computes the projection matrix and saves it
func (*EulerCamera) String ¶
func (c *EulerCamera) String() string
String returns a string representation of the camera for debugging.
func (*EulerCamera) View ¶
func (c *EulerCamera) View() mgl.Mat4
View returns the transform matrix from world space into camera space
type FixedCamera ¶
type FixedCamera struct {
// contains filtered or unexported fields
}
func (FixedCamera) Position ¶
func (c FixedCamera) Position() mgl.Vec3
func (FixedCamera) Projection ¶
func (c FixedCamera) Projection() mgl.Mat4
func (FixedCamera) View ¶
func (c FixedCamera) View() mgl.Mat4
type QuatCamera ¶
type QuatCamera struct {
// contains filtered or unexported fields
}
QuatCamera is a Camera implementation using quaternion for rotation.
func NewQuatCamera ¶
func NewQuatCamera() *QuatCamera
func (*QuatCamera) Center ¶
func (c *QuatCamera) Center() mgl.Vec3
Center returns the direction vector of the camera
func (*QuatCamera) Move ¶
func (c *QuatCamera) Move(delta mgl.Vec3)
Move adjusts the position of the camera by a delta vector relative to the camera is facing.
func (*QuatCamera) MoveTo ¶
func (c *QuatCamera) MoveTo(position mgl.Vec3)
MoveTo adjusts the absolute position of the camera
func (*QuatCamera) Position ¶
func (c *QuatCamera) Position() mgl.Vec3
func (*QuatCamera) Projection ¶
func (c *QuatCamera) Projection() mgl.Mat4
Projection returns the projection matrix for the camera perspective
func (*QuatCamera) Rotate ¶
func (c *QuatCamera) Rotate(delta mgl.Vec3)
func (*QuatCamera) RotateTo ¶
func (c *QuatCamera) RotateTo(center mgl.Vec3)
RotateTo adjusts the yaw and pitch to face a point.
func (*QuatCamera) SetPerspective ¶
func (c *QuatCamera) SetPerspective(fovy, aspect, near, far float32)
Perspective computes the projection matrix and saves it
func (*QuatCamera) String ¶
func (c *QuatCamera) String() string
String returns a string representation of the camera for debugging.
func (*QuatCamera) Up ¶
func (c *QuatCamera) Up() mgl.Vec3
Center returns the direction vector of the camera
func (*QuatCamera) View ¶
func (c *QuatCamera) View() mgl.Mat4
View returns the transform matrix from world space into camera space