3rd Eye Scene C#
3rd Eye Scene C# documentation
|
This class defines the interface for any message handler class. More...
Public Types | |
enum | ModeFlags { IgnoreTransient = (1 << 0) } |
Flags modifying the normal operating behaviour of a message handler. More... | |
Public Member Functions | |
MessageHandler (CategoryCheckDelegate categoryCheck) | |
Create a message handler with the given delegate to assign to CategoryCheck. | |
virtual void | Initialise (GameObject root, GameObject serverRoot, MaterialLibrary materials) |
Called to initialise the handler with various 3rd Eye Scene components. | |
virtual void | UpdateServerInfo (Net.ServerInfoMessage info) |
Called on all handlers whenever the server info changes. | |
virtual void | Reset () |
Clear all data in the handler. | |
virtual void | BeginFrame (uint frameNumber, bool maintainTransient) |
Called at the start of a new frame, before processing new messages. | |
virtual void | EndFrame (uint frameNumber) |
Called at the end of a frame. | |
virtual void | PreRender () |
Called a little prior to actually rendering a frame. | |
abstract Error | ReadMessage (PacketBuffer packet, BinaryReader reader) |
Called when a message arrives with a message routing ID matching RoutingID. | |
Error | Serialise (BinaryWriter writer) |
Serialise the current state of the handler to the given stream. | |
abstract Error | Serialise (BinaryWriter writer, ref SerialiseInfo info) |
Serialise the current state of the handler to the given stream. | |
abstract void | OnCategoryChange (ushort categoryId, bool active) |
Called whenever a category's active state changes. | |
Properties | |
ModeFlags | Mode [get, set] |
Current mode control value. | |
CategoryCheckDelegate | CategoryCheck [get, set] |
Delegate used to check if a category is enabled. | |
abstract string | Name [get] |
A reference name for the handler. | |
abstract ushort | RoutingID [get] |
Returns the unique ID for the message handler. | |
Net.ServerInfoMessage | ServerInfo [get, set] |
Stored server information. |
This class defines the interface for any message handler class.
Messages are routed by the routingID()
.
Tes::Runtime::MessageHandler::MessageHandler | ( | CategoryCheckDelegate | categoryCheck | ) | [inline] |
Create a message handler with the given delegate to assign to CategoryCheck.
categoryCheck | The delegate to invoke for category enable checks. |
virtual void Tes::Runtime::MessageHandler::BeginFrame | ( | uint | frameNumber, |
bool | maintainTransient | ||
) | [inline, virtual] |
Called at the start of a new frame, before processing new messages.
In practice, this method is called when the Tes.Net.ControlMessageID.EndFrame message arrives, just prior to processing all messages for the completed frame.
frameNumber | A monotonic frame counter. |
maintainTransient | True to prevent flushing of transient objects. |
Reimplemented in Tes::Handlers::CameraHandler, Tes::Handlers::CategoriesHandler, Tes::Handlers::Shape2D::Text2DHandler, Tes::Handlers::Shape3D::MeshHandler, and Tes::Handlers::ShapeHandler.
virtual void Tes::Runtime::MessageHandler::EndFrame | ( | uint | frameNumber | ) | [inline, virtual] |
Called at the end of a frame.
In practice, this is likely to be called at the same time as BeginFrame(uint, bool).
This method is called when the Tes.Net.ControlMessageID.EndFrame message arrives, after processing all messages for the completed frame.
frameNumber | A monotonic frame counter. |
Reimplemented in Tes::Handlers::CameraHandler, and Tes::Handlers::CategoriesHandler.
virtual void Tes::Runtime::MessageHandler::Initialise | ( | GameObject | root, |
GameObject | serverRoot, | ||
MaterialLibrary | materials | ||
) | [inline, virtual] |
Called to initialise the handler with various 3rd Eye Scene components.
Message handlers which instantiate 3D objects should only instantiate objects under either the root or the serverRoot . Use root when objects are to be maintained in the Unity coordinate frame. Use serverRoot when objects are to be maintained in the server coordinate frame.
root | The 3rd Eye Scene root object. This is always at the origin and in Unity's coordinate frame. |
serverRoot | The scene root, which applies a transform to the server coordinate frame. |
materials | Maintains available materials and shaders. |
Reimplemented in Tes::Handlers::CameraHandler, Tes::Handlers::CategoriesHandler, Tes::Handlers::MeshCache, Tes::Handlers::Shape2D::Text2DHandler, Tes::Handlers::Shape3D::MeshHandler, Tes::Handlers::Shape3D::MeshSetHandler, Tes::Handlers::Shape3D::PointCloudHandler, Tes::Handlers::Shape3D::Text3DHandler, and Tes::Handlers::ShapeHandler.
abstract void Tes::Runtime::MessageHandler::OnCategoryChange | ( | ushort | categoryId, |
bool | active | ||
) | [pure virtual] |
Called whenever a category's active state changes.
All start active.
categoryId | The category changing state. |
active | Active or not? |
Implemented in Tes::Handlers::CameraHandler, Tes::Handlers::CategoriesHandler, Tes::Handlers::MeshCache, Tes::Handlers::Shape2D::Text2DHandler, and Tes::Handlers::ShapeHandler.
virtual void Tes::Runtime::MessageHandler::PreRender | ( | ) | [inline, virtual] |
Called a little prior to actually rendering a frame.
This is independent of EndFrame(uint).
Reimplemented in Tes::Handlers::Shape3D::MeshHandler, Tes::Handlers::Shape3D::MeshSetHandler, and Tes::Handlers::Shape3D::PointCloudHandler.
abstract Error Tes::Runtime::MessageHandler::ReadMessage | ( | PacketBuffer | packet, |
BinaryReader | reader | ||
) | [pure virtual] |
Called when a message arrives with a message routing ID matching RoutingID.
The main message header has already been decoded into the packet . The handler is to decode the remaining message data from reader and effect the appropriate actions.
packet | The packet object being read. |
reader | A binary reader which is initialised to the payload location in packet . |
Implemented in Tes::Handlers::CameraHandler, Tes::Handlers::CategoriesHandler, Tes::Handlers::MeshCache, Tes::Handlers::Shape2D::Text2DHandler, and Tes::Handlers::ShapeHandler.
virtual void Tes::Runtime::MessageHandler::Reset | ( | ) | [inline, virtual] |
Clear all data in the handler.
This resets it to the default, initialised state. For example, this method may be called to clear the scene.
Reimplemented in Tes::Handlers::CameraHandler, Tes::Handlers::CategoriesHandler, Tes::Handlers::MeshCache, Tes::Handlers::Shape2D::Text2DHandler, Tes::Handlers::Shape3D::MeshHandler, Tes::Handlers::Shape3D::MeshSetHandler, Tes::Handlers::Shape3D::PointCloudHandler, and Tes::Handlers::ShapeHandler.
Error Tes::Runtime::MessageHandler::Serialise | ( | BinaryWriter | writer | ) | [inline] |
Serialise the current state of the handler to the given stream.
writer | The steam to serialise the current state to. |
abstract Error Tes::Runtime::MessageHandler::Serialise | ( | BinaryWriter | writer, |
ref SerialiseInfo | info | ||
) | [pure virtual] |
Serialise the current state of the handler to the given stream.
This is in direct support of recording incoming data streams. In particular, this supports when recording is requested after the first data packet has come through. This call must write the required messages to restore the handler from its initial state to its exact current state.
For example, the sphere rendering shape handler will simulate sphere creation packets for the existing spheres.
writer | The steam to serialise the current state to. |
info | Passed to attain information about serialisation. |
Implemented in Tes::Handlers::CameraHandler, Tes::Handlers::CategoriesHandler, Tes::Handlers::MeshCache, Tes::Handlers::Shape2D::Text2DHandler, and Tes::Handlers::ShapeHandler.
virtual void Tes::Runtime::MessageHandler::UpdateServerInfo | ( | Net.ServerInfoMessage | info | ) | [inline, virtual] |
Called on all handlers whenever the server info changes.
info | Server information. |
ModeFlags Tes::Runtime::MessageHandler::Mode [get, set] |
Current mode control value.
Derived classes should respect the ModeFlags values as much as possible.
abstract string Tes::Runtime::MessageHandler::Name [get] |
A reference name for the handler.
Used for debugging and logging.
The name.
Reimplemented in Tes::Handlers::CameraHandler, Tes::Handlers::CategoriesHandler, Tes::Handlers::MeshCache, Tes::Handlers::Shape2D::Text2DHandler, Tes::Handlers::Shape3D::ArrowHandler, Tes::Handlers::Shape3D::BoxHandler, Tes::Handlers::Shape3D::CapsuleHandler, Tes::Handlers::Shape3D::ConeHandler, Tes::Handlers::Shape3D::CylinderHandler, Tes::Handlers::Shape3D::MeshHandler, Tes::Handlers::Shape3D::MeshSetHandler, Tes::Handlers::Shape3D::PlaneHandler, Tes::Handlers::Shape3D::PointCloudHandler, Tes::Handlers::Shape3D::SphereHandler, Tes::Handlers::Shape3D::StarHandler, Tes::Handlers::Shape3D::Text3DHandler, and Tes::PyramidHandler.
abstract ushort Tes::Runtime::MessageHandler::RoutingID [get] |
Returns the unique ID for the message handler.
This identifies the type of handled and in some cases, such as Renderers, the type of object handled. ID ranges are described in the MessageHandlersIDs
enumeration.
The routing ID.
Reimplemented in Tes::Handlers::CameraHandler, Tes::Handlers::CategoriesHandler, Tes::Handlers::MeshCache, Tes::Handlers::Shape2D::Text2DHandler, Tes::Handlers::Shape3D::ArrowHandler, Tes::Handlers::Shape3D::BoxHandler, Tes::Handlers::Shape3D::CapsuleHandler, Tes::Handlers::Shape3D::ConeHandler, Tes::Handlers::Shape3D::CylinderHandler, Tes::Handlers::Shape3D::MeshHandler, Tes::Handlers::Shape3D::MeshSetHandler, Tes::Handlers::Shape3D::PlaneHandler, Tes::Handlers::Shape3D::PointCloudHandler, Tes::Handlers::Shape3D::SphereHandler, Tes::Handlers::Shape3D::StarHandler, Tes::Handlers::Shape3D::Text3DHandler, and Tes::PyramidHandler.
Net.ServerInfoMessage Tes::Runtime::MessageHandler::ServerInfo [get, set] |
Stored server information.
Normally updated in UpdateServerInfo(Net.ServerInfoMessage).