@@ -181,8 +181,10 @@ class View : public Snapshot
181181 virtual Real getPitch () { return m_pitch; } // /< Return current camera pitch
182182 virtual void setAngleToDefault (); // /< Set the view angle back to default
183183 virtual void setPitchToDefault (); // /< Set the view pitch back to default
184- void setPosition ( const Coord3D *pos ) { m_pos = *pos; }
185- void getPosition (Coord3D *pos) { *pos = m_pos;} // /< Returns position camera is looking at (z will be zero)
184+ void setPosition ( const Coord3D &pos ) { m_pos = pos; }
185+ void setPosition2D ( const Coord2D &pos ) { m_pos.x = pos.x ; m_pos.y = pos.y ; }
186+ const Coord3D &getPosition () const { return m_pos; } // /< Returns position camera is looking at
187+ Coord2D getPosition2D () const { Coord2D c = { m_pos.x , m_pos.y }; return c; } // /< Returns position camera is looking at
186188
187189 virtual const Coord3D& get3DCameraPosition () const = 0; // /< Returns the actual camera position
188190
@@ -195,7 +197,7 @@ class View : public Snapshot
195197 virtual void setOkToAdjustHeight ( Bool val ) { m_okToAdjustHeight = val; } // /< Set this to adjust camera height
196198
197199 // TheSuperHackers @info Functions to call for user camera controls, not by the scripted camera.
198- Bool userSetPosition (const Coord3D * pos) { return doUserAction (&View::setPosition, pos); }
200+ Bool userSetPosition (const Coord3D & pos) { return doUserAction (&View::setPosition, pos); }
199201 Bool userSetAngle (Real radians) { return doUserAction (&View::setAngle, radians); }
200202 Bool userSetAngleToDefault () { return doUserAction (&View::setAngleToDefault); }
201203 Bool userSetPitch (Real radians) { return doUserAction (&View::setPitch, radians); }
@@ -261,8 +263,6 @@ class View : public Snapshot
261263 virtual void xfer ( Xfer *xfer ) override ;
262264 virtual void loadPostProcess () override { }
263265
264- const Coord3D *getPosition () const { return &m_pos; }
265-
266266 virtual View *prependViewToList ( View *list ); // /< Prepend this view to the given list, return the new list
267267 virtual View *getNextView () { return m_next; } // /< Return next view in the set
268268
@@ -302,7 +302,7 @@ class View : public Snapshot
302302 UnsignedInt m_userControlLockedUntilFrame; // /< Locks the user control over camera until the given frame is reached
303303 Bool m_isUserControlled; // /< True if the user moved the camera last, false if the scripted camera moved the camera last
304304
305- Coord3D m_pos; // /< Pivot of the camera, in world coordinates // TheSuperHackers @todo Make this Coord2D or use the Z component
305+ Coord3D m_pos; // /< Pivot of the camera, in world coordinates
306306 Int m_width, m_height; // /< Dimensions of the view
307307 Int m_originX, m_originY; // /< Location of top/left view corner
308308
@@ -356,12 +356,10 @@ class ViewLocation
356356 Real getPitch () const { return m_pitch; }
357357 Real getZoom () const { return m_zoom; }
358358
359- void init (Real x, Real y, Real z , Real angle, Real pitch, Real zoom)
359+ void init (Coord3D pos , Real angle, Real pitch, Real zoom)
360360 {
361361 m_valid = true ;
362- m_pos.x = x;
363- m_pos.y = y;
364- m_pos.z = z;
362+ m_pos = pos;
365363 m_angle = angle;
366364 m_pitch = pitch;
367365 m_zoom = zoom;
0 commit comments