3rd Eye Scene C#
3rd Eye Scene C# documentation
|
This is the base class for any spatial shape represented by 3rd Eye Scene. More...
Public Member Functions | |
ObjectAttributes | GetAttributes () |
Exposes shape details via an ObjectAttributes structure. | |
void | SetAttributes (ObjectAttributes attr) |
Sets shape details via an ObjectAttributes structure. | |
void | SetPosition (float x, float y, float z) |
Set the position. | |
void | SetScale (float x, float y, float z) |
Set the scale. | |
virtual void | UpdateFrom (Shape other) |
Update the attributes of this shape to match other . | |
virtual bool | WriteCreate (PacketBuffer packet) |
Write a create message to packet . | |
virtual bool | WriteUpdate (PacketBuffer packet) |
Write a update message to packet . | |
virtual bool | WriteDestroy (PacketBuffer packet) |
Write a destroy message to packet . | |
virtual int | WriteData (PacketBuffer packet, ref uint progressMarker) |
Called only for complex shapes to write additional creation data. | |
virtual object | Clone () |
Clone this shape. | |
Protected Member Functions | |
Shape (ushort routingID, uint id=0) | |
Initialises a new instance of the Shape. | |
Shape (ushort routingID, uint id, ushort category) | |
Initialises a new instance of the Shape. | |
void | OnClone (Shape copy) |
Perform clone copy operations. | |
Protected Attributes | |
CreateMessage | _data = new CreateMessage() |
Core shape data. | |
Properties | |
ushort | RoutingID [get, set] |
Access to the routing ID for this shape. | |
bool | IsComplex [get, set] |
Set to true for complex shapes. | |
uint | ID [get, set] |
Shape ID. | |
ushort | Category [get, set] |
Shape category (optional). | |
ushort | Flags [get, set] |
Direct access to the ObjectFlag set for this shape. | |
bool | Wireframe [get, set] |
Gets or sets the wire frame display flag. | |
bool | Transparent [get, set] |
Gets or sets the transparent display flag. | |
float | X [get, set] |
Position X coordinate. | |
float | Y [get, set] |
Position Y coordinate. | |
float | Z [get, set] |
Position Z coordinate. | |
Vector3 | Position [get, set] |
Collated position vector. | |
float | ScaleX [get, set] |
Scale X component. | |
float | ScaleY [get, set] |
Scale Y component. | |
float | ScaleZ [get, set] |
Scale Z component. | |
Vector3 | Scale [get, set] |
Collated scale vector. | |
Quaternion | Rotation [get, set] |
Collated quaternion rotation value. | |
uint | Colour [get, set] |
Encoded integer colour value. | |
virtual IEnumerable< Resource > | Resources [get] |
Called to enumerate resources for this shape. |
This is the base class for any spatial shape represented by 3rd Eye Scene.
The base shape exposes core shape properties, such as position scale and rotation, colour, type and message creation. Most simple shapes will not require any additional data, however, the semantics of certain properties may vary. For instance, a sphere requires only one scale element. A cylinder may use the scale fields to represent length and radius.
Shape message handling depends on RoutingID. This this ID must be unique for each type of Shape. For each RoutingID value, each shape may have its own unique ID. Any shape with a non-zero ID is considered persistent and must be explicitly removed from a connection later. Any shape with a zero ID is transient, lasting only a single frame. Such shapes will not have a destroy message sent.
The core shape attributes are serialised in creation and update messages via WriteCreate(PacketBuffer) and WriteUpdate(PacketBuffer). A simple destruction message is authored by WriteDestroy(PacketBuffer). Subclasses generally need only use the base implementation. Some subclasses may need to write additional data on creation by overriding the WriteCreate(PacketBuffer). The base method should always be called first before appending custom data.
Some shapes may be marked as IsComplex. These shapes contain a large amount of data which cannot be adequately contained in a single (create) message. Such shapes may implement WriteData(PacketBuffer, ref uint) to serialise one or more additional packets of data. This method is only called when IsComplex is true.
Finally, a shape may have additional Resource requirements. A shape exposes its resources via the Resources property. Resources may be shared between shapes. They are reference counted in a client connection and sent and destroyed as needed. See Resource for more details.
Tes::Shapes::Shape::Shape | ( | ushort | routingID, |
uint | id = 0 |
||
) | [inline, protected] |
Initialises a new instance of the Shape.
routingID | The routing ID for the shape type. |
id | The shape ID. Zero for transient. |
Tes::Shapes::Shape::Shape | ( | ushort | routingID, |
uint | id, | ||
ushort | category | ||
) | [inline, protected] |
Initialises a new instance of the Shape.
routingID | The routing ID for the shape type. |
id | The shape ID. Zero for transient. |
category | Optional category used to display the shape. |
ObjectAttributes Tes::Shapes::Shape::GetAttributes | ( | ) | [inline] |
Exposes shape details via an ObjectAttributes structure.
void Tes::Shapes::Shape::OnClone | ( | Shape | copy | ) | [inline, protected] |
Perform clone copy operations.
copy | The new object to copy into. |
void Tes::Shapes::Shape::SetAttributes | ( | ObjectAttributes | attr | ) | [inline] |
Sets shape details via an ObjectAttributes structure.
attr | The attributes to set. |
void Tes::Shapes::Shape::SetPosition | ( | float | x, |
float | y, | ||
float | z | ||
) | [inline] |
Set the position.
x | The x coordinate. |
y | The y coordinate. |
z | The z coordinate. |
void Tes::Shapes::Shape::SetScale | ( | float | x, |
float | y, | ||
float | z | ||
) | [inline] |
Set the scale.
x | The x scale. |
y | The y scale. |
z | The z scale. |
virtual void Tes::Shapes::Shape::UpdateFrom | ( | Shape | other | ) | [inline, virtual] |
Update the attributes of this shape to match other
.
other | The shape to update data from. |
Used in maintaining cached copies of shapes. The shapes should already represent the same object.
Not all attributes need to be updated. Only attributes which may be updated via an UpdateMessage
for this shape need be copied.
The default implementation copies only the ObjectAttributes
.
virtual bool Tes::Shapes::Shape::WriteCreate | ( | PacketBuffer | packet | ) | [inline, virtual] |
Write a create message to packet .
true
on success.packet | Packet to write the message to. |
Reimplemented in Tes::Shapes::MeshSet, Tes::Shapes::MeshShape, Tes::Shapes::PointCloudShape, Tes::Shapes::Text2D, and Tes::Shapes::Text3D.
virtual int Tes::Shapes::Shape::WriteData | ( | PacketBuffer | packet, |
ref uint | progressMarker | ||
) | [inline, virtual] |
Called only for complex shapes to write additional creation data.
packet | The data stream to write to. |
progressMarker | Indicates data transfer progress. Initially zero, the Shape manages its own semantics. |
Reimplemented in Tes::Shapes::MeshShape, and Tes::Shapes::PointCloudShape.
virtual bool Tes::Shapes::Shape::WriteDestroy | ( | PacketBuffer | packet | ) | [inline, virtual] |
Write a destroy message to packet .
true
on success.packet | Packet to write the message to. |
virtual bool Tes::Shapes::Shape::WriteUpdate | ( | PacketBuffer | packet | ) | [inline, virtual] |
Write a update message to packet .
true
on success.packet | Packet to write the message to. |
CreateMessage Tes::Shapes::Shape::_data = new CreateMessage() [protected] |
Core shape data.
Uses the CreateMessage because that conveniently holds all the core data required.
uint Tes::Shapes::Shape::Colour [get, set] |
Encoded integer colour value.
See Maths.Colour.
ushort Tes::Shapes::Shape::Flags [get, set] |
Direct access to the ObjectFlag set for this shape.
The flags.
uint Tes::Shapes::Shape::ID [get, set] |
Shape ID.
Zero for transient.
bool Tes::Shapes::Shape::IsComplex [get, set] |
Set to true
for complex shapes.
Only complex shapes will have WriteData(PacketBuffer, ref uint) called.
Quaternion Tes::Shapes::Shape::Rotation [get, set] |
Collated quaternion rotation value.
The rotation.
bool Tes::Shapes::Shape::Transparent [get, set] |
Gets or sets the transparent display flag.
true
if transparent; otherwise, false
.