Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

split api.Camera off from api.Observer

improving separation between 3D world and 3D view related stuff and
2D-only stuff
  • Loading branch information...
commit d617f8abd57bfad8828a557136bc6ba9e062cbea 1 parent 121f0db
@SethTisue SethTisue authored
View
2  headless/src/main/org/nlogo/agent/Camera.scala
@@ -4,7 +4,7 @@ package org.nlogo.agent
import org.nlogo.api
-trait Camera { self: Observer =>
+trait Camera extends api.Camera { self: Observer =>
private var _heading = 0.0
def heading = _heading
View
14 headless/src/main/org/nlogo/api/Camera.scala
@@ -0,0 +1,14 @@
+// (C) Uri Wilensky. https://github.com/NetLogo/NetLogo
+
+package org.nlogo.api
+
+trait Camera {
+ def dist: Double
+ def heading: Double
+ def pitch: Double
+ def roll: Double
+ def ozcor: Double
+ def dx: Double
+ def dy: Double
+ def dz: Double
+}
View
16 headless/src/main/org/nlogo/api/Observer.scala
@@ -2,31 +2,19 @@
package org.nlogo.api
-/**
- * Provides access to NetLogo observer
- */
-
-trait Observer extends Agent {
+trait Observer extends Agent with Camera {
/** Returns the currently watched or followed agent (or nobody) */
def targetAgent: Agent
/** Returns the current perspective */
def perspective: Perspective
+ def setPerspective(p: Perspective, a: Agent)
/** Returns the current distance behind the followed turtle the 3D view is displaying */
def followDistance: Int
- def dist: Double
- def heading: Double
- def pitch: Double
- def roll: Double
def oxcor: Double
def oycor: Double
- def ozcor: Double
- def dx: Double
- def dy: Double
- def dz: Double
- def setPerspective(p: Perspective, a: Agent)
}
Please sign in to comment.
Something went wrong with that request. Please try again.