common

package
v0.0.0-...-a0ccc90 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2022 License: BSD-2-Clause Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Logger iLogger = &sDummyLogger{} // The Logger

Functions

func HexStringFromRGB

func HexStringFromRGB(rgb [3]float32) string

func HexStringFromRGBA

func HexStringFromRGBA(rgba [4]float32) string

func NewConsoleLogger

func NewConsoleLogger(loglevel any) iLogger

NewConsoleLogger() returns a sConsoleLogger, which prints log messages on os.Stdout.

`loglevel` can be LogLevel/int or string like "none","error","warn","info","debug","trace".

func NewDummyLogger

func NewDummyLogger() iLogger

NewDummyLogger() returns a sDummyLogger, which prints nothing.

func NewWriterLogger

func NewWriterLogger(loglevel any, writer io.Writer) iLogger

NewWriterLogger() returns a sWriterLogger, which prints log messages to the specified io.Writer.

`loglevel` can be LogLevel/int or string like "none","error","warn","info","debug","trace".

func RGBAFromHexString

func RGBAFromHexString(s string) [4]float32

func RGBFromHexString

func RGBFromHexString(s string) [3]float32

func SetLogger

func SetLogger(logger iLogger) iLogger

SetLogger() sets the current logger to be used.

`logger` should be the returned value of either NewConsoleLogger() or NewWriterLogger().

Types

type LogLevel

type LogLevel int
const (
	LogLevelNone  LogLevel = iota //
	LogLevelError                 // most important
	LogLevelWarn                  //
	LogLevelInfo                  // likely initial (default) log level
	LogLevelDebug                 //
	LogLevelTrace                 // most verbose
)

type Matrix3

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

func NewMatrix3

func NewMatrix3() *Matrix3

func (*Matrix3) Copy

func (self *Matrix3) Copy() *Matrix3

func (*Matrix3) GetElements

func (self *Matrix3) GetElements() *[9]float32

func (*Matrix3) MultiplyToTheLeft

func (self *Matrix3) MultiplyToTheLeft(matrix *Matrix3) *Matrix3

func (*Matrix3) MultiplyToTheRight

func (self *Matrix3) MultiplyToTheRight(matrix *Matrix3) *Matrix3

func (*Matrix3) MultiplyVector2

func (self *Matrix3) MultiplyVector2(v [2]float32) [2]float32

func (*Matrix3) Set

func (self *Matrix3) Set(v00 float32, v01 float32, v02 float32, v10 float32, v11 float32, v12 float32, v20 float32, v21 float32, v22 float32) *Matrix3

func (*Matrix3) SetCopy

func (self *Matrix3) SetCopy(m *Matrix3) *Matrix3

func (*Matrix3) SetIdentity

func (self *Matrix3) SetIdentity() *Matrix3

func (*Matrix3) SetMultiplyMatrices

func (self *Matrix3) SetMultiplyMatrices(matrices ...*Matrix3) *Matrix3

func (*Matrix3) SetRotation

func (self *Matrix3) SetRotation(angle_in_degree float32) *Matrix3

func (*Matrix3) SetScaling

func (self *Matrix3) SetScaling(sx float32, sy float32) *Matrix3

func (*Matrix3) SetTranslation

func (self *Matrix3) SetTranslation(tx float32, ty float32) *Matrix3

func (*Matrix3) SetTranspose

func (self *Matrix3) SetTranspose() *Matrix3

func (*Matrix3) Transpose

func (self *Matrix3) Transpose() *Matrix3

type Matrix4

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

func NewMatrix4

func NewMatrix4() *Matrix4

func (*Matrix4) Copy

func (self *Matrix4) Copy() *Matrix4

func (*Matrix4) GetElements

func (self *Matrix4) GetElements() *[16]float32

func (*Matrix4) MultiplyToTheLeft

func (self *Matrix4) MultiplyToTheLeft(matrix *Matrix4) *Matrix4

func (*Matrix4) MultiplyToTheRight

func (self *Matrix4) MultiplyToTheRight(matrix *Matrix4) *Matrix4

func (*Matrix4) MultiplyVector3

func (self *Matrix4) MultiplyVector3(v [3]float32) [3]float32

func (*Matrix4) Set

func (self *Matrix4) Set(
	v00 float32, v01 float32, v02 float32, v03 float32,
	v10 float32, v11 float32, v12 float32, v13 float32,
	v20 float32, v21 float32, v22 float32, v23 float32,
	v30 float32, v31 float32, v32 float32, v33 float32) *Matrix4

func (*Matrix4) SetCopy

func (self *Matrix4) SetCopy(m *Matrix4) *Matrix4

func (*Matrix4) SetIdentity

func (self *Matrix4) SetIdentity() *Matrix4

func (*Matrix4) SetMultiplyMatrices

func (self *Matrix4) SetMultiplyMatrices(matrices ...*Matrix4) *Matrix4

func (*Matrix4) SetRotationByAxis

func (self *Matrix4) SetRotationByAxis(axis [3]float32, angle_in_degree float32) *Matrix4

func (*Matrix4) SetScaling

func (self *Matrix4) SetScaling(sx float32, sy float32, sz float32) *Matrix4

func (*Matrix4) SetTranslation

func (self *Matrix4) SetTranslation(tx float32, ty float32, tz float32) *Matrix4

func (*Matrix4) SetTranspose

func (self *Matrix4) SetTranspose() *Matrix4

func (*Matrix4) Transpose

func (self *Matrix4) Transpose() *Matrix4

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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