Documentation
¶
Index ¶
- Constants
- Variables
- func Abs(f float32) float32
- func AbsI(i int32) int32
- func Asin(f float32) float32
- func Atan2(y, x float32) float32
- func Clamp(value, min, max float32) float32
- func Deg2Rad(deg float32) float32
- func DotProduct(v1, v2 *Vec3) float32
- func Equal(y, x float32) bool
- func FastInvSqrt(x float32) float32
- func LengthSquared(x, y, z float32) float32
- func LengthXY(x, y float32) float32
- func LengthXYZ(x, y, z float32) float32
- func Lerp(start, end, t float32) float32
- func Max(a, b float32) float32
- func MaxI(a, b int32) int32
- func Min(a, b float32) float32
- func MinI(a, b int32) int32
- func MinMaxI(a, b int32) (int32, int32)
- func NextPow2(x uint32) uint32
- func SinCos(angle float32) (s, c float32)
- func Sqrt(f float32) float32
- func Tan(f float32) float32
- func Vec2Equals(v1, v2 *Vec2) bool
- func Vec3Equals(v1, v2 *Vec3) bool
- type AABB
- type Frustrum
- type Line2I
- type Mat3x3
- type Mat4x4
- func (m *Mat4x4) CopyInverseFrom(src Mat4x4) error
- func (m *Mat4x4) Frustum(left, right, bottom, top, near, far float32)
- func (m *Mat4x4) LookAt(eye, target, up Vec3)
- func (m *Mat4x4) MulVec4(v Vec4) Vec4
- func (m *Mat4x4) Ortho(left, right, bottom, top, near, far float32)
- func (m *Mat4x4) Perspective(zNear, zFar, fovy, aspect float32)
- func (m *Mat4x4) Ptr() uintptr
- func (m Mat4x4) SetIdentity()
- func (m *Mat4x4) SetMul(m1, m2 Mat4x4)
- func (m *Mat4x4) SetRotateX(radians float32)
- func (m *Mat4x4) SetRotateY(radians float32)
- func (m *Mat4x4) SetRotateZ(radians float32)
- func (m *Mat4x4) SetTransform(t *Transform)
- func (m *Mat4x4) String() string
- func (m *Mat4x4) Transform2(location *Vec3, scale *Vec3, orient *Quat)
- func (m *Mat4x4) TranslateXYZ(x, y, z float32)
- func (m *Mat4x4) Transpose()
- type Plane
- type Quat
- func (q *Quat) FromEuler(v *Vec3)
- func (q *Quat) FromEulerXYZ(x, y, z float32)
- func (q *Quat) Mul(k *Quat)
- func (q *Quat) Normalize()
- func (q *Quat) Set(k *Quat)
- func (q *Quat) SetEulerXYZ(x, y, z float32)
- func (q *Quat) SetMul(v, k *Quat)
- func (q *Quat) SetQuat(a *Quat)
- func (q *Quat) SetSum(a, b *Quat)
- func (q *Quat) SetXYZW(x, y, z, w float32)
- func (q *Quat) SetZeroRotation()
- func (q *Quat) ToEuler() (yaw, pitch, roll float32)
- type Ray
- type Rect
- type RectI
- type Sphere
- type Transform
- type Vec2
- type Vec2I
- type Vec3
- func (v *Vec3) Add(k Vec3)
- func (v *Vec3) AddVec3(k *Vec3)
- func (v *Vec3) AddXYZ(x, y, z float32)
- func (v *Vec3) ApplyMat3x3(m *Mat3x3)
- func (v *Vec3) ApplyMat4x4(m *Mat4x4)
- func (v *Vec3) ApplyQuat(q *Quat)
- func (v *Vec3) Distance(k Vec3) float32
- func (v *Vec3) DistanceTo(k *Vec3) float32
- func (v *Vec3) DistanceToSquared(k *Vec3) float32
- func (v *Vec3) EqEpsilon(k Vec3) bool
- func (v *Vec3) Length() float32
- func (v *Vec3) MarshalJSON() ([]byte, error)
- func (v *Vec3) Normalize()
- func (v *Vec3) Scale(factor float32)
- func (v *Vec3) Set(a *Vec3)
- func (v *Vec3) SetMax(x, y, z float32)
- func (v *Vec3) SetMin(x, y, z float32)
- func (v *Vec3) SetMul(a, b *Vec3)
- func (v *Vec3) SetSub(a, b *Vec3)
- func (v *Vec3) SetSubVec3(k *Vec3)
- func (v *Vec3) SetSum(a, b *Vec3)
- func (v *Vec3) SetXYZ(x, y, z float32)
- func (v *Vec3) String() string
- func (v *Vec3) Sub(k Vec3)
- func (v *Vec3) UnmarshalJSON(data []byte) error
- type Vec4
Constants ¶
Variables ¶
View Source
var Mat3x3_Ident = Mat3x3{
1, 0, 0,
0, 1, 0,
0, 0, 1}
View Source
var Mat4x4_Ident = Mat4x4{
1, 0, 0, 0,
0, 1, 0, 0,
0, 0, 1, 0,
0, 0, 0, 1}
View Source
var TransformIdent = Transform{ Position: Vec3{0, 0, 0}, Rotation: Vec3{0, 0, 0}, Scale: Vec3{1, 1, 1}}
Functions ¶
func DotProduct ¶
func FastInvSqrt ¶
func LengthSquared ¶
func Vec2Equals ¶
func Vec3Equals ¶
Types ¶
type AABB ¶
type AABB struct {
Min, Max Vec3
}
func (*AABB) ContainsVec3 ¶
func (*AABB) IntersectAABB ¶
func (*AABB) IntersectSphere ¶
type Frustrum ¶
type Frustrum [6]Plane
func (*Frustrum) ContainsVec3 ¶
func (*Frustrum) IntersectSphere ¶
type Line2I ¶
func (*Line2I) NaiveLineDrawing ¶
type Mat3x3 ¶
type Mat3x3 [9]float32
func (*Mat3x3) FromQuaternion ¶
func (*Mat3x3) SetFormEulerXYZ ¶
func (*Mat3x3) SetIdentity ¶
func (m *Mat3x3) SetIdentity()
type Mat4x4 ¶
type Mat4x4 [16]float32
func (*Mat4x4) CopyInverseFrom ¶
func (*Mat4x4) Perspective ¶
func (Mat4x4) SetIdentity ¶
func (m Mat4x4) SetIdentity()
func (*Mat4x4) SetRotateX ¶
func (*Mat4x4) SetRotateY ¶
func (*Mat4x4) SetRotateZ ¶
func (*Mat4x4) SetTransform ¶
Transform Order is : Scale, Rotate, Translate
func (*Mat4x4) Transform2 ¶
TODO: do not remember if this correct
func (*Mat4x4) TranslateXYZ ¶
type Quat ¶
type Quat struct {
X, Y, Z, W float32
}
func (*Quat) FromEulerXYZ ¶
func (*Quat) SetEulerXYZ ¶
func (*Quat) SetZeroRotation ¶
func (q *Quat) SetZeroRotation()
type Sphere ¶
func (*Sphere) ContainsVec3 ¶
func (*Sphere) CylinderCoord ¶
func (*Sphere) DistanceToVec3 ¶
func (*Sphere) IntersectSphere ¶
type Vec3 ¶
type Vec3 struct{ X, Y, Z float32 }
func CrossProduct ¶
func (*Vec3) ApplyMat3x3 ¶
func (*Vec3) ApplyMat4x4 ¶
func (*Vec3) DistanceTo ¶
func (*Vec3) DistanceToSquared ¶
func (*Vec3) MarshalJSON ¶
func (*Vec3) SetSubVec3 ¶
func (*Vec3) UnmarshalJSON ¶
Click to show internal directories.
Click to hide internal directories.