Sirikata
Public Member Functions | Static Public Member Functions | Public Attributes | Private Types | Private Member Functions | Private Attributes | Friends
Sirikata::Graphics::OgreSystem Class Reference

Represents one OGRE SceneManager, a single environment. More...

#include <OgreSystem.hpp>

Inheritance diagram for Sirikata::Graphics::OgreSystem:
Collaboration diagram for Sirikata::Graphics::OgreSystem:

List of all members.

Public Member Functions

virtual void stop ()
 Stop scheduling this service.
Time simTime ()
VWObjectPtr getViewer () const
SpaceObjectReference getViewerPresence () const
String getResourcesDir () const
CameragetPrimaryCamera ()
ProxyEntitygetEntity (const SpaceObjectReference &proxyId) const
ProxyEntitygetEntity (const ProxyObjectPtr &proxy) const
void entityDestroyed (ProxyEntity *)
bool queryRay (const Vector3d &position, const Vector3f &direction, const double maxDistance, ProxyObjectPtr ignore, double &returnDistance, Vector3f &returnNormal, SpaceObjectReference &returnName)
EntityrayTrace (const Vector3d &position, const Vector3f &direction, int &resultCount, double &returnResult, Vector3f &returnNormal, int &subent, int which=0, SpaceObjectReference ignore=SpaceObjectReference::null()) const
virtual void windowResized (Ogre::RenderWindow *rw)
bool translateToDisplayViewport (float32 x, float32 y, float32 *ox, float32 *oy)
virtual void poll ()
 Override this method to specify the work to be done when polling.
virtual bool renderOneFrame (Task::LocalTime t, Duration frameTime)
virtual void preFrame (Task::LocalTime currentTime, Duration frameTime)
 all the things that should happen just before the frame
virtual void postFrame (Task::LocalTime current, Duration frameTime)
 all the things that should happen once the frame finishes
virtual void onCreateProxy (ProxyObjectPtr p)
virtual void onDestroyProxy (ProxyObjectPtr p)
virtual void attachCamera (const String &renderTargetName, Camera *)
 adds the camera to the list of attached cameras, making it the primary camera if it is first to be added
virtual void detachCamera (Camera *)
 removes the camera from the list of attached cameras.
virtual Mesh::VisualPtr defaultMesh () const
 Get the default mesh to present if a model fails to load.
virtual void onConnected (const Network::Address &addr)
 Invoked upon connection.
virtual void onDisconnected (const Network::Address &addr, bool requested, const String &reason)
 Invoked upon disconnection.
virtual void onDisconnected (SessionEventProviderPtr from, const SpaceObjectReference &name)
 Invoked upon disconnection.
boost::any invokeQuit (std::vector< boost::any > &params)
boost::any invokeSuspend (std::vector< boost::any > &params)
boost::any invokeToggleSuspend (std::vector< boost::any > &params)
boost::any invokeResume (std::vector< boost::any > &params)
boost::any invokeScreenshot (std::vector< boost::any > &params)
boost::any setOnReady (std::vector< boost::any > &params)
boost::any evalInUI (std::vector< boost::any > &params)
boost::any createWindow (const String &name, bool is_html, bool is_file, String content, uint32 width, uint32 height)
boost::any createWindowURL (std::vector< boost::any > &params)
boost::any createWindowFile (std::vector< boost::any > &params)
boost::any createWindowHTML (std::vector< boost::any > &params)
boost::any addModuleToUI (std::vector< boost::any > &params)
boost::any addTextModuleToUI (std::vector< boost::any > &params)
boost::any addInputHandler (std::vector< boost::any > &params)
boost::any removeInputHandler (std::vector< boost::any > &params)
boost::any pick (std::vector< boost::any > &params)
boost::any bbox (std::vector< boost::any > &params)
boost::any visible (std::vector< boost::any > &params)
boost::any axis (std::vector< boost::any > &params)
boost::any world2Screen (std::vector< boost::any > &params)
boost::any newDrawing (std::vector< boost::any > &params)
boost::any setMat (std::vector< boost::any > &params)
boost::any setInheritOrient (std::vector< boost::any > &params)
boost::any setInheritScale (std::vector< boost::any > &params)
boost::any setVisible (std::vector< boost::any > &params)
boost::any shape (std::vector< boost::any > &params)
boost::any getCamera (std::vector< boost::any > &params)
boost::any setCameraPosition (std::vector< boost::any > &params)
boost::any setCameraOrientation (std::vector< boost::any > &params)
boost::any setCameraNearClipPlane (std::vector< boost::any > &params)
boost::any setCameraFarClipPlane (std::vector< boost::any > &params)
boost::any setCameraFOVY (std::vector< boost::any > &params)
boost::any getAnimationList (std::vector< boost::any > &params)
boost::any startAnimation (std::vector< boost::any > &params)
boost::any stopAnimation (std::vector< boost::any > &params)
boost::any isReady (std::vector< boost::any > &params)
boost::any setSkybox (std::vector< boost::any > &params)
 ~OgreSystem ()

