Documentation ¶
Index ¶
- func DontNeedMATXAnyMore(matx *MATX)
- func DontNeedVECXAnyMore(vecx *VECX)
- type MATX
- func (self *MATX) Add(other *MATX) *MATX
- func (self *MATX) Add_InPlace(other *MATX)
- func (self *MATX) Address() *float32
- func (self *MATX) Di() int
- func (self *MATX) EqualsTo(other *MATX) bool
- func (self *MATX) GetEleByRowAndCol(row, col int) float32
- func (self *MATX) PrettyShow(logs ...string)
- func (self *MATX) RightMul_InPlace(other *MATX)
- func (self *MATX) Rotate4(rotation *VECX)
- func (self *MATX) SetByCol_InPlace(other *VECX, col int)
- func (self *MATX) SetEleByRowAndCol(row, col int, value float32)
- func (self *MATX) ToIdentity()
- func (self *MATX) Translate4(translate *VECX)
- type VECX
- func (self *VECX) Add(other *VECX, op ...bool) *VECX
- func (self *VECX) Add_InPlace(other *VECX, op ...bool)
- func (self *VECX) Clear()
- func (self *VECX) Di() int
- func (self *VECX) Dot(other *VECX) float32
- func (self *VECX) EqualsTo(other *VECX) bool
- func (self *VECX) GetIndexValue(index int) float32
- func (self *VECX) GrabColToVec(other *MATX, col int)
- func (self *VECX) Interpolation(other *VECX, t float32) *VECX
- func (self *VECX) Normalize()
- func (self *VECX) PrettyShow()
- func (self *VECX) RightMul_InPlace(other *MATX)
- func (self *VECX) Scale_InPlace(factor float32)
- func (self *VECX) SetIndexValue(index int, value float32)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DontNeedMATXAnyMore ¶
func DontNeedMATXAnyMore(matx *MATX)
when you dont need one MATX anymore, you should call this function
func DontNeedVECXAnyMore ¶
func DontNeedVECXAnyMore(vecx *VECX)
when you dont need one VECX anymore, you should call this function
Types ¶
type MATX ¶
type MATX struct {
// contains filtered or unexported fields
}
element in the data is arranged in column. For example: int a mat2 , data[0] == mat2[1][1], data[1] == mat2[2][1]
func GetMATX ¶
this is the only function that you should new-a-MATX the data inside the result is dirty, don't think they are zero-initialized
func (*MATX) Add ¶
mat math add, the result will be stored int another new-matx; mat3 and mat4 cannot add, so return nil on that condition;
func (*MATX) Add_InPlace ¶
mat math add in place, the result will be stored int self; mat3 and mat4 cannot add, so return with nothing changed on that condition
func (*MATX) GetEleByRowAndCol ¶
return matx[row][ele]
func (*MATX) PrettyShow ¶
read-only, pretty print the mat
func (*MATX) RightMul_InPlace ¶
self = other * self mat3 and vec4 cannot mul, so return nil on that condition;
func (*MATX) SetByCol_InPlace ¶
set one col with a vec in place note: col begins from 1 for humanity
func (*MATX) SetEleByRowAndCol ¶
matx[row][ele] = value
type VECX ¶
type VECX struct {
// contains filtered or unexported fields
}
func GetVECX ¶
this is the only function that you should new-a-VECX the data inside the result is dirty, don't think they are zero-initialized
func (*VECX) Add ¶
vec math add, the result will be stored int another new-vecx; vec3 and vec4 cannot add, so return nil on that condition;
func (*VECX) Add_InPlace ¶
vec math add in place, will store the result in self vec3 and vec4 cannot add, so return with nothing changed on that condition
func (*VECX) GetIndexValue ¶
read-only, return the index value node: index begins from 0
func (*VECX) GrabColToVec ¶
grab one col from matx to store in self
func (*VECX) Interpolation ¶
two vec interpolation t should be [0,1], but any other real number is supported
func (*VECX) RightMul_InPlace ¶
mat mul vec, the result will be stored in self; mat3 and vec4 cannot mul, so return nil on that condition;
func (*VECX) Scale_InPlace ¶
vec math scale in place, will store the result in self
func (*VECX) SetIndexValue ¶
set index value node: index begins from 0