Quellcode durchsuchen

Move helpers out of graphic and into util package

Daniel Salvadori vor 6 Jahren
Ursprung
Commit
79cde0e429
3 geänderte Dateien mit 15 neuen und 13 gelöschten Zeilen
  1. 6 6
      graphic/axis_helper.go
  2. 5 4
      graphic/grid_helper.go
  3. 4 3
      graphic/normals_helper.go

+ 6 - 6
graphic/axis_helper.go

@@ -2,27 +2,27 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-package graphic
+package util
 
 import (
 	"github.com/g3n/engine/geometry"
 	"github.com/g3n/engine/gls"
+	"github.com/g3n/engine/graphic"
 	"github.com/g3n/engine/material"
 	"github.com/g3n/engine/math32"
 )
 
-// AxisHelper is the visual representation of the three axes
+// AxisHelper is a visual representation of the three axes.
 type AxisHelper struct {
-	Lines
+	graphic.Lines
 }
 
-// NewAxisHelper returns a pointer to a new AxisHelper object
+// NewAxisHelper returns a pointer to a new AxisHelper object.
 func NewAxisHelper(size float32) *AxisHelper {
 
 	axis := new(AxisHelper)
 
-	// Creates geometry with three orthogonal lines
-	// starting at the origin
+	// Create geometry with three orthogonal lines starting at the origin
 	geom := geometry.NewGeometry()
 	positions := math32.NewArrayF32(0, 18)
 	positions.Append(

+ 5 - 4
graphic/grid_helper.go

@@ -2,22 +2,23 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-package graphic
+package util
 
 import (
 	"github.com/g3n/engine/geometry"
 	"github.com/g3n/engine/gls"
+	"github.com/g3n/engine/graphic"
 	"github.com/g3n/engine/material"
 	"github.com/g3n/engine/math32"
 )
 
-// GridHelper is the visual representation of a grid
+// GridHelper is a visual representation of a grid.
 type GridHelper struct {
-	Lines
+	graphic.Lines
 }
 
 // NewGridHelper creates and returns a pointer to a new grid help object
-// with the specified size and step
+// with the specified size and step.
 func NewGridHelper(size, step float32, color *math32.Color) *GridHelper {
 
 	grid := new(GridHelper)

+ 4 - 3
graphic/normals_helper.go

@@ -2,19 +2,20 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-package graphic
+package util
 
 import (
 	"github.com/g3n/engine/core"
 	"github.com/g3n/engine/geometry"
 	"github.com/g3n/engine/gls"
+	"github.com/g3n/engine/graphic"
 	"github.com/g3n/engine/material"
 	"github.com/g3n/engine/math32"
 )
 
 // NormalsHelper is the visual representation of the normals of a target object.
 type NormalsHelper struct {
-	Lines
+	graphic.Lines
 	size           float32
 	targetNode     *core.Node
 	targetGeometry *geometry.Geometry
@@ -22,7 +23,7 @@ type NormalsHelper struct {
 
 // NewNormalsHelper creates, initializes and returns a pointer to Normals helper object.
 // This helper shows the surface normals of the specified object.
-func NewNormalsHelper(ig IGraphic, size float32, color *math32.Color, lineWidth float32) *NormalsHelper {
+func NewNormalsHelper(ig graphic.IGraphic, size float32, color *math32.Color, lineWidth float32) *NormalsHelper {
 
 	// Creates new Normals helper
 	nh := new(NormalsHelper)