Support Forum       Library Source       SourceForge Page       G3D Web Page     
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
G3D::UprightSplineManipulator Class Reference

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

Inherits G3D::Manipulator.

Public Types

enum  Mode {
  RECORD_INTERVAL_MODE,
  RECORD_KEY_MODE,
  PLAY_MODE,
  INACTIVE_MODE
}
 RECORD_INTERVAL_MODE: Automatically add one frame per second to the spline, reading from the camera. More...
 
typedef shared_ptr< class
UprightSplineManipulator
Ref
 

Public Member Functions

virtual Rect2D bounds () const
 Inherited from Surface2D.
 
const shared_ptr< Camera > & camera () const
 
shared_ptr< Cameracamera ()
 
void clear ()
 Destroys the current path.
 
bool cyclic () const
 Does the spline wrap around to the first control point.
 
virtual float depth () const
 Inherited from Surface2D.
 
virtual void fireEvent (const GEvent &event)
 Fire an event on the containing window.
 
virtual CoordinateFrame frame () const
 
virtual void getFrame (CoordinateFrame &c) const
 
WidgetManagermanager () const
 
Mode mode () const
 
virtual void onAI ()
 
virtual bool onEvent (const GEvent &event)
 Returning true consumes the event and prevents other GModules from seeing it.
 
virtual void onNetwork ()
 
virtual void onPose (Array< shared_ptr< Surface > > &surfaceArray, Array< shared_ptr< Surface2D > > &surface2DArray)
 Appends a posed model for this object to the array, if it has a graphic representation.
 
virtual void onPose (Array< shared_ptr< Surface > > &posedArray, Array< Surface2DRef > &posed2DArray)
 
virtual void onSimulation (RealTime rdt, SimTime sdt, SimTime idt)
 
virtual void onUserInput (UserInput *ui)
 
const Color3pathColor () const
 
GKey recordKey () const
 
virtual void render (RenderDevice *rd) const
 Inherited from Surface2D.
 
void setCamera (const shared_ptr< Camera > &c)
 Sets the camera from which the frame will be read when recording.
 
void setCyclic (bool b)
 
virtual void setDepth (float d)
 Called by the WidgetManager.
 
virtual void setManager (WidgetManager *m)
 Called by the WidgetManager when this module is added to it.
 
void setMode (Mode m)
 Setting the mode to RECORD_KEY_MODE and RECORD_INTERVAL_MODE require that a non-NULL camera have previously been set.
 
void setPathColor (const Color3 &c)
 
void setRecordKey (GKey k)
 
void setShowPath (bool b)
 If set to true, the camera's path is shown as a glowing curve.
 
void setSpline (const UprightSpline &s)
 
void setTime (double t)
 Time since the beginning of recording or playback.
 
bool showPath () const
 
const UprightSplinespline () const
 Returns the underlying spline.
 
int splineSize () const
 Number of control points.
 
double time () const
 
virtual OSWindowwindow () const
 Returns the operating system window that is currently rendering this Widget.
 

Static Public Member Functions

static Ref create (const shared_ptr< class Camera > &c=shared_ptr< Camera >())
 
static void sort (Array< Surface2DRef > &array)
 Sorts from farthest to nearest.
 
static void sortAndRender (RenderDevice *rd, Array< Surface2DRef > &array)
 Calls sort, RenderDevice::push2D, and then render on all elements.
 

Protected Member Functions

 UprightSplineManipulator ()
 
UprightSplineManipulatoroperator= (const UprightSplineManipulator &)
 

Protected Attributes

shared_ptr< class Cameram_camera
 
CoordinateFrame m_currentFrame
 
float m_depth
 
WidgetManagerm_manager
 The manager, set by setManager().
 
Mode m_mode
 
Color3 m_pathColor
 
GKey m_recordKey
 
const float m_sampleRate
 samples per second
 
bool m_showPath
 
UprightSpline m_spline
 
RealTime m_time
 Current time during playback.
 

Detailed Description

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

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

virtual Rect2D G3D::Widget::bounds ( ) const
inlinevirtualinherited

Inherited from Surface2D.

Implements G3D::Surface2D.

Reimplemented in G3D::GuiWindow.

const shared_ptr<Camera>& G3D::UprightSplineManipulator::camera ( ) const
inline
shared_ptr<Camera> G3D::UprightSplineManipulator::camera ( )
inline
void G3D::UprightSplineManipulator::clear ( )

Destroys the current path.

static Ref G3D::UprightSplineManipulator::create ( const shared_ptr< class Camera > &  c = shared_ptr< Camera >())
static
bool G3D::UprightSplineManipulator::cyclic ( ) const
inline

Does the spline wrap around to the first control point.

virtual float G3D::Widget::depth ( ) const
inlinevirtualinherited

Inherited from Surface2D.

Controls the depth of objects when rendering. Subclasses may override this but it can interfere with the normal handling of rendering and event delivery. depth = 0 is usually the "top" widget and depth = 1 is usually the "bottom" widget.

Implements G3D::Surface2D.

Reimplemented in G3D::GuiWindow.

virtual void G3D::Widget::fireEvent ( const GEvent event)
virtualinherited

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.

WidgetManager* G3D::Widget::manager ( ) const
inlineinherited
Mode G3D::UprightSplineManipulator::mode ( ) const
virtual void G3D::UprightSplineManipulator::onAI ( )
inlinevirtual

Reimplemented from G3D::Widget.

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.

Reimplemented from G3D::Widget.

virtual void G3D::UprightSplineManipulator::onNetwork ( )
inlinevirtual

Reimplemented from G3D::Widget.

virtual void G3D::Widget::onPose ( Array< shared_ptr< Surface > > &  surfaceArray,
Array< shared_ptr< Surface2D > > &  surface2DArray 
)
inlinevirtualinherited

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.

Reimplemented in G3D::GuiWindow, G3D::PhysicsFrameSplineEditor, and G3D::SceneEditorWindow.

virtual void G3D::UprightSplineManipulator::onPose ( Array< shared_ptr< Surface > > &  posedArray,
Array< Surface2DRef > &  posed2DArray 
)
virtual
virtual void G3D::UprightSplineManipulator::onSimulation ( RealTime  rdt,
SimTime  sdt,
SimTime  idt 
)
virtual

Reimplemented from G3D::Widget.

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

Reimplemented from G3D::Widget.

UprightSplineManipulator& G3D::UprightSplineManipulator::operator= ( const UprightSplineManipulator )
protected
const Color3& G3D::UprightSplineManipulator::pathColor ( ) const
inline
GKey G3D::UprightSplineManipulator::recordKey ( ) const
inline
virtual void G3D::Widget::render ( RenderDevice rd) const
inlinevirtualinherited

Inherited from Surface2D.

Implements G3D::Surface2D.

Reimplemented in G3D::ThirdPersonManipulator, G3D::GuiWindow, and G3D::GuiMenu.

void G3D::UprightSplineManipulator::setCamera ( const shared_ptr< Camera > &  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::setDepth ( float  d)
inlinevirtualinherited

Called by the WidgetManager.

This is the depth that the Widget is expected to use when posed as a Surface2D. Subclasses may override or ignore this but it can interfere with the normal handling of rendering.

virtual void G3D::Widget::setManager ( WidgetManager m)
inlinevirtualinherited

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

The argument may be NULL

Reimplemented in G3D::CameraControlWindow, G3D::PhysicsFrameSplineEditor, and 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
static void G3D::Surface2D::sort ( Array< Surface2DRef > &  array)
staticinherited

Sorts from farthest to nearest.

static void G3D::Surface2D::sortAndRender ( RenderDevice rd,
Array< Surface2DRef > &  array 
)
staticinherited

Calls sort, RenderDevice::push2D, and then render on all elements.

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 OSWindow* G3D::Widget::window ( ) const
virtualinherited

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

Reimplemented in G3D::WidgetManager.

Member Data Documentation

shared_ptr<class Camera> G3D::UprightSplineManipulator::m_camera
protected

Referenced by camera(), and setCamera().

CoordinateFrame G3D::UprightSplineManipulator::m_currentFrame
protected
float G3D::Widget::m_depth
protectedinherited
WidgetManager* G3D::Widget::m_manager
protectedinherited

The manager, set by setManager().

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

Referenced by G3D::Widget::manager(), G3D::GuiWindow::manager(), G3D::Widget::setManager(), and G3D::GuiWindow::setVisible().

Mode G3D::UprightSplineManipulator::m_mode
protected
Color3 G3D::UprightSplineManipulator::m_pathColor
protected

Referenced by pathColor(), and setPathColor().

GKey G3D::UprightSplineManipulator::m_recordKey
protected

Referenced by recordKey(), and setRecordKey().

const float G3D::UprightSplineManipulator::m_sampleRate
protected

samples per second

bool G3D::UprightSplineManipulator::m_showPath
protected

Referenced by setShowPath(), and showPath().

UprightSpline G3D::UprightSplineManipulator::m_spline
protected
RealTime G3D::UprightSplineManipulator::m_time
protected

Current time during playback.

Referenced by time().


documentation generated on Sat Jan 12 2013 22:49:57 using doxygen 1.8.2