3rd Eye Scene C#
3rd Eye Scene C# documentation
|
Implements handling of RoutingID.Mesh messages, maintaining the appropriate mesh objects. More...
Classes | |
class | MeshDetails |
Mesh details. More... | |
class | MeshSerialiser |
Wraps a MeshDetails object to expose it as a MeshResource for the purposes of serialisation. | |
Public Member Functions | |
delegate void | MeshNotificationDelegate (MeshDetails mesh) |
Delegate for various mesh events. | |
MeshCache () | |
Constructor. | |
override void | Initialise (GameObject root, GameObject serverRoot, MaterialLibrary materials) |
Initialise, caching the required materials from materials . | |
override void | Reset () |
Reset the cache. | |
MeshDetails | GetEntry (uint meshId) |
Query details of mesh resource using meshId . | |
override Error | ReadMessage (PacketBuffer packet, BinaryReader reader) |
Message handler. | |
override Error | Serialise (BinaryWriter writer, ref SerialiseInfo info) |
Serialise messages required to restore the current state. | |
override void | OnCategoryChange (ushort categoryId, bool active) |
Empty. | |
Static Public Member Functions | |
static MeshTopology | DrawTypeToTopology (MeshDrawType drawType) |
Converts drawType to the equivalent Unity Topology . | |
static int | TopologyIndexStep (MeshTopology topology) |
Query the number of indices per element for topology . | |
Public Attributes | |
const int | IndexCountLimit = 65000 |
Limit on the number of indices per Mesh part. | |
Protected Member Functions | |
Error | Serialise (MeshDetails mesh, PacketBuffer packet, BinaryWriter writer) |
Serialise messages to generate mesh . | |
void | WriteMeshComponent (uint meshID, MeshMessageType type, Vector3[] data, PacketBuffer packet, BinaryWriter writer, uint blockSize) |
Write a MeshComponentMessage to serialise Vector3 data. | |
Error | DestroyMesh (PacketBuffer packet, BinaryReader reader) |
Handles MeshDestroyMessage | |
Error | CreateMesh (PacketBuffer packet, BinaryReader reader) |
Handles MeshCreateMessage | |
Error | AddVertices (PacketBuffer packet, BinaryReader reader) |
Handles MeshComponentMessage of type MeshMessageType.Vertex. | |
Error | AddVertexColours (PacketBuffer packet, BinaryReader reader) |
Handles MeshComponentMessage of type MeshMessageType.VertexColour. | |
Error | AddIndices (PacketBuffer packet, BinaryReader reader) |
Handles MeshComponentMessage of type MeshMessageType.Index. | |
Error | AddNormals (PacketBuffer packet, BinaryReader reader) |
Handles MeshComponentMessage of type MeshMessageType.Normal. | |
Error | AddUVs (PacketBuffer packet, BinaryReader reader) |
Handles MeshComponentMessage of type MeshMessageType.UV. | |
Error | RedefineMesh (PacketBuffer packet, BinaryReader reader) |
Handles MeshRedefineMessage | |
Error | FinaliseMesh (PacketBuffer packet, BinaryReader reader) |
Handles MeshFinaliseMessage. | |
void | NotifyMeshAdded (MeshDetails meshDetails) |
Invoke OnMeshAdded | |
void | NotifyMeshRemoved (MeshDetails meshDetails) |
Invoke OnMeshRemoved | |
void | NotifyMeshFinalised (MeshDetails meshDetails) |
Invoke OnMeshFinalised | |
Properties | |
override string | Name [get] |
Handler name. | |
override ushort | RoutingID [get] |
Net.RoutingID.Mesh | |
Material | LitMaterial [get, set] |
Material for rendering lit polygons. | |
Material | UnlitMaterial [get, set] |
Material for rendering unlit polygons. | |
Material | PointsLitMaterial [get, set] |
Material for rendering lit points. | |
Material | PointsUnlitMaterial [get, set] |
Material for rendering unlit points. | |
Material | VoxelsMaterial [get, set] |
Material for rendering geometry shader based voxels. | |
Events | |
MeshNotificationDelegate | OnMeshAdded |
Invoked on a new mesh resource being added. | |
MeshNotificationDelegate | OnMeshRemoved |
Invoked on a new mesh being removed/destroyed. | |
MeshNotificationDelegate | OnMeshFinalised |
Invoked on first finalisation or re-finalisation of a mesh. |
Implements handling of RoutingID.Mesh messages, maintaining the appropriate mesh objects.
Handles the messages specified in MeshMessageType
Error Tes::Handlers::MeshCache::AddIndices | ( | PacketBuffer | packet, |
BinaryReader | reader | ||
) | [inline, protected] |
Handles MeshComponentMessage of type MeshMessageType.Index.
packet | |
reader |
Error Tes::Handlers::MeshCache::AddNormals | ( | PacketBuffer | packet, |
BinaryReader | reader | ||
) | [inline, protected] |
Handles MeshComponentMessage of type MeshMessageType.Normal.
packet | |
reader |
Error Tes::Handlers::MeshCache::AddUVs | ( | PacketBuffer | packet, |
BinaryReader | reader | ||
) | [inline, protected] |
Handles MeshComponentMessage of type MeshMessageType.UV.
packet | |
reader |
Error Tes::Handlers::MeshCache::AddVertexColours | ( | PacketBuffer | packet, |
BinaryReader | reader | ||
) | [inline, protected] |
Handles MeshComponentMessage of type MeshMessageType.VertexColour.
packet | |
reader |
Error Tes::Handlers::MeshCache::AddVertices | ( | PacketBuffer | packet, |
BinaryReader | reader | ||
) | [inline, protected] |
Handles MeshComponentMessage of type MeshMessageType.Vertex.
packet | |
reader |
Error Tes::Handlers::MeshCache::CreateMesh | ( | PacketBuffer | packet, |
BinaryReader | reader | ||
) | [inline, protected] |
Error Tes::Handlers::MeshCache::DestroyMesh | ( | PacketBuffer | packet, |
BinaryReader | reader | ||
) | [inline, protected] |
static MeshTopology Tes::Handlers::MeshCache::DrawTypeToTopology | ( | MeshDrawType | drawType | ) | [inline, static] |
Converts drawType to the equivalent Unity Topology
.
drawType | The Tes topology. |
Topology
NotImplementedException | Thrown when drawType is not supported by the Unity implementation. |
Error Tes::Handlers::MeshCache::FinaliseMesh | ( | PacketBuffer | packet, |
BinaryReader | reader | ||
) | [inline, protected] |
Handles MeshFinaliseMessage.
packet | |
reader |
This creates the required Unity Mesh
objects and emits OnMeshFinalised.
MeshDetails Tes::Handlers::MeshCache::GetEntry | ( | uint | meshId | ) | [inline] |
Query details of mesh resource using meshId .
meshId | ID of the resource of interest. |
override void Tes::Handlers::MeshCache::Initialise | ( | GameObject | root, |
GameObject | serverRoot, | ||
MaterialLibrary | materials | ||
) | [inline, virtual] |
Initialise, caching the required materials from materials .
root | |
serverRoot | |
materials |
Reimplemented from Tes::Runtime::MessageHandler.
delegate void Tes::Handlers::MeshCache::MeshNotificationDelegate | ( | MeshDetails | mesh | ) |
Delegate for various mesh events.
mesh | The mesh changing state. |
void Tes::Handlers::MeshCache::NotifyMeshAdded | ( | MeshDetails | meshDetails | ) | [inline, protected] |
Invoke OnMeshAdded
meshDetails |
void Tes::Handlers::MeshCache::NotifyMeshFinalised | ( | MeshDetails | meshDetails | ) | [inline, protected] |
Invoke OnMeshFinalised
meshDetails |
void Tes::Handlers::MeshCache::NotifyMeshRemoved | ( | MeshDetails | meshDetails | ) | [inline, protected] |
Invoke OnMeshRemoved
meshDetails |
override void Tes::Handlers::MeshCache::OnCategoryChange | ( | ushort | categoryId, |
bool | active | ||
) | [inline, virtual] |
override Error Tes::Handlers::MeshCache::ReadMessage | ( | PacketBuffer | packet, |
BinaryReader | reader | ||
) | [inline, virtual] |
Message handler.
packet | |
reader |
Handles messages IDs from MeshMessageType
Implements Tes::Runtime::MessageHandler.
Error Tes::Handlers::MeshCache::RedefineMesh | ( | PacketBuffer | packet, |
BinaryReader | reader | ||
) | [inline, protected] |
Handles MeshRedefineMessage
packet | |
reader |
The associated mesh is invalidated until another MeshFinaliseMessage arrives.
override void Tes::Handlers::MeshCache::Reset | ( | ) | [inline, virtual] |
Reset the cache.
Does not invoke OnMeshRemoved events.
Reimplemented from Tes::Runtime::MessageHandler.
Error Tes::Handlers::MeshCache::Serialise | ( | MeshDetails | mesh, |
PacketBuffer | packet, | ||
BinaryWriter | writer | ||
) | [inline, protected] |
Serialise messages to generate mesh .
mesh | The mesh of interest. |
packet | Packet buffer to compose messages in |
writer | Writer to export completed message packets to. |
Writes:
override Error Tes::Handlers::MeshCache::Serialise | ( | BinaryWriter | writer, |
ref SerialiseInfo | info | ||
) | [inline, virtual] |
Serialise messages required to restore the current state.
writer | |
info | Statistics |
Implements Tes::Runtime::MessageHandler.
static int Tes::Handlers::MeshCache::TopologyIndexStep | ( | MeshTopology | topology | ) | [inline, static] |
Query the number of indices per element for topology .
topology | The mesh topology |
Type | Index Count |
---|---|
MeshTopology.Points | 1 |
MeshTopology.LineStrip | 1 (not supported). |
MeshTopology.Lines | 2 |
MeshTopology.Triangles | 3 |
MeshTopology.Quads | 4 |
Else | 1 |
void Tes::Handlers::MeshCache::WriteMeshComponent | ( | uint | meshID, |
MeshMessageType | type, | ||
Vector3[] | data, | ||
PacketBuffer | packet, | ||
BinaryWriter | writer, | ||
uint | blockSize | ||
) | [inline, protected] |
Write a MeshComponentMessage to serialise Vector3
data.
meshID | Mesh resource ID we are serialising for. |
type | The mesh component type; e.g., MeshMessageType.Vertex. |
data | The Vector3 data array. |
packet | Packet buffer to compose messages in |
writer | Writer to export completed message packets to. |
blockSize | The maximum number of elements per message. |
Writes multiple messages to writer as required to ensure all data are written.
override ushort Tes::Handlers::MeshCache::RoutingID [get] |
Net.RoutingID.Mesh
Reimplemented from Tes::Runtime::MessageHandler.
Material Tes::Handlers::MeshCache::VoxelsMaterial [get, set] |
Material for rendering geometry shader based voxels.
Vertices mark the centre, normals the half extents.
MeshNotificationDelegate Tes::Handlers::MeshCache::OnMeshAdded |
Invoked on a new mesh resource being added.
The mesh is not finalised.