Documentation ¶
Overview ¶
Package vpvec3 contains 3 members vector utilities.
Index ¶
- Constants
- type F32
- func F32Add(veca, vecb *F32) *F32
- func F32AxisX() *F32
- func F32AxisY() *F32
- func F32AxisZ() *F32
- func F32Cross(veca, vecb *F32) *F32
- func F32DivScale(vec *F32, factor float32) *F32
- func F32FromVec2(vec *vpvec2.F32, f float32) *F32
- func F32Homogeneous(vec *F32) *F32
- func F32Lerp(veca, vecb *F32, beta float32) *F32
- func F32Max(veca *F32, vecb *F32) *F32
- func F32Min(veca *F32, vecb *F32) *F32
- func F32MulScale(vec *F32, factor float32) *F32
- func F32Neg(vec *F32) *F32
- func F32New(f1, f2, f3 float32) *F32
- func F32Normalize(vec *F32) *F32
- func F32Sub(veca, vecb *F32) *F32
- func (vec *F32) Add(op *F32) *F32
- func (vec *F32) Cross(op *F32) *F32
- func (vec *F32) DivScale(factor float32) *F32
- func (vec *F32) Dot(op *F32) float32
- func (vec *F32) Homogeneous() *F32
- func (vec *F32) IsSimilar(op *F32) bool
- func (vec *F32) Length() float32
- func (vec *F32) Lerp(op *F32, beta float32) *F32
- func (vec *F32) Max(op *F32) *F32
- func (vec *F32) Min(op *F32) *F32
- func (vec *F32) MulScale(factor float32) *F32
- func (vec *F32) Neg() *F32
- func (vec *F32) Normalize() *F32
- func (vec *F32) SqMag() float32
- func (vec *F32) String() string
- func (vec *F32) Sub(op *F32) *F32
- func (vec *F32) ToF64() *F64
- func (vec *F32) ToI32() *I32
- func (vec *F32) ToI64() *I64
- func (vec *F32) ToVec2() *vpvec2.F32
- func (vec *F32) ToX32() *X32
- func (vec *F32) ToX64() *X64
- type F32BinaryOperator
- type F32UnaryOperator
- type F64
- func F64Add(veca, vecb *F64) *F64
- func F64AxisX() *F64
- func F64AxisY() *F64
- func F64AxisZ() *F64
- func F64Cross(veca, vecb *F64) *F64
- func F64DivScale(vec *F64, factor float64) *F64
- func F64FromVec2(vec *vpvec2.F64, f float64) *F64
- func F64Homogeneous(vec *F64) *F64
- func F64Lerp(veca, vecb *F64, beta float64) *F64
- func F64Max(veca *F64, vecb *F64) *F64
- func F64Min(veca *F64, vecb *F64) *F64
- func F64MulScale(vec *F64, factor float64) *F64
- func F64Neg(vec *F64) *F64
- func F64New(f1, f2, f3 float64) *F64
- func F64Normalize(vec *F64) *F64
- func F64Sub(veca, vecb *F64) *F64
- func (vec *F64) Add(op *F64) *F64
- func (vec *F64) Cross(op *F64) *F64
- func (vec *F64) DivScale(factor float64) *F64
- func (vec *F64) Dot(op *F64) float64
- func (vec *F64) Homogeneous() *F64
- func (vec *F64) IsSimilar(op *F64) bool
- func (vec *F64) Length() float64
- func (vec *F64) Lerp(op *F64, beta float64) *F64
- func (vec *F64) Max(op *F64) *F64
- func (vec *F64) Min(op *F64) *F64
- func (vec *F64) MulScale(factor float64) *F64
- func (vec *F64) Neg() *F64
- func (vec *F64) Normalize() *F64
- func (vec *F64) SqMag() float64
- func (vec *F64) String() string
- func (vec *F64) Sub(op *F64) *F64
- func (vec *F64) ToF32() *F32
- func (vec *F64) ToI32() *I32
- func (vec *F64) ToI64() *I64
- func (vec *F64) ToVec2() *vpvec2.F64
- func (vec *F64) ToX32() *X32
- func (vec *F64) ToX64() *X64
- type F64BinaryOperator
- type F64UnaryOperator
- type I32
- type I64
- type X32
- func X32Add(veca, vecb *X32) *X32
- func X32AxisX() *X32
- func X32AxisY() *X32
- func X32AxisZ() *X32
- func X32Cross(veca, vecb *X32) *X32
- func X32DivScale(vec *X32, factor vpnumber.X32) *X32
- func X32FromVec2(vec *vpvec2.X32, x vpnumber.X32) *X32
- func X32Homogeneous(vec *X32) *X32
- func X32Lerp(veca, vecb *X32, beta vpnumber.X32) *X32
- func X32Max(veca *X32, vecb *X32) *X32
- func X32Min(veca *X32, vecb *X32) *X32
- func X32MulScale(vec *X32, factor vpnumber.X32) *X32
- func X32Neg(vec *X32) *X32
- func X32New(x1, x2, x3 vpnumber.X32) *X32
- func X32Normalize(vec *X32) *X32
- func X32Sub(veca, vecb *X32) *X32
- func (vec *X32) Add(op *X32) *X32
- func (vec *X32) Cross(op *X32) *X32
- func (vec *X32) DivScale(factor vpnumber.X32) *X32
- func (vec *X32) Dot(op *X32) vpnumber.X32
- func (vec *X32) Homogeneous() *X32
- func (vec *X32) IsSimilar(op *X32) bool
- func (vec *X32) Length() vpnumber.X32
- func (vec *X32) Lerp(op *X32, beta vpnumber.X32) *X32
- func (vec *X32) Max(op *X32) *X32
- func (vec *X32) Min(op *X32) *X32
- func (vec *X32) MulScale(factor vpnumber.X32) *X32
- func (vec *X32) Neg() *X32
- func (vec *X32) Normalize() *X32
- func (vec *X32) SqMag() vpnumber.X32
- func (vec *X32) String() string
- func (vec *X32) Sub(op *X32) *X32
- func (vec *X32) ToF32() *F32
- func (vec *X32) ToF64() *F64
- func (vec *X32) ToI32() *I32
- func (vec *X32) ToI64() *I64
- func (vec *X32) ToVec2() *vpvec2.X32
- func (vec *X32) ToX64() *X64
- type X32BinaryOperator
- type X32UnaryOperator
- type X64
- func X64Add(veca, vecb *X64) *X64
- func X64AxisX() *X64
- func X64AxisY() *X64
- func X64AxisZ() *X64
- func X64Cross(veca, vecb *X64) *X64
- func X64DivScale(vec *X64, factor vpnumber.X64) *X64
- func X64FromVec2(vec *vpvec2.X64, x vpnumber.X64) *X64
- func X64Homogeneous(vec *X64) *X64
- func X64Lerp(veca, vecb *X64, beta vpnumber.X64) *X64
- func X64Max(veca *X64, vecb *X64) *X64
- func X64Min(veca *X64, vecb *X64) *X64
- func X64MulScale(vec *X64, factor vpnumber.X64) *X64
- func X64Neg(vec *X64) *X64
- func X64New(x1, x2, x3 vpnumber.X64) *X64
- func X64Normalize(vec *X64) *X64
- func X64Sub(veca, vecb *X64) *X64
- func (vec *X64) Add(op *X64) *X64
- func (vec *X64) Cross(op *X64) *X64
- func (vec *X64) DivScale(factor vpnumber.X64) *X64
- func (vec *X64) Dot(op *X64) vpnumber.X64
- func (vec *X64) Homogeneous() *X64
- func (vec *X64) IsSimilar(op *X64) bool
- func (vec *X64) Length() vpnumber.X64
- func (vec *X64) Lerp(op *X64, beta vpnumber.X64) *X64
- func (vec *X64) Max(op *X64) *X64
- func (vec *X64) Min(op *X64) *X64
- func (vec *X64) MulScale(factor vpnumber.X64) *X64
- func (vec *X64) Neg() *X64
- func (vec *X64) Normalize() *X64
- func (vec *X64) SqMag() vpnumber.X64
- func (vec *X64) String() string
- func (vec *X64) Sub(op *X64) *X64
- func (vec *X64) ToF32() *F32
- func (vec *X64) ToF64() *F64
- func (vec *X64) ToI32() *I32
- func (vec *X64) ToI64() *I64
- func (vec *X64) ToVec2() *vpvec2.X64
- func (vec *X64) ToX32() *X32
- type X64BinaryOperator
- type X64UnaryOperator
Constants ¶
const ( // X is the index of the x coordinate within a vector. X = iota // Y is the index of the y coordinate within a vector. Y // Z is the index of the z coordinate within a vector. Z // Size is the number of elements in a vector. Size )
const PackageCopyright = "Copyright (C) 2015, 2016 Christian Mauduit <ufoot@ufoot.org>" // PackageCopyright set by version.sh
PackageCopyright contains a short copyright notice.
const PackageEmail = "ufoot@ufoot.org" // PackageEmail set by version.sh
PackageEmail contains a contact email for the package.
const PackageLicense = "GNU GPL v3" // PackageLicense set by version.sh
PackageLicense contains a short license information.
const PackageName = "Vapor Toolkit" // PackageName set by version.sh
PackageName contains a readable name of the package, suitable for display.
const PackageTarname = "vapor" // PackageTarname set by version.sh
PackageTarname contains a short name of the package, suitable for a filename.
const PackageURL = "https://github.com/ufoot/vapor" // PackageURL set by version.sh
PackageURL contains the address of the project homepage.
const VersionMajor = 0 // VersionMajor set by version.sh
VersionMajor is the project major version.
const VersionMinor = 3 // VersionMinor set by version.sh
VersionMinor is the project minor version.
const VersionStamp = "c6a4298" // VersionStamp set by version.sh
VersionStamp is the project stamp, possibly changes for each build.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type F32 ¶
F32 is a vector containing 3 float32 values. Can hold the values of a point in space.
func F32Add ¶
F32Add adds two vectors. Args are left untouched, a pointer on a new object is returned.
func F32Cross ¶
F32Cross returns the the cross product of two vectors. Args are left untouched, a pointer on a new object is returned.
func F32DivScale ¶
F32DivScale divides all values of a vector by a scalar. Args are left untouched, a pointer on a new object is returned.
func F32FromVec2 ¶
F32FromVec2 creates a new vector from a smaller one, by appending a value at its end.
func F32Homogeneous ¶
F32Homogeneous scales the vector so that its latest member is 1. This what we want to do when projecting, to have homegemous coords. Arg is left untouched, a pointer on a new object is returned.
func F32Max ¶
F32Max returns the mininum (member-wise) of two vectors. Args are left untouched, a pointer on a new object is returned.
func F32Min ¶
F32Min returns the mininum (member-wise) of two vectors. Args are left untouched, a pointer on a new object is returned.
func F32MulScale ¶
F32MulScale multiplies all values of a vector by a scalar. Args are left untouched, a pointer on a new object is returned.
func F32Neg ¶
F32Neg changes the sign of all vector members. Arg is left untouched, a pointer on a new object is returned.
func F32Normalize ¶
F32Normalize scales a vector so that its length is 1. Arg is left untouched, a pointer on a new object is returned.
func F32Sub ¶
F32Sub substracts vector b from vector a. Args are left untouched, a pointer on a new object is returned.
func (*F32) Add ¶
Add adds operand to the vector. It modifies the vector, and returns a pointer on it.
func (*F32) Cross ¶
Cross returns the the cross product of two vectors. It modifies the vector, and returns a pointer on it.
func (*F32) DivScale ¶
DivScale divides all values of the vector by factor. It modifies the vector, and returns a pointer on it.
func (*F32) Homogeneous ¶
Homogeneous scales the vector so that its latest member is 1. This what we want to do when projecting, to have homegemous coords. It modifies the vector, and returns a pointer on it.
func (*F32) IsSimilar ¶
IsSimilar returns true if vectors are approximatively the same. This is a workarround to ignore rounding errors.
func (*F32) Max ¶
Max returns the maximum of all vector members. It modifies the vector, and returns a pointer on it.
func (*F32) Min ¶
Min returns the minimum of all vector members. It modifies the vector, and returns a pointer on it.
func (*F32) MulScale ¶
MulScale multiplies all values of the vector by factor. It modifies the vector, and returns a pointer on it.
func (*F32) Neg ¶
Neg changes the sign of all vector members. It modifies the vector, and returns a pointer on it.
func (*F32) Normalize ¶
Normalize scales the vector so that its length is 1. It modifies the vector, and returns a pointer on it.
func (*F32) SqMag ¶
SqMag returns the sum of the squares of all values. It is used to calculate length, it is faster than the complete length calculation, as it does not perform a square root.
func (*F32) Sub ¶
Sub substracts operand from the vector. It modifies the vector, and returns a pointer on it.
type F32BinaryOperator ¶
F32BinaryOperator designs funcs such as Add, Sub, Min, Max, which operates on two vectors and return one.
type F32UnaryOperator ¶
F32UnaryOperator designs funcs such as Neg, which operates on one vector and returns another vector.
type F64 ¶
F64 is a vector containing 3 float64 values. Can hold the values of a point in space.
func F64Add ¶
F64Add adds two vectors. Args are left untouched, a pointer on a new object is returned.
func F64Cross ¶
F64Cross returns the the cross product of two vectors. Args are left untouched, a pointer on a new object is returned.
func F64DivScale ¶
F64DivScale divides all values of a vector by a scalar. Args are left untouched, a pointer on a new object is returned.
func F64FromVec2 ¶
F64FromVec2 creates a new vector from a smaller one, by appending a value at its end.
func F64Homogeneous ¶
F64Homogeneous scales the vector so that its latest member is 1. This what we want to do when projecting, to have homegemous coords. Arg is left untouched, a pointer on a new object is returned.
func F64Max ¶
F64Max returns the mininum (member-wise) of two vectors. Args are left untouched, a pointer on a new object is returned.
func F64Min ¶
F64Min returns the mininum (member-wise) of two vectors. Args are left untouched, a pointer on a new object is returned.
func F64MulScale ¶
F64MulScale multiplies all values of a vector by a scalar. Args are left untouched, a pointer on a new object is returned.
func F64Neg ¶
F64Neg changes the sign of all vector members. Arg is left untouched, a pointer on a new object is returned.
func F64Normalize ¶
F64Normalize scales a vector so that its length is 1. Arg is left untouched, a pointer on a new object is returned.
func F64Sub ¶
F64Sub substracts vector b from vector a. Args are left untouched, a pointer on a new object is returned.
func (*F64) Add ¶
Add adds operand to the vector. It modifies the vector, and returns a pointer on it.
func (*F64) Cross ¶
Cross returns the the cross product of two vectors. It modifies the vector, and returns a pointer on it.
func (*F64) DivScale ¶
DivScale divides all values of the vector by factor. It modifies the vector, and returns a pointer on it.
func (*F64) Homogeneous ¶
Homogeneous scales the vector so that its latest member is 1. This what we want to do when projecting, to have homegemous coords. It modifies the vector, and returns a pointer on it.
func (*F64) IsSimilar ¶
IsSimilar returns true if vectors are approximatively the same. This is a workarround to ignore rounding errors.
func (*F64) Max ¶
Max returns the maximum of all vector members. It modifies the vector, and returns a pointer on it.
func (*F64) Min ¶
Min returns the minimum of all vector members. It modifies the vector, and returns a pointer on it.
func (*F64) MulScale ¶
MulScale multiplies all values of the vector by factor. It modifies the vector, and returns a pointer on it.
func (*F64) Neg ¶
Neg changes the sign of all vector members. It modifies the vector, and returns a pointer on it.
func (*F64) Normalize ¶
Normalize scales the vector so that its length is 1. It modifies the vector, and returns a pointer on it.
func (*F64) SqMag ¶
SqMag returns the sum of the squares of all values. It is used to calculate length, it is faster than the complete length calculation, as it does not perform a square root.
func (*F64) Sub ¶
Sub substracts operand from the vector. It modifies the vector, and returns a pointer on it.
type F64BinaryOperator ¶
F64BinaryOperator designs funcs such as Add, Sub, Min, Max, which operates on two vectors and return one.
type F64UnaryOperator ¶
F64UnaryOperator designs funcs such as Neg, which operates on one vector and returns another vector.
type I32 ¶
I32 is a vector containing 3 int32 values. Can hold the values of a point in a plane.
func I32Add ¶
I32Add adds two vectors. Args are left untouched, a pointer on a new object is returned.
func I32Neg ¶
I32Neg changes the sign of all vector members. Arg is left untouched, a pointer on a new object is returned.
func I32Sub ¶
I32Sub substracts vector b from vector a. Args are left untouched, a pointer on a new object is returned.
func (*I32) Add ¶
Add adds operand to the vector. It modifies the vector, and returns a pointer on it.
func (*I32) Neg ¶
Neg changes the sign of all vector members. It modifies the vector, and returns a pointer on it.
func (*I32) Sub ¶
Sub substracts operand from the vector. It modifies the vector, and returns a pointer on it.
type I64 ¶
I64 is a vector containing 3 int64 values. Can hold the values of a point in a plane.
func I64Add ¶
I64Add adds two vectors. Args are left untouched, a pointer on a new object is returned.
func I64Neg ¶
I64Neg changes the sign of all vector members. Arg is left untouched, a pointer on a new object is returned.
func I64Sub ¶
I64Sub substracts vector b from vector a. Args are left untouched, a pointer on a new object is returned.
func (*I64) Add ¶
Add adds operand to the vector. It modifies the vector, and returns a pointer on it.
func (*I64) Neg ¶
Neg changes the sign of all vector members. It modifies the vector, and returns a pointer on it.
func (*I64) Sub ¶
Sub substracts operand from the vector. It modifies the vector, and returns a pointer on it.
type X32 ¶
X32 is a vector containing 3 fixed point 32 bit values. Can hold the values of a point in space.
func X32Add ¶
X32Add adds two vectors. Args are left untouched, a pointer on a new object is returned.
func X32Cross ¶
X32Cross returns the the cross product of two vectors. Args are left untouched, a pointer on a new object is returned.
func X32DivScale ¶
X32DivScale divides all values of a vector by a scalar. Args are left untouched, a pointer on a new object is returned.
func X32FromVec2 ¶
X32FromVec2 creates a new vector from a smaller one, by appending a value at its end.
func X32Homogeneous ¶
X32Homogeneous scales the vector so that its latest member is 1. This what we want to do when projecting, to have homegemous coords. Arg is left untouched, a pointer on a new object is returned.
func X32Max ¶
X32Max returns the mininum (member-wise) of two vectors. Args are left untouched, a pointer on a new object is returned.
func X32Min ¶
X32Min returns the mininum (member-wise) of two vectors. Args are left untouched, a pointer on a new object is returned.
func X32MulScale ¶
X32MulScale multiplies all values of a vector by a scalar. Args are left untouched, a pointer on a new object is returned.
func X32Neg ¶
X32Neg changes the sign of all vector members. Arg is left untouched, a pointer on a new object is returned.
func X32Normalize ¶
X32Normalize scales a vector so that its length is 1. Arg is left untouched, a pointer on a new object is returned.
func X32Sub ¶
X32Sub substracts vector b from vector a. Args are left untouched, a pointer on a new object is returned.
func (*X32) Add ¶
Add adds operand to the vector. It modifies the vector, and returns a pointer on it.
func (*X32) Cross ¶
Cross returns the the cross product of two vectors. It modifies the vector, and returns a pointer on it.
func (*X32) DivScale ¶
DivScale divides all values of the vector by factor. It modifies the vector, and returns a pointer on it.
func (*X32) Homogeneous ¶
Homogeneous scales the vector so that its latest member is 1. This what we want to do when projecting, to have homegemous coords. It modifies the vector, and returns a pointer on it.
func (*X32) IsSimilar ¶
IsSimilar returns true if vectors are approximatively the same. This is a workarround to ignore rounding errors.
func (*X32) Max ¶
Max returns the maximum of all vector members. It modifies the vector, and returns a pointer on it.
func (*X32) Min ¶
Min returns the minimum of all vector members. It modifies the vector, and returns a pointer on it.
func (*X32) MulScale ¶
MulScale multiplies all values of the vector by factor. It modifies the vector, and returns a pointer on it.
func (*X32) Neg ¶
Neg changes the sign of all vector members. It modifies the vector, and returns a pointer on it.
func (*X32) Normalize ¶
Normalize scales the vector so that its length is 1. It modifies the vector, and returns a pointer on it.
func (*X32) SqMag ¶
SqMag returns the sum of the squares of all values. It is used to calculate length, it is faster than the complete length calculation, as it does not perform a square root.
func (*X32) Sub ¶
Sub substracts operand from the vector. It modifies the vector, and returns a pointer on it.
type X32BinaryOperator ¶
X32BinaryOperator designs funcs such as Add, Sub, Min, Max, which operates on two vectors and return one.
type X32UnaryOperator ¶
X32UnaryOperator designs funcs such as Neg, which operates on one vector and returns another vector.
type X64 ¶
X64 is a vector containing 3 fixed point 64 bit values. Can hold the values of a point in space.
func X64Add ¶
X64Add adds two vectors. Args are left untouched, a pointer on a new object is returned.
func X64Cross ¶
X64Cross returns the the cross product of two vectors. Args are left untouched, a pointer on a new object is returned.
func X64DivScale ¶
X64DivScale divides all values of a vector by a scalar. Args are left untouched, a pointer on a new object is returned.
func X64FromVec2 ¶
X64FromVec2 creates a new vector from a smaller one, by appending a value at its end.
func X64Homogeneous ¶
X64Homogeneous scales the vector so that its latest member is 1. This what we want to do when projecting, to have homegemous coords. Arg is left untouched, a pointer on a new object is returned.
func X64Max ¶
X64Max returns the mininum (member-wise) of two vectors. Args are left untouched, a pointer on a new object is returned.
func X64Min ¶
X64Min returns the mininum (member-wise) of two vectors. Args are left untouched, a pointer on a new object is returned.
func X64MulScale ¶
X64MulScale multiplies all values of a vector by a scalar. Args are left untouched, a pointer on a new object is returned.
func X64Neg ¶
X64Neg changes the sign of all vector members. Arg is left untouched, a pointer on a new object is returned.
func X64Normalize ¶
X64Normalize scales a vector so that its length is 1. Arg is left untouched, a pointer on a new object is returned.
func X64Sub ¶
X64Sub substracts vector b from vector a. Args are left untouched, a pointer on a new object is returned.
func (*X64) Add ¶
Add adds operand to the vector. It modifies the vector, and returns a pointer on it.
func (*X64) Cross ¶
Cross returns the the cross product of two vectors. It modifies the vector, and returns a pointer on it.
func (*X64) DivScale ¶
DivScale divides all values of the vector by factor. It modifies the vector, and returns a pointer on it.
func (*X64) Homogeneous ¶
Homogeneous scales the vector so that its latest member is 1. This what we want to do when projecting, to have homegemous coords. It modifies the vector, and returns a pointer on it.
func (*X64) IsSimilar ¶
IsSimilar returns true if vectors are approximatively the same. This is a workarround to ignore rounding errors.
func (*X64) Max ¶
Max returns the maximum of all vector members. It modifies the vector, and returns a pointer on it.
func (*X64) Min ¶
Min returns the minimum of all vector members. It modifies the vector, and returns a pointer on it.
func (*X64) MulScale ¶
MulScale multiplies all values of the vector by factor. It modifies the vector, and returns a pointer on it.
func (*X64) Neg ¶
Neg changes the sign of all vector members. It modifies the vector, and returns a pointer on it.
func (*X64) Normalize ¶
Normalize scales the vector so that its length is 1. It modifies the vector, and returns a pointer on it.
func (*X64) SqMag ¶
SqMag returns the sum of the squares of all values. It is used to calculate length, it is faster than the complete length calculation, as it does not perform a square root.
func (*X64) Sub ¶
Sub substracts operand from the vector. It modifies the vector, and returns a pointer on it.
type X64BinaryOperator ¶
X64BinaryOperator designs funcs such as Add, Sub, Min, Max, which operates on two vectors and return one.
type X64UnaryOperator ¶
X64UnaryOperator designs funcs such as Neg, which operates on one vector and returns another vector.