Преглед на файлове

Refactor and improve docs in camera package

Daniel Salvadori преди 6 години
родител
ревизия
a09cc77d8d
променени са 3 файла, в които са добавени 20 реда и са изтрити 24 реда
  1. 18 0
      camera/camera.go
  2. 1 23
      camera/orthographic.go
  3. 1 1
      camera/perspective.go

+ 18 - 0
camera/camera.go

@@ -90,3 +90,21 @@ func (cam *Camera) ViewMatrix(m *math32.Matrix4) {
 		panic("Camera.ViewMatrix: Couldn't invert matrix")
 	}
 }
+
+// Project satisfies the ICamera interface and can be implemented for specific camera types.
+func (cam *Camera) Project(v *math32.Vector3) (*math32.Vector3, error) {
+
+	panic("Not implemented")
+}
+
+// Unproject satisfies the ICamera interface and can implemented for specific camera types.
+func (cam *Camera) Unproject(v *math32.Vector3) (*math32.Vector3, error) {
+
+	panic("Not implemented")
+}
+
+// SetRaycaster satisfies the ICamera interface and can implemented for specific camera types.
+func (cam *Camera) SetRaycaster(rc *core.Raycaster, x, y float32) error {
+
+	panic("Not implemented")
+}

+ 1 - 23
camera/orthographic.go

@@ -5,7 +5,6 @@
 package camera
 
 import (
-	"github.com/g3n/engine/core"
 	"github.com/g3n/engine/math32"
 )
 
@@ -19,7 +18,7 @@ type Orthographic struct {
 	near        float32 // near plane z coordinate
 	far         float32 // far plane z coordinate
 	zoom        float32
-	projChanged bool           // camera projection parameters changed (needs to recalculates projection matrix)
+	projChanged bool           // camera projection parameters changed (needs to recalculate projection matrix)
 	projMatrix  math32.Matrix4 // last calculated projection matrix
 }
 
@@ -78,24 +77,3 @@ func (cam *Orthographic) ProjMatrix(m *math32.Matrix4) {
 	}
 	*m = cam.projMatrix
 }
-
-// Project satisfies the ICamera interface and must
-// be implemented for specific camera types.
-func (cam *Camera) Project(v *math32.Vector3) (*math32.Vector3, error) {
-
-	panic("Not implemented")
-}
-
-// Unproject satisfies the ICamera interface and must
-// be implemented for specific camera types.
-func (cam *Camera) Unproject(v *math32.Vector3) (*math32.Vector3, error) {
-
-	panic("Not implemented")
-}
-
-// SetRaycaster satisfies the ICamera interface and must
-// be implemented for specific camera types.
-func (cam *Camera) SetRaycaster(rc *core.Raycaster, x, y float32) error {
-
-	panic("Not implemented")
-}

+ 1 - 1
camera/perspective.go

@@ -16,7 +16,7 @@ type Perspective struct {
 	aspect      float32        // aspect ratio (width/height)
 	near        float32        // near plane z coordinate
 	far         float32        // far plane z coordinate
-	projChanged bool           // camera projection parameters changed (needs to recalculates projection matrix)
+	projChanged bool           // camera projection parameters changed (needs to recalculate projection matrix)
 	projMatrix  math32.Matrix4 // last calculated projection matrix
 }