Static Public Member Functions

static TimeSteppedSimulationcreate (Context *ctx, ConnectionEventProvider *cevtprovider, HostedObjectPtr obj, const SpaceObjectReference &presenceid, const String &options, Network::IOStrandPtr sStrand)

Public Attributes

CameramPrimaryCamera
CameramOverlayCamera

Private Types

typedef
std::tr1::unordered_map
< SpaceObjectReference,
ProxyEntity
*, SpaceObjectReference::Hasher
EntityMap

Private Member Functions

void allocInputHandler ()
void destroyInputHandler ()
void tickInputHandler (const Task::LocalTime &t) const
 OgreSystem (Context *ctx, Network::IOStrandPtr sStrand)
bool initialize (ConnectionEventProvider *cevtprovider, VWObjectPtr viewer, const SpaceObjectReference &presenceid, const String &options)
void handleUIReady ()
void iHandleUIReady (Liveness::Token osAlive)
void handleUIResetReady ()
void handleUpdateUIViewport (int32 left, int32 top, int32 right, int32 bottom)
ProxyEntityinternalRayTrace (const Ogre::Ray &traceFrom, bool aabbOnly, int &resultCount, double &returnResult, Vector3f &returnNormal, int &returnSubMesh, IntersectResult *returnIntersectResult, bool texcoord, int which=0, SpaceObjectReference ignore=SpaceObjectReference::null()) const
void instantiateAllObjects (ProxyManagerPtr pop)
double clamp (const double &val)
void iOnSessionDisconnected (Liveness::Token osAlive, SessionEventProviderPtr from, const SpaceObjectReference &name)
void iOnNetworkDisconnected (Liveness::Token osAlive, const Network::Address &addr, bool requested, const String &reason)
void iOnCreateProxy (Liveness::Token osAlive, ProxyObjectPtr p, bool inInit)
void iOnDestroyProxy (Liveness::Token osAlive, ProxyObjectPtr p)

Private Attributes

ConnectionEventProvidermConnectionEventProvider
VWObjectPtr mViewer
SpaceObjectReference mPresenceID
OgreSystemInputHandlermInputHandler
Ogre::RaySceneQuery * mRayQuery
CubeMapmCubeMap
InvokablemOnReadyCallback
InvokablemOnResetReadyCallback
Mesh::VisualPtr mDefaultMesh
EntityMap mEntityMap
String currentMat
bool mReady
bool initialized

Friends

class OgreSystemInputHandler

Detailed Description

Represents one OGRE SceneManager, a single environment.


Member Typedef Documentation


Constructor & Destructor Documentation

Sirikata::Graphics::OgreSystem::OgreSystem ( Context ctx,
Network::IOStrandPtr  sStrand 
) [private]
Sirikata::Graphics::OgreSystem::~OgreSystem ( )

