Skip to content

Commit

Permalink
Merge branch 'master' of github.com:ungerik/go3d
Browse files Browse the repository at this point in the history
  • Loading branch information
ungerik committed Feb 18, 2015
2 parents 23f59df + 40de6cd commit 4f51092
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 2 additions & 2 deletions mat3/mat3.go
Original file line number Diff line number Diff line change
Expand Up @@ -178,8 +178,8 @@ func (mat *T) AssignMat2x2(m *mat2.T) *T {
func (mat *T) MulVec3(v *vec3.T) vec3.T {
return vec3.T{
mat[0][0]*v[0] + mat[1][0]*v[1] + mat[2][0]*v[2],
mat[0][1]*v[1] + mat[1][1]*v[1] + mat[2][1]*v[2],
mat[0][2]*v[2] + mat[1][2]*v[1] + mat[2][2]*v[2],
mat[0][1]*v[0] + mat[1][1]*v[1] + mat[2][1]*v[2],
mat[0][2]*v[0] + mat[1][2]*v[1] + mat[2][2]*v[2],
}
}

Expand Down
4 changes: 3 additions & 1 deletion vec3/vec3.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,10 +107,12 @@ func (vec *T) LengthSqr() float32 {
}

// Scale multiplies all element of the vector by f and returns vec.
func (vec *T) Scale(f float32) {
func (vec *T) Scale(f float32) *T {
vec[0] *= f
vec[1] *= f
vec[2] *= f

return vec
}

// Scaled returns a copy of vec with all elements multiplies by f.
Expand Down

0 comments on commit 4f51092

Please sign in to comment.