danaugrs 7 lat temu
rodzic
commit
c9e60f8512
4 zmienionych plików z 4 dodań i 15 usunięć
  1. 2 2
      gui/scroller.go
  2. 1 10
      math32/box3.go
  3. 0 2
      math32/plane.go
  4. 1 1
      renderer/shaman.go

+ 2 - 2
gui/scroller.go

@@ -5,8 +5,8 @@
 package gui
 
 import (
-	"github.com/g3n/engine/window"
 	"github.com/g3n/engine/math32"
+	"github.com/g3n/engine/window"
 )
 
 // Scroller is the GUI element that allows scrolling of a target IPanel.
@@ -299,7 +299,7 @@ func (s *Scroller) onScroll(evname string, ev interface{}) {
 	vScrollVisible := (s.vscroll != nil) && s.vscroll.Visible()
 	hScrollVisible := (s.hscroll != nil) && s.hscroll.Visible()
 
-	mult := float32(1)/float32(10)
+	mult := float32(1) / float32(10)
 	offsetX := sev.Xoffset * mult
 	offsetY := sev.Yoffset * mult
 

+ 1 - 10
math32/box3.go

@@ -239,16 +239,7 @@ func (b *Box3) Union(other *Box3) *Box3 {
 // Returns pointer to this updated bounding box.
 func (b *Box3) ApplyMatrix4(matrix *Matrix4) *Box3 {
 
-	points := []Vector3{
-		Vector3{},
-		Vector3{},
-		Vector3{},
-		Vector3{},
-		Vector3{},
-		Vector3{},
-		Vector3{},
-		Vector3{},
-	}
+	points := make([]Vector3, 8)
 
 	points[0].Set(b.Min.X, b.Min.Y, b.Min.Z).ApplyMatrix4(matrix) // 000
 	points[1].Set(b.Min.X, b.Min.Y, b.Max.Z).ApplyMatrix4(matrix) // 001

+ 0 - 2
math32/plane.go

@@ -4,8 +4,6 @@
 
 package math32
 
-import ()
-
 // Plane represents a plane in 3D space by its normal vector and a constant.
 // When the the normal vector is the unit vector the constant is the distance from the origin.
 type Plane struct {

+ 1 - 1
renderer/shaman.go

@@ -328,7 +328,7 @@ func (ss *ShaderSpecs) compareDefines(other *ShaderSpecs) bool {
 		if len(ss.Defines) != len(other.Defines) {
 			return false
 		}
-		for k, _ := range ss.Defines {
+		for k := range ss.Defines {
 			v1, ok1 := ss.Defines[k]
 			v2, ok2 := other.Defines[k]
 			if v1 != v2 || ok1 != ok2 {