Member Function Documentation

boost::any Sirikata::Graphics::OgreSystem::addInputHandler ( std::vector< boost::any > &  params)
boost::any Sirikata::Graphics::OgreSystem::addModuleToUI ( std::vector< boost::any > &  params)
boost::any Sirikata::Graphics::OgreSystem::addTextModuleToUI ( std::vector< boost::any > &  params)
void Sirikata::Graphics::OgreSystem::allocInputHandler ( ) [private]
void Sirikata::Graphics::OgreSystem::attachCamera ( const String &  renderTargetName,
Camera entity 
) [virtual]

adds the camera to the list of attached cameras, making it the primary camera if it is first to be added

Reimplemented from Sirikata::Graphics::OgreRenderer.

References mCubeMap.

Referenced by iOnCreateProxy().

boost::any Sirikata::Graphics::OgreSystem::axis ( std::vector< boost::any > &  params)
boost::any Sirikata::Graphics::OgreSystem::bbox ( std::vector< boost::any > &  params)

Referenced by initialize().

double Sirikata::Graphics::OgreSystem::clamp ( const double &  val) [private]

Referenced by setMat().

static TimeSteppedSimulation* Sirikata::Graphics::OgreSystem::create ( Context ctx,
ConnectionEventProvider cevtprovider,
HostedObjectPtr  obj,
const SpaceObjectReference presenceid,
const String &  options,
Network::IOStrandPtr  sStrand 
) [inline, static]

References initialize(), and OgreSystem().

boost::any Sirikata::Graphics::OgreSystem::createWindow ( const String &  name,
bool  is_html,
bool  is_file,
String  content,
uint32  width,
uint32  height 
)
boost::any Sirikata::Graphics::OgreSystem::createWindowFile ( std::vector< boost::any > &  params)
boost::any Sirikata::Graphics::OgreSystem::createWindowHTML ( std::vector< boost::any > &  params)
boost::any Sirikata::Graphics::OgreSystem::createWindowURL ( std::vector< boost::any > &  params)
virtual Mesh::VisualPtr Sirikata::Graphics::OgreSystem::defaultMesh ( ) const [inline, virtual]

Get the default mesh to present if a model fails to load.

This may return an empty VisualPtr if no default mesh is specified.

Reimplemented from Sirikata::Graphics::OgreRenderer.

References mDefaultMesh.

void Sirikata::Graphics::OgreSystem::destroyInputHandler ( ) [private]

References mInputHandler.

Referenced by ~OgreSystem().

void Sirikata::Graphics::OgreSystem::detachCamera ( Camera entity) [virtual]

removes the camera from the list of attached cameras.

Reimplemented from Sirikata::Graphics::OgreRenderer.

References mCubeMap, and mPrimaryCamera.

void Sirikata::Graphics::OgreSystem::entityDestroyed ( ProxyEntity p)
boost::any Sirikata::Graphics::OgreSystem::evalInUI ( std::vector< boost::any > &  params)
boost::any Sirikata::Graphics::OgreSystem::getAnimationList ( std::vector< boost::any > &  params)
boost::any Sirikata::Graphics::OgreSystem::getCamera ( std::vector< boost::any > &  params)
ProxyEntity * Sirikata::Graphics::OgreSystem::getEntity ( const SpaceObjectReference proxyId) const
ProxyEntity * Sirikata::Graphics::OgreSystem::getEntity ( const ProxyObjectPtr proxy) const

References getEntity().

Camera* Sirikata::Graphics::OgreSystem::getPrimaryCamera ( ) [inline]
String Sirikata::Graphics::OgreSystem::getResourcesDir ( ) const [inline]
VWObjectPtr Sirikata::Graphics::OgreSystem::getViewer ( ) const [inline]

References mViewer.

SpaceObjectReference Sirikata::Graphics::OgreSystem::getViewerPresence ( ) const [inline]

