Documentation ¶
Overview ¶
Code generated by gravity-development-toolkit. DO NOT EDIT.
Index ¶
- Constants
- Variables
- func Abs(f float32) float32
- func Asin(x float32) float32
- func Atan2(y, x float32) float32
- func Captured() bool
- func Cos(f float32) float32
- func D2R(d float32) float32
- func Deg2Quat(yaw, pitch float32) mgl32.Quat
- func GetMaterialProgram(name string) *gravitygl.Program
- func Init(cfg Config)
- func JustPressed(btn Button) bool
- func Max(a, b float32) float32
- func Min(a, b float32) float32
- func Mod(x, y float32) float32
- func Norm(q mgl32.Quat) float32
- func Pressed(btn Button) bool
- func PrintVec3(v mgl32.Vec3) string
- func QuatToEuler(q mgl32.Quat) (float32, float32, float32)
- func QuatToEulerDeg(q mgl32.Quat) (float32, float32, float32)
- func R2D(r float32) float32
- func Run(run func())
- func Running() bool
- func ScreenToGLCoords(width, height, x, y float32) (float32, float32)
- func SetCaptureMode(b bool)
- func SetQuatFromEuler(q *mgl32.Quat, v mgl32.Vec3) *mgl32.Quat
- func Sin(f float32) float32
- func Sincos(x float32) (sin, cos float32)
- func Stop()
- func TextureDataFromImage(img image.Image) *image.RGBA
- func TextureImageFromFile(filename string) image.Image
- func TextureRGBAFromFile(filename string) *image.RGBA
- func Unit(q mgl32.Quat) mgl32.Quat
- func Unpress(btn Button)
- func Update()
- func UpdateInput()
- func UploadToGPU(t *Texture)
- type BaseMaterial
- type BaseObject
- type Button
- type Camera
- func (cam *Camera) ChangePerspective(fovy, aspect, near, far float32)
- func (cam *Camera) GetViewMatrix() mgl32.Mat4
- func (cam *Camera) GetYawPitch() (float32, float32)
- func (cam *Camera) MoveBackward(speed float32)
- func (cam *Camera) MoveDown(speed float32)
- func (cam *Camera) MoveForward(speed float32)
- func (cam *Camera) MoveLeft(speed float32)
- func (cam *Camera) MoveRight(speed float32)
- func (cam *Camera) MoveUp(speed float32)
- func (cam *Camera) Push(pitch, yaw float32)
- func (cam *Camera) Update()
- type CameraOption
- type Config
- type ImageData
- type Material
- type Model
- type MouseInfo
- type Object
- type PrimitiveType
- type PrintFn
- type PrintfFn
- type PrintlnFn
- type Redirector
- type Scene
- type Texture
- type TextureParameter
- type Transformer
- func (t *Transformer) GetPosition() mgl32.Vec3
- func (t *Transformer) GetRotation() mgl32.Quat
- func (t *Transformer) GetScale() mgl32.Vec3
- func (t *Transformer) GetTransformMatrix() *mgl32.Mat4
- func (t *Transformer) Scale(v mgl32.Vec3)
- func (t *Transformer) ScaleX(f float32)
- func (t *Transformer) ScaleY(f float32)
- func (t *Transformer) ScaleZ(f float32)
- func (t *Transformer) Scalef(f float32)
- func (t *Transformer) SetPosition(x, y, z float32)
- func (t *Transformer) SetRotation(q mgl32.Quat)
- func (t *Transformer) Translate(v mgl32.Vec3)
- func (t *Transformer) TranslateX(d float32)
- func (t *Transformer) TranslateY(d float32)
- func (t *Transformer) TranslateZ(d float32)
- func (t *Transformer) UpdateTransform()
- type UniformSubmission
- type Window
Constants ¶
const ( MouseButton1 = Button(0) MouseButton2 = Button(1) MouseButton3 = Button(2) MouseButton4 = Button(3) MouseLeft = Button(MouseButton1) MouseRight = Button(MouseButton2) )
List of all mouse buttons.
const ( KeySpace = Button(32) KeyApostrophe = Button(39) KeyComma = Button(44) KeyMinus = Button(45) KeyPeriod = Button(46) KeySlash = Button(47) Key0 = Button(48) Key1 = Button(49) Key2 = Button(50) Key3 = Button(51) Key4 = Button(52) Key5 = Button(53) Key6 = Button(54) Key7 = Button(55) Key8 = Button(56) Key9 = Button(57) KeySemicolon = Button(59) KeyEqual = Button(61) KeyA = Button(65) KeyB = Button(66) KeyC = Button(67) KeyD = Button(68) KeyE = Button(69) KeyF = Button(70) KeyG = Button(71) KeyH = Button(72) KeyI = Button(73) KeyJ = Button(74) KeyK = Button(75) KeyL = Button(76) KeyM = Button(77) KeyN = Button(78) KeyO = Button(79) KeyP = Button(80) KeyQ = Button(81) KeyR = Button(82) KeyS = Button(83) KeyT = Button(84) KeyU = Button(85) KeyV = Button(86) KeyW = Button(87) KeyX = Button(88) KeyY = Button(89) KeyZ = Button(90) KeyLeftBracket = Button(91) KeyBackSlash = Button(92) KeyRightBracket = Button(93) KeyGrave = Button(96) KeyEscape = Button(256) KeyEnter = Button(257) KeyTab = Button(258) KeyBackspace = Button(259) KeyInsert = Button(260) KeyDelete = Button(261) KeyRight = Button(262) KeyLeft = Button(263) KeyDown = Button(264) KeyUp = Button(265) KeyPageUp = Button(266) KeyPageDown = Button(267) KeyHome = Button(268) KeyEnd = Button(269) KeyCaps = Button(280) KeyScroll = Button(281) KeyNumlock = Button(282) KeyPrintScreen = Button(283) KeyPause = Button(284) KeyF1 = Button(290) KeyF2 = Button(291) KeyF3 = Button(292) KeyF4 = Button(293) KeyF5 = Button(294) KeyF6 = Button(295) KeyF7 = Button(296) KeyF8 = Button(297) KeyF9 = Button(298) KeyF10 = Button(299) KeyF11 = Button(300) KeyF12 = Button(301) KeyF13 = Button(302) KeyF14 = Button(303) KeyF15 = Button(304) KeyF16 = Button(305) KeyF17 = Button(306) KeyF18 = Button(307) KeyF19 = Button(308) KeyF20 = Button(309) KeyF21 = Button(310) KeyF22 = Button(311) KeyF23 = Button(312) KeyF24 = Button(313) KeyF25 = Button(314) KeyKP0 = Button(320) KeyKP1 = Button(321) KeyKP2 = Button(322) KeyKP3 = Button(323) KeyKP4 = Button(324) KeyKP5 = Button(325) KeyKP6 = Button(326) KeyKP7 = Button(327) KeyKP8 = Button(328) KeyKP9 = Button(329) KeyDecimal = Button(330) KeyDivide = Button(331) KeyMultiply = Button(332) KeySubtract = Button(333) KeyAdd = Button(334) KeyKPEnter = Button(335) KeyKPEqual = Button(336) KeyLeftShift = Button(340) KeyLeftControl = Button(341) KeyLeftAlt = Button(342) KeyLeftSuper = Button(343) KeyRightShift = Button(344) KeyRightControl = Button(345) KeyRightAlt = Button(346) KeyRightSuper = Button(347) KeyMenu = Button(348) LastKey = KeyMenu )
List of all keyboard buttons.
const ( Triangles = PrimitiveType(gravitygl.TRIANGLES) Lines = PrimitiveType(gravitygl.LINES) Points = PrimitiveType(gravitygl.POINTS) )
Primitive types
const Version = "ep05-cea49a (expirimental/prototyping)"
Version ...
Variables ¶
var Callbacks = struct { CaptureModeOnChange func(bool) }{ CaptureModeOnChange: func(b bool) {}, }
Callbacks ...
var Log = GetLogRedirector()
var OnMouseMove = func(_ *glfw.Window, x, y float64) { _x, _y := float32(x), window.Height-float32(y) _mouse.Delta[0] = _x - Mouse.Position[0] _mouse.Delta[1] = _y - Mouse.Position[1] _mouse.Position[0] = _x _mouse.Position[1] = _y }
OnMouseMove ...
var OnMouseScroll = func(_ *glfw.Window, xoff float64, yoff float64) { _mouse.Scroll[0] += float32(xoff) _mouse.Scroll[1] += float32(yoff) }
OnMouseScroll ...
Functions ¶
func GetMaterialProgram ¶
GetMaterialProgram ...
func QuatToEulerDeg ¶
QuatToEulerDeg ...
func ScreenToGLCoords ¶
ScreenToGLCoords ...
func SetQuatFromEuler ¶
SetQuatFromEuler ...
func TextureDataFromImage ¶
TextureDataFromImage ... GL texture data really should aways be 4 wide (rgba). Fix this function to convert it if necessary.
func TextureImageFromFile ¶
TextureImageFromFile ...
func TextureRGBAFromFile ¶
TextureRGBAFromFile ...
Types ¶
type BaseMaterial ¶
type BaseMaterial struct { ID uint32 Primitive PrimitiveType Program *gravitygl.Program }
BaseMaterial ...
func (*BaseMaterial) SubmitUniforms ¶
func (mat *BaseMaterial) SubmitUniforms(ulist []UniformSubmission)
SubmitUniforms ...
type BaseObject ¶
type BaseObject struct { *Transformer Primitive PrimitiveType // contains filtered or unexported fields }
BaseObject ...
type Camera ¶
type Camera struct { *Transformer ProjectionMatrix mgl32.Mat4 ViewMatrix mgl32.Mat4 // contains filtered or unexported fields }
Camera ...
func (*Camera) ChangePerspective ¶
ChangePerspective ...
func (*Camera) GetYawPitch ¶
type ImageData ¶
ImageData ...
func NewImageDataFromFile ¶
NewImageDataFromFile ...
func NewImageDataFromImage ¶
NewImageDataFromImage ...
type Material ¶
type Material interface { GetBaseMaterial() *BaseMaterial PreRender() Render() }
Material ...
type Model ¶
type Model struct { *BaseObject Mesh *mesh.Mesh Mat Material // contains filtered or unexported fields }
Model ...
func (*Model) AddUniform ¶
AddUniform ...
type MouseInfo ¶
type MouseInfo struct { Position [2]float32 Delta [2]float32 Scroll [2]float32 // contains filtered or unexported fields }
MouseInfo ...
var Mouse MouseInfo
Mouse ...
type Redirector ¶
Redirector ...
type Texture ¶
type Texture struct { ImageData []*ImageData Unit uint32 ID uint32 TextureID uint32 Target uint32 Mips int32 Format int32 Originalformat uint32 MagFilter int32 MinFilter int32 WrapS int32 WrapT int32 WrapR int32 }
Texture ...
func NewCubeMap ¶
NewCubeMap ...
func NewTextureFromFile ¶
NewTextureFromFile ...
type TextureParameter ¶
type TextureParameter = uint32
TextureParameter ...
const ( WrapS TextureParameter = gravitygl.TEXTURE_WRAP_S WrapT TextureParameter = gravitygl.TEXTURE_WRAP_T WrapR TextureParameter = gravitygl.TEXTURE_WRAP_R MinFilter TextureParameter = gravitygl.TEXTURE_MIN_FILTER MagFilter TextureParameter = gravitygl.TEXTURE_MAG_FILTER )
Texture Paramaters
type Transformer ¶
type Transformer struct {
// contains filtered or unexported fields
}
Transformer ...
func (*Transformer) GetTransformMatrix ¶
func (t *Transformer) GetTransformMatrix() *mgl32.Mat4
GetTransformMatrix ...
func (*Transformer) SetPosition ¶
func (t *Transformer) SetPosition(x, y, z float32)
SetPosition ...
type UniformSubmission ¶
UniformSubmission ...