Contents User Forum Source Index APIs by Task APIs by Level Data


G3D::UprightSplineManipulator Class Reference

Allows recording and playback of a G3D::UprightSpline based on a G3D::GCamera. More...

#include <UprightSplineManipulator.h>

Inherits G3D::Manipulator.

List of all members.

Public Types

enum  Mode { RECORD_INTERVAL_MODE, RECORD_KEY_MODE, PLAY_MODE, INACTIVE_MODE }
typedef ReferenceCountedPointer<
class UprightSplineManipulator
Ref

Public Member Functions

GCameracamera ()
GCameracamera () const
void clear ()
bool cyclic () const
virtual void fireEvent (const GEvent &event)
virtual CoordinateFrame frame () const
virtual void getFrame (CoordinateFrame &c) const
Mode mode () const
virtual bool onEvent (const GEvent &event)
virtual void onLogic ()
virtual void onNetwork ()
virtual void onPose (Array< PosedModel::Ref > &posedArray, Array< PosedModel2DRef > &posed2DArray)=0
virtual void onPose (Array< PosedModelRef > &posedArray, Array< PosedModel2DRef > &posed2DArray)
virtual void onSimulation (RealTime rdt, SimTime sdt, SimTime idt)
virtual void onUserInput (UserInput *ui)
const Color3pathColor () const
GKey recordKey () const
void ReferenceCountedObject_zeroWeakPointers ()
void setCamera (GCamera *c)
void setCyclic (bool b)
virtual void setManager (WidgetManager *m)
void setMode (Mode m)
void setPathColor (const Color3 &c)
void setRecordKey (GKey k)
void setShowPath (bool b)
void setSpline (const UprightSpline &s)
void setTime (double t)
bool showPath () const
const UprightSplinespline () const
int splineSize () const
double time () const
virtual GWindowwindow () const

Static Public Member Functions

static Ref create (class GCamera *c=NULL)

Public Attributes

AtomicInt32 ReferenceCountedObject_refCount
_WeakPtrLinkedListReferenceCountedObject_weakPointer

Protected Member Functions

 UprightSplineManipulator ()

Protected Attributes

GCameram_camera
CoordinateFrame m_currentFrame
WidgetManagerm_manager
Mode m_mode
Color3 m_pathColor
GKey m_recordKey
const float m_sampleRate
bool m_showPath
UprightSpline m_spline
RealTime m_time


Detailed Description

Allows recording and playback of a G3D::UprightSpline based on a G3D::GCamera.

Used by G3D::CameraControlWindow.

See also:
G3D::UprightFrame, G3D::UprightSpline, G3D::FirstPersonManipulator


Member Typedef Documentation


Member Enumeration Documentation

RECORD_INTERVAL_MODE: Automatically add one frame per second to the spline, reading from the camera.

RECORD_KEY_MODE: Add one frame every time the recordKey() is pressed.

PLAY_MODE: Move the frame() through the spline over time. Does not mutate the camera.

INACTIVE_MODE: Do nothing.

The manipulator begins in INACTIVE_MODE.

Enumerator:
RECORD_INTERVAL_MODE 
RECORD_KEY_MODE 
PLAY_MODE 
INACTIVE_MODE 


Constructor & Destructor Documentation

G3D::UprightSplineManipulator::UprightSplineManipulator (  )  [protected]


Member Function Documentation

GCamera* G3D::UprightSplineManipulator::camera (  )  [inline]

GCamera* G3D::UprightSplineManipulator::camera (  )  const [inline]

void G3D::UprightSplineManipulator::clear (  ) 

Destroys the current path.

static Ref G3D::UprightSplineManipulator::create ( class GCamera c = NULL  )  [static]

bool G3D::UprightSplineManipulator::cyclic (  )  const [inline]

Does the spline wrap around to the first control point.

virtual void G3D::Widget::fireEvent ( const GEvent event  )  [virtual, inherited]

Fire an event on the containing window.

Reimplemented in G3D::WidgetManager.

virtual CoordinateFrame G3D::UprightSplineManipulator::frame (  )  const [virtual]

Implements G3D::Manipulator.

virtual void G3D::UprightSplineManipulator::getFrame ( CoordinateFrame c  )  const [virtual]

Implements G3D::Manipulator.

Mode G3D::UprightSplineManipulator::mode (  )  const

virtual bool G3D::UprightSplineManipulator::onEvent ( const GEvent event  )  [virtual]

Returning true consumes the event and prevents other GModules from seeing it.

Motion events (GEventType::MOUSEMOTION, GEventType::JOYHATMOTION, JGEventType::OYBALLMOTION, and GEventType::JOYAXISMOTION) cannot be cancelled.

Implements G3D::Widget.

virtual void G3D::UprightSplineManipulator::onLogic (  )  [inline, virtual]

Implements G3D::Widget.

virtual void G3D::UprightSplineManipulator::onNetwork (  )  [inline, virtual]

Implements G3D::Widget.

virtual void G3D::Widget::onPose ( Array< PosedModel::Ref > &  posedArray,
Array< PosedModel2DRef > &  posed2DArray 
) [pure virtual, inherited]

Appends a posed model for this object to the array, if it has a graphic representation.

The posed model appended is allowed to reference the agent and is allowed to mutate if the agent is mutated.

Implemented in G3D::FirstPersonManipulator, G3D::GConsole, G3D::ThirdPersonManipulator, and G3D::WidgetManager.

virtual void G3D::UprightSplineManipulator::onPose ( Array< PosedModelRef > &  posedArray,
Array< PosedModel2DRef > &  posed2DArray 
) [virtual]

virtual void G3D::UprightSplineManipulator::onSimulation ( RealTime  rdt,
SimTime  sdt,
SimTime  idt 
) [virtual]

Implements G3D::Widget.

virtual void G3D::UprightSplineManipulator::onUserInput ( UserInput ui  )  [virtual]

Implements G3D::Widget.

const Color3& G3D::UprightSplineManipulator::pathColor (  )  const [inline]

GKey G3D::UprightSplineManipulator::recordKey (  )  const [inline]

void G3D::ReferenceCountedObject::ReferenceCountedObject_zeroWeakPointers (  )  [inline, inherited]

Automatically called immediately before the object is deleted.

This is not called from the destructor because it needs to be invoked before the subclass destructor.

void G3D::UprightSplineManipulator::setCamera ( GCamera c  )  [inline]

Sets the camera from which the frame will be read when recording.

Argument may be NULL, but recording cannot proceed until this is non-null.

This camera will also be used for playback

void G3D::UprightSplineManipulator::setCyclic ( bool  b  )  [inline]

virtual void G3D::Widget::setManager ( WidgetManager m  )  [inline, virtual, inherited]

Called by the WidgetManager when this module is added to it.

The argument may be NULL

Reimplemented in G3D::DeveloperWindow.

void G3D::UprightSplineManipulator::setMode ( Mode  m  ) 

Setting the mode to RECORD_KEY_MODE and RECORD_INTERVAL_MODE require that a non-NULL camera have previously been set.

When in INACTIVE_MODE, time does not elapse for the manipulator.

void G3D::UprightSplineManipulator::setPathColor ( const Color3 c  )  [inline]

void G3D::UprightSplineManipulator::setRecordKey ( GKey  k  )  [inline]

void G3D::UprightSplineManipulator::setShowPath ( bool  b  )  [inline]

If set to true, the camera's path is shown as a glowing curve.

void G3D::UprightSplineManipulator::setSpline ( const UprightSpline s  )  [inline]

void G3D::UprightSplineManipulator::setTime ( double  t  ) 

Time since the beginning of recording or playback.

bool G3D::UprightSplineManipulator::showPath (  )  const [inline]

const UprightSpline& G3D::UprightSplineManipulator::spline (  )  const [inline]

Returns the underlying spline.

int G3D::UprightSplineManipulator::splineSize (  )  const [inline]

Number of control points.

double G3D::UprightSplineManipulator::time (  )  const [inline]

virtual GWindow* G3D::Widget::window (  )  const [virtual, inherited]

Returns the operating system window that is currently rendering this Widget.

Reimplemented in G3D::WidgetManager.


Member Data Documentation

WidgetManager* G3D::Widget::m_manager [protected, inherited]

The manager, set by setManager().

This cannot be a reference counted pointer because that would create a cycle between the Widget and its manager.

samples per second

Current time during playback.

The long name is to keep this from accidentally conflicting with a subclass's variable name.

Do not use or explicitly manipulate this value--its type may change in the future and is not part of the supported API.

Linked list of all weak pointers that reference this (some may be on the stack!).

Do not use or explicitly manipulate this value.


The documentation for this class was generated from the following file:
Generated on Thu Aug 2 11:40:48 2007 for G3D by doxygen 1.5.2
Hosted by SourceForge.net Logo