References mPresenceID.

void Sirikata::Graphics::OgreSystem::handleUIReady ( ) [private]
void Sirikata::Graphics::OgreSystem::handleUIResetReady ( ) [private]
void Sirikata::Graphics::OgreSystem::handleUpdateUIViewport ( int32  left,
int32  top,
int32  right,
int32  bottom 
) [private]
void Sirikata::Graphics::OgreSystem::iHandleUIReady ( Liveness::Token  osAlive) [private]
bool Sirikata::Graphics::OgreSystem::initialize ( ConnectionEventProvider cevtprovider,
VWObjectPtr  viewer,
const SpaceObjectReference presenceid,
const String &  options 
) [private]

References addInputHandler(), Sirikata::Provider< ListenerPtr >::addListener(), addModuleToUI(), addTextModuleToUI(), allocInputHandler(), axis(), bbox(), Sirikata::SHA256::computeDigest(), createWindowFile(), createWindowHTML(), createWindowURL(), evalInUI(), getAnimationList(), getCamera(), handleUIReady(), handleUIResetReady(), handleUpdateUIViewport(), Sirikata::Graphics::OgreRenderer::initialize(), initialized, instantiateAllObjects(), invokeQuit(), invokeResume(), invokeScreenshot(), invokeSuspend(), invokeToggleSuspend(), isReady(), mConnectionEventProvider, mDefaultMesh, mInputHandler, Sirikata::Graphics::OgreRenderer::mInvokableHandlers, mPresenceID, Sirikata::Graphics::OgreRenderer::mResourceLoader, Sirikata::Graphics::OgreRenderer::mResourcesDir, Sirikata::Graphics::OgreRenderer::mSceneManager, Sirikata::Graphics::OgreRenderer::mSkybox, Sirikata::Graphics::OgreRenderer::mTransferPool, Sirikata::Graphics::OgreSystemInputHandler::mUIWidgetView, mViewer, newDrawing(), Sirikata::SHA256::null(), Sirikata::Graphics::OgreRenderer::parseMeshWorkSync(), pick(), read_file(), removeInputHandler(), setCameraFarClipPlane(), setCameraFOVY(), setCameraNearClipPlane(), setCameraOrientation(), setCameraPosition(), setInheritOrient(), setInheritScale(), setMat(), setOnReady(), Sirikata::Graphics::WebView::setReadyCallback(), Sirikata::Graphics::WebView::setResetReadyCallback(), setSkybox(), Sirikata::Graphics::WebView::setUpdateViewportCallback(), setVisible(), shape(), startAnimation(), stopAnimation(), visible(), and world2Screen().

Referenced by create().

void Sirikata::Graphics::OgreSystem::instantiateAllObjects ( ProxyManagerPtr  pop) [private]
ProxyEntity * Sirikata::Graphics::OgreSystem::internalRayTrace ( const Ogre::Ray &  traceFrom,
bool  aabbOnly,
int &  resultCount,
double &  returnResult,
Vector3f &  returnNormal,
int &  returnSubMesh,
IntersectResult returnIntersectResult,
bool  texcoord,
int  which = 0,
SpaceObjectReference  ignore = SpaceObjectReference::null() 
) const [private]
boost::any Sirikata::Graphics::OgreSystem::invokeQuit ( std::vector< boost::any > &  params)
boost::any Sirikata::Graphics::OgreSystem::invokeResume ( std::vector< boost::any > &  params)
boost::any Sirikata::Graphics::OgreSystem::invokeScreenshot ( std::vector< boost::any > &  params)
boost::any Sirikata::Graphics::OgreSystem::invokeSuspend ( std::vector< boost::any > &  params)
boost::any Sirikata::Graphics::OgreSystem::invokeToggleSuspend ( std::vector< boost::any > &  params)
void Sirikata::Graphics::OgreSystem::iOnCreateProxy ( Liveness::Token  osAlive,
ProxyObjectPtr  p,
bool  inInit 
) [private]
void Sirikata::Graphics::OgreSystem::iOnDestroyProxy ( Liveness::Token  osAlive,
ProxyObjectPtr  p 
) [private]

Referenced by onDestroyProxy().

void Sirikata::Graphics::OgreSystem::iOnNetworkDisconnected ( Liveness::Token  osAlive,
const Network::Address addr,
bool  requested,
const String &  reason 
) [private]
void Sirikata::Graphics::OgreSystem::iOnSessionDisconnected ( Liveness::Token  osAlive,
SessionEventProviderPtr  from,
const SpaceObjectReference name 
) [private]
boost::any Sirikata::Graphics::OgreSystem::isReady ( std::vector< boost::any > &  params)

References Sirikata::Invokable::asAny(), and mReady.

Referenced by initialize().

boost::any Sirikata::Graphics::OgreSystem::newDrawing ( std::vector< boost::any > &  params)
void Sirikata::Graphics::OgreSystem::onConnected ( const Network::Address addr) [virtual]

Invoked upon connection.

Parameters:
addrthe address connected to

Reimplemented from Sirikata::ConnectionEventListener.

void Sirikata::Graphics::OgreSystem::onCreateProxy ( ProxyObjectPtr  p) [virtual]
void Sirikata::Graphics::OgreSystem::onDestroyProxy ( ProxyObjectPtr  p) [virtual]
void Sirikata::Graphics::OgreSystem::onDisconnected ( const Network::Address addr,
bool  requested,
const String &  reason 
) [virtual]

Invoked upon disconnection.

Parameters:
addrthe address disconnected from
requestedindicates whether the user requested the disconnection
reasonif requested is false, gives a textual description of the reason for the disconnection

Reimplemented from Sirikata::ConnectionEventListener.

References iOnNetworkDisconnected(), Sirikata::Liveness::livenessToken(), and Sirikata::Graphics::OgreRenderer::simStrand.

void Sirikata::Graphics::OgreSystem::onDisconnected ( SessionEventProviderPtr  from,
const SpaceObjectReference name 
) [virtual]

Invoked upon disconnection.

Parameters:
fromthe SessionEventProvider the event originates from
namethe name of the object in the space

Reimplemented from Sirikata::SessionEventListener.

References iOnSessionDisconnected(), Sirikata::Liveness::livenessToken(), and Sirikata::Graphics::OgreRenderer::simStrand.

boost::any Sirikata::Graphics::OgreSystem::pick ( std::vector< boost::any > &  params)

Referenced by initialize().

void Sirikata::Graphics::OgreSystem::poll ( ) [virtual]

Override this method to specify the work to be done when polling.

Reimplemented from Sirikata::Graphics::OgreRenderer.

References Sirikata::Task::LocalTime::now(), and tickInputHandler().

void Sirikata::Graphics::OgreSystem::postFrame ( Task::LocalTime  current,
Duration  frameTime 
) [virtual]

all the things that should happen once the frame finishes

Reimplemented from Sirikata::Graphics::OgreRenderer.

References Sirikata::Graphics::CubeMap::frameEnded(), and mCubeMap.

void Sirikata::Graphics::OgreSystem::preFrame ( Task::LocalTime  currentTime,
Duration  frameTime 
) [virtual]

all the things that should happen just before the frame

Reimplemented from Sirikata::Graphics::OgreRenderer.

bool Sirikata::Graphics::OgreSystem::queryRay ( const Vector3d &  position,
const Vector3f &  direction,
const double  maxDistance,
ProxyObjectPtr  ignore,
double &  returnDistance,
Vector3f &  returnNormal,
SpaceObjectReference returnName 
)
Entity * Sirikata::Graphics::OgreSystem::rayTrace ( const Vector3d &  position,
const Vector3f &  direction,
int &  resultCount,
double &  returnResult,
Vector3f &  returnNormal,
int &  subent,
int  which = 0,
SpaceObjectReference  ignore = SpaceObjectReference::null() 
) const
boost::any Sirikata::Graphics::OgreSystem::removeInputHandler ( std::vector< boost::any > &  params)
bool Sirikata::Graphics::OgreSystem::renderOneFrame ( Task::LocalTime  t,
Duration  frameTime 
) [virtual]
boost::any Sirikata::Graphics::OgreSystem::setCameraFarClipPlane ( std::vector< boost::any > &  params)
boost::any Sirikata::Graphics::OgreSystem::setCameraFOVY ( std::vector< boost::any > &  params)
boost::any Sirikata::Graphics::OgreSystem::setCameraNearClipPlane ( std::vector< boost::any > &  params)
boost::any Sirikata::Graphics::OgreSystem::setCameraOrientation ( std::vector< boost::any > &  params)
boost::any Sirikata::Graphics::OgreSystem::setCameraPosition ( std::vector< boost::any > &  params)
boost::any Sirikata::Graphics::OgreSystem::setInheritOrient ( std::vector< boost::any > &  params)
boost::any Sirikata::Graphics::OgreSystem::setInheritScale ( std::vector< boost::any > &  params)
boost::any Sirikata::Graphics::OgreSystem::setMat ( std::vector< boost::any > &  params)
boost::any Sirikata::Graphics::OgreSystem::setOnReady ( std::vector< boost::any > &  params)
boost::any Sirikata::Graphics::OgreSystem::setSkybox ( std::vector< boost::any > &  params)
boost::any Sirikata::Graphics::OgreSystem::setVisible ( std::vector< boost::any > &  params)
boost::any Sirikata::Graphics::OgreSystem::shape ( std::vector< boost::any > &  params)
Time Sirikata::Graphics::OgreSystem::simTime ( )
boost::any Sirikata::Graphics::OgreSystem::startAnimation ( std::vector< boost::any > &  params)
void Sirikata::Graphics::OgreSystem::stop ( ) [virtual]

Stop scheduling this service.

Note that this does not immediately stop the service, it simply guarantees the service will not be scheduled again. This allows outstanding events to be handled properly.

Reimplemented from Sirikata::Graphics::OgreRenderer.

References mConnectionEventProvider, mPresenceID, mViewer, and Sirikata::Provider< ListenerPtr >::removeListener().

boost::any Sirikata::Graphics::OgreSystem::stopAnimation ( std::vector< boost::any > &  params)
void Sirikata::Graphics::OgreSystem::tickInputHandler ( const Task::LocalTime t) const [private]
bool Sirikata::Graphics::OgreSystem::translateToDisplayViewport ( float32  x,
float32  y,
float32 *  ox,
float32 *  oy 
)
boost::any Sirikata::Graphics::OgreSystem::visible ( std::vector< boost::any > &  params)
void Sirikata::Graphics::OgreSystem::windowResized ( Ogre::RenderWindow *  rw) [virtual]
boost::any Sirikata::Graphics::OgreSystem::world2Screen ( std::vector< boost::any > &  params)

Friends And Related Function Documentation

friend class OgreSystemInputHandler [friend]

Referenced by allocInputHandler().


Member Data Documentation

Referenced by setMat(), and shape().

Referenced by initialize(), and stop().

Referenced by defaultMesh(), and initialize().

Referenced by entityDestroyed(), and iOnCreateProxy().

Referenced by iHandleUIReady(), and setOnReady().

Referenced by handleUIResetReady(), and setOnReady().

Referenced by iOnCreateProxy(), and renderOneFrame().

Ogre::RaySceneQuery* Sirikata::Graphics::OgreSystem::mRayQuery [private]

Referenced by internalRayTrace(), and OgreSystem().

Referenced by iHandleUIReady(), and isReady().


The documentation for this class was generated from the following files: