3es
0.7
|
The 3rd Eye Scene macro interface provides a way of instrumenting your code with 3rd Eye Scene directives, while being able to conditionally remove these directives from selected builds. More...
Macros | |
#define | TES_STMT(statement) statement |
Enable statement if TES is enabled. More... | |
#define | TES_IF(condition) if (condition) |
Begins an if statement with condition, but only if TES is enabled. More... | |
#define | TES_PTR_ID(ptr) static_cast<uint32_t>(reinterpret_cast<uint64_t>(ptr)) |
A helper macro to convert a pointer, such as this , into a 32-bit ID value. More... | |
#define | TES_RGB(r, g, b) tes::Colour(r, g, b) |
Colour from RGB. More... | |
#define | TES_RGBA(r, g, b, a) tes::Colour(r, g, b, a) |
Colour from RGBA. More... | |
#define | TES_COLOUR(name) tes::Colour::Colours[tes::Colour::name] |
Colour by name. More... | |
#define | TES_COLOUR_I(index) tes::Colour::Colours[index] |
Colour by predefined index. More... | |
#define | TES_COLOUR_A(name, a) tes::Colour(tes::Colour::Colours[tes::Colour::name], a) |
Colour by name with alpha. More... | |
#define | TES_CATEGORY(server, _name, _categoryId, _parentId, _active) |
Exposes details of a category to connected clients. More... | |
#define | TES_SERVER_DECL(server) tes::Server *server = nullptr; |
A helper macro used to declare a Server pointer and compile out when TES is not enabled. More... | |
#define | TES_SETTINGS(settings, ...) tes::ServerSettings settings = tes::ServerSettings(__VA_ARGS__); |
A helper macro used to declare and initialise ServerSettings and compile out when TES is not enabled. More... | |
#define | TES_SERVER_INFO(info, infoCoordinateFrame) |
Initialise a default ServerInfoMessage and assign the specified CoordinateFrame . More... | |
#define | TES_SERVER_INFO_TIME(info, timeUnit, defaultFrameTime) |
Initialise the time unit details of a ServerInfoMessage . More... | |
#define | TES_SERVER_CREATE(server, settings, info) server = tes::Server::create(settings, info); |
Initialise server to a new Server object with the given ServerSettings and ServerInfoMessage . More... | |
#define | TES_SERVER_START(server, mode) if (server) { (server)->connectionMonitor()->start(mode); } |
Start the given Server in the given mode (synchronous or asynchronous). More... | |
#define | TES_SERVER_UPDATE(server, ...) |
Call to update the server flushing the frame and potentially monitoring new connections. More... | |
#define | TES_SERVER_START_WAIT(server, timems) |
Wait for the server to be ready to accept incoming connections. More... | |
#define | TES_SET_CONNECTION_CALLBACK(server, ...) if (server) { (server)->connectionMonitor()->setConnectionCallback(__VA_ARGS__); } |
Set the connection callback via ConnectionMonitor::setConnectionCallback() . More... | |
#define | TES_SERVER_STOP(server) |
Stop the server. More... | |
#define | TES_ACTIVE(server) ((server) != nullptr && (server)->active()) |
Check if server is enabled. More... | |
#define | TES_SET_ACTIVE(server, _active) if (server) { (server)->setActive(_active) } |
Enable/disable server . More... | |
#define | TES_FEATURE(feature) tes::checkFeature(feature) |
Check if a feature is enabled using checkFeature() . More... | |
#define | TES_FEATURE_FLAG(feature) tes::featureFlag(feature) |
Get the flag for a feature. More... | |
#define | TES_FEATURES(featureFlags) tes::checkFeatures(featureFlags) |
Check if the given set of features are enabled using checkFeatures() . More... | |
#define | TES_IF_FEATURES(featureFlags, expression) |
Execute expression if featureFlags are all present using checkFeatures() . More... | |
#define | TES_REFERENCE_RESOURCE(server, resource) if (server) { (server)->referenceResource(resource); } |
Adds a reference to the given resource . More... | |
#define | TES_RELEASE_RESOURCE(server, resource) if (server) { (server)->releaseResource(resource); } |
Releases a reference to the given resource . More... | |
#define | TES_MESH_PLACEHOLDER(id) tes::MeshPlaceholder(id) |
Makes a stack declaration of a placeholder mesh resource. More... | |
#define | TES_ARROW(server, colour, ...) if (server) { (server)->create(tes::Arrow(__VA_ARGS__).setColour(colour)); } |
Solid arrow. More... | |
#define | TES_ARROW_T(server, colour, ...) if (server) { (server)->create(tes::Arrow(__VA_ARGS__).setColour(colour).setTransparent(true)); } |
Transparent arrow. More... | |
#define | TES_ARROW_W(server, colour, ...) if (server) { (server)->create(tes::Arrow(__VA_ARGS__).setColour(colour).setWireframe(true)); } |
Wireframe arrow. More... | |
#define | TES_BOX(server, colour, ...) if (server) { (server)->create(tes::Box(__VA_ARGS__).setColour(colour)); } |
Solid box. More... | |
#define | TES_BOX_T(server, colour, ...) if (server) { (server)->create(tes::Box(__VA_ARGS__).setColour(colour).setTransparent(true)); } |
Transparent box. More... | |
#define | TES_BOX_W(server, colour, ...) if (server) { (server)->create(tes::Box(__VA_ARGS__).setColour(colour).setWireframe(true)); } |
Wireframe box. More... | |
#define | TES_CAPSULE(server, colour, ...) if (server) { (server)->create(tes::Capsule(__VA_ARGS__).setColour(colour)); } |
Solid capsule. More... | |
#define | TES_CAPSULE_T(server, colour, ...) if (server) { (server)->create(tes::Capsule(__VA_ARGS__).setColour(colour).setTransparent(true)); } |
Transparent capsule. More... | |
#define | TES_CAPSULE_W(server, colour, ...) if (server) { (server)->create(tes::Capsule(__VA_ARGS__).setColour(colour).setWireframe(true)); } |
Wireframe capsule. More... | |
#define | TES_CONE(server, colour, ...) if (server) { (server)->create(tes::Cone(__VA_ARGS__).setColour(colour)); } |
Solid cone. More... | |
#define | TES_CONE_T(server, colour, ...) if (server) { (server)->create(tes::Cone(__VA_ARGS__).setColour(colour).setTransparent(true)); } |
Transparent cone. More... | |
#define | TES_CONE_W(server, colour, ...) if (server) { (server)->create(tes::Cone(__VA_ARGS__).setColour(colour).setWireframe(true)); } |
Wireframe cone. More... | |
#define | TES_CYLINDER(server, colour, ...) if (server) { (server)->create(tes::Cylinder(__VA_ARGS__).setColour(colour)); } |
Solid cylinder. More... | |
#define | TES_CYLINDER_T(server, colour, ...) if (server) { (server)->create(tes::Cylinder(__VA_ARGS__).setColour(colour).setTransparent(true)); } |
Transparent cylinder. More... | |
#define | TES_CYLINDER_W(server, colour, ...) if (server) { (server)->create(tes::Cylinder(__VA_ARGS__).setColour(colour).setWireframe(true)); } |
Wireframe cylinder. More... | |
#define | TES_LINES(server, colour, ...) if (server) { (server)->create(tes::MeshShape(tes::DtLines, ##__VA_ARGS__).setColour(colour)); } |
Render a set of lines. More... | |
#define | TES_LINES_E(server, colour, ...) if (server) { (server)->create(tes::MeshShape(tes::DtLines, ##__VA_ARGS__).expandVertices().setColour(colour)); } |
Render a set of lines, calling MeshShape::expandVertices() . More... | |
#define | TES_LINE(server, colour, v0, v1, ...) |
#define | TES_MESHSET(server, ...) if (server) { (server)->create(tes::MeshSet(__VA_ARGS__)); } |
Render a complex mesh. More... | |
#define | TES_PLANE(server, colour, ...) if (server) { (server)->create(tes::Plane(__VA_ARGS__).setColour(colour)); } |
Solid plane. More... | |
#define | TES_PLANE_T(server, colour, ...) if (server) { (server)->create(tes::Plane(__VA_ARGS__).setColour(colour).setTransparent(true)); } |
Transparent plane. More... | |
#define | TES_PLANE_W(server, colour, ...) if (server) { (server)->create(tes::Plane(__VA_ARGS__).setColour(colour).setWireframe(true)); } |
Wireframe plane. More... | |
#define | TES_POINTCLOUDSHAPE(server, colour, ...) if (server) { (server)->create(tes::PointCloudShape(__VA_ARGS__).setColour(colour)); } |
Render a point cloud. More... | |
#define | TES_POINTS(server, colour, ...) if (server) { (server)->create(tes::MeshShape(tes::DtPoints, ##__VA_ARGS__).setColour(colour)); } |
Render a small set of points. More... | |
#define | TES_POINTS_E(server, colour, ...) if (server) { (server)->create(tes::MeshShape(tes::DtPoints, ##__VA_ARGS__).expandVertices().setColour(colour)); } |
Render a small set of points, calling MeshShape::expandVertices() . More... | |
#define | TES_VOXELS(server, colour, resolution, ...) if (server) { (server)->create(tes::MeshShape(tes::DtVoxels, ##__VA_ARGS__).setUniformNormal(tes::Vector3f(0.5f * resolution)).setColour(colour)); } |
Render a set of voxels. More... | |
#define | TES_SPHERE(server, colour, ...) if (server) { (server)->create(tes::Sphere(__VA_ARGS__).setColour(colour)); } |
Solid sphere. More... | |
#define | TES_SPHERE_T(server, colour, ...) if (server) { (server)->create(tes::Sphere(__VA_ARGS__).setColour(colour).setTransparent(true)); } |
Transparent sphere. More... | |
#define | TES_SPHERE_W(server, colour, ...) if (server) { (server)->create(tes::Sphere(__VA_ARGS__).setColour(colour).setWireframe(true)); } |
Wireframe sphere. More... | |
#define | TES_STAR(server, colour, ...) if (server) { (server)->create(tes::Star(__VA_ARGS__).setColour(colour)); } |
Solid star. More... | |
#define | TES_STAR_T(server, colour, ...) if (server) { (server)->create(tes::Star(__VA_ARGS__).setColour(colour).setTransparent(true)); } |
Transparent star. More... | |
#define | TES_STAR_W(server, colour, ...) if (server) { (server)->create(tes::Star(__VA_ARGS__).setColour(colour).setWireframe(true)); } |
Wireframe star. More... | |
#define | TES_TEXT2D_SCREEN(server, colour, ...) if (server) { (server)->create(tes::Text2D(__VA_ARGS__).setColour(colour)); } |
Render 2D text in screen space. More... | |
#define | TES_TEXT2D_WORLD(server, colour, ...) if (server) { (server)->create(tes::Text2D(__VA_ARGS__).setInWorldSpace(true).setColour(colour)); } |
Render 2D text with a 3D world location. More... | |
#define | TES_TEXT3D(server, colour, ...) if (server) { (server)->create(tes::Text3D(__VA_ARGS__).setColour(colour)); } |
Render 3D text. More... | |
#define | TES_TEXT3D_FACING(server, colour, ...) if (server) { (server)->create(tes::Text3D(__VA_ARGS__).setScreenFacing(true).setColour(colour); } |
Render 3D text, always facing the screen. More... | |
#define | TES_TRIANGLES(server, colour, ...) if (server) { tes::MeshShape shape(tes::DtTriangles, ##__VA_ARGS__); shape.setColour(colour); (server)->create(shape); } |
Triangles shape. More... | |
#define | TES_TRIANGLES_E(server, colour, ...) if (server) { tes::MeshShape shape(tes::DtTriangles, ##__VA_ARGS__); shape.expandVertices().setColour(colour); (server)->create(shape); } |
Triangles shape, calling MeshShape::expandVertices() . More... | |
#define | TES_TRIANGLES_N(server, colour, ...) if (server) { tes::MeshShape shape(tes::DtTriangles, ##__VA_ARGS__); shape.setCalculateNormals(true).setColour(colour); (server)->create(shape); } |
Triangles shape with lighting (_N to calculate normals). More... | |
#define | TES_TRIANGLES_NE(server, colour, ...) if (server) { tes::MeshShape shape(tes::DtTriangles, ##__VA_ARGS__); shape.expandVertices().setCalculateNormals(true).setColour(colour); (server)->create(shape); } |
Triangles shape with lighting (_N to calculate normals), calling MeshShape::expandVertices() . More... | |
#define | TES_TRIANGLES_W(server, colour, ...) if (server) { tes::MeshShape shape(tes::DtTriangles, ##__VA_ARGS__); shape.setWireframe(true); shape.setColour(colour); (server)->create(shape); } |
Triangles wireframe shape. More... | |
#define | TES_TRIANGLES_WE(server, colour, ...) if (server) { tes::MeshShape shape(tes::DtTriangles, ##__VA_ARGS__); shape.expandVertices().setWireframe(true); shape.setColour(colour); (server)->create(shape); } |
Triangles wireframe shape, calling MeshShape::expandVertices() . More... | |
#define | TES_TRIANGLES_T(server, colour, ...) if (server) { tes::MeshShape shape(tes::DtTriangles, ##__VA_ARGS__); shape.setTransparent(true); shape.setColour(colour); (server)->create(shape); } |
Triangles transparent shape. More... | |
#define | TES_TRIANGLES_TE(server, colour, ...) if (server) { tes::MeshShape shape(tes::DtTriangles, ##__VA_ARGS__); shape.expandVertices().setTransparent(true); shape.setColour(colour); (server)->create(shape); } |
Triangles transparent shape, calling MeshShape::expandVertices() More... | |
#define | TES_TRIANGLE(server, colour, v0, v1, v2, ...) |
Single triangle. More... | |
#define | TES_TRIANGLE_W(server, colour, v0, v1, v2, ...) |
Single wireframe triangle. More... | |
#define | TES_TRIANGLE_T(server, colour, v0, v1, v2, ...) |
Single transparent triangle. More... | |
#define | TES_TRIANGLE_I(server, colour, verts, i0, i1, i2, ...) |
Single triangle extracted by indexing verts using i0 , i1 , i2 . More... | |
#define | TES_TRIANGLE_IW(server, colour, verts, i0, i1, i2, ...) |
Single wireframe triangle extracted by indexing verts using i0 , i1 , i2 . More... | |
#define | TES_TRIANGLE_IT(server, colour, verts, i0, i1, i2, ...) |
Single transparent triangle extracted by indexing verts using i0 , i1 , i2 . More... | |
#define | TES_ARROW_END(server, id) if (server) { (server)->destroy(tes::Arrow(static_cast<uint32_t>(id))); } |
Destroy arrow with id . More... | |
#define | TES_BOX_END(server, id) if (server) { (server)->destroy(tes::Box(static_cast<uint32_t>(id))); } |
Destroy box with id . More... | |
#define | TES_CAPSULE_END(server, id) if (server) { (server)->destroy(tes::Capsule(static_cast<uint32_t>(id))); } |
Destroy capsule with id . More... | |
#define | TES_CONE_END(server, id) if (server) { (server)->destroy(tes::Cone(static_cast<uint32_t>(id))); } |
Destroy cone with id . More... | |
#define | TES_CYLINDER_END(server, id) if (server) { (server)->destroy(tes::Cylinder(static_cast<uint32_t>(id))); } |
Destroy cylinder with id . More... | |
#define | TES_LINES_END(server, id) if (server) { (server)->destroy(tes::MeshShape(tes::DtLines, nullptr, 0, 0, static_cast<uint32_t>(id))); } |
Destroy lines with id . More... | |
#define | TES_MESHSET_END(server, id, resource) if (server) { (server)->destroy(tes::MeshSet(static_cast<uint32_t>(resource, id))); } |
Destroy mesh with id . More... | |
#define | TES_PLANE_END(server, id) if (server) { (server)->destroy(tes::Plane(static_cast<uint32_t>(id))); } |
Destroy plane with id . More... | |
#define | TES_POINTCLOUDSHAPE_END(server, cloud, id) if (server) { (server)->destroy(tes::PointCloudShape(cloud, static_cast<uint32_t>(id))); } |
Destroy point cloud with id . More... | |
#define | TES_POINTS_END(server, id) if (server) { (server)->destroy(tes::MeshShape(tes::DtPoints, nullptr, 0, 0, static_cast<uint32_t>(id))); } |
Destroy point set with id . More... | |
#define | TES_VOXELS_END(server, id) if (server) { (server)->destroy(tes::MeshShape(tes::DtVoxels, nullptr, 0, 0, static_cast<uint32_t>(id))); } |
Destroy voxel set with id . More... | |
#define | TES_SPHERE_END(server, id) if (server) { (server)->destroy(tes::Sphere(static_cast<uint32_t>(id))); } |
Destroy sphere with id . More... | |
#define | TES_STAR_END(server, id) if (server) { (server)->destroy(tes::Star(static_cast<uint32_t>(id))); } |
Destroy star with id . More... | |
#define | TES_TEXT2D_END(server, id) if (server) { (server)->destroy(tes::Text2D("", static_cast<uint32_t>(id))); } |
Destroy 2D text with id . More... | |
#define | TES_TEXT3D_END(server, id) if (server) { (server)->destroy(tes::Text3D("", static_cast<uint32_t>(id))); } |
Destroy 3D text with id . More... | |
#define | TES_TRIANGLES_END(server, id) if (server) { (server)->destroy(tes::MeshShape(tes::DtTriangles, nullptr, 0, 0, static_cast<uint32_t>(id))); } |
Destroy triangle or triangles with id . More... | |
#define | TES_TRIANGLE_END(server, id) if (server) { (server)->destroy(tes::MeshShape(tes::DtTriangles, nullptr, 0, 0, static_cast<uint32_t>(id))); } |
Destroy arrow with id . More... | |
#define | TES_POS_UPDATE(server, ShapeType, objectID, pos) if (server) { (server)->update(tes::ShapeType(objectID, 0).setPosition(pos).setFlags(tes::OFUpdateMode | tes::OFPosition)); } |
Send a position update message for a shape. More... | |
#define | TES_ROT_UPDATE(server, ShapeType, objectID, quaternion) if (server) { (server)->update(tes::ShapeType(objectID, 0).setRotation(quaternion).setFlags(tes::OFUpdateMode | tes::OFRotation)); } |
Send an update message for a shape, updating object rotation. More... | |
#define | TES_SCALE_UPDATE(server, ShapeType, objectID, scale) if (server) { (server)->update(tes::ShapeType(objectID, 0).setScale(scale).setFlags(tes::OFUpdateMode | tes::OFScale)); } |
Send an update message for a shape, updating scale. More... | |
#define | TES_COLOUR_UPDATE(server, ShapeType, objectID, colour) if (server) { (server)->update(tes::ShapeType(objectID, 0).setColour(colour).setFlags(tes::OFUpdateMode | tes::OFColour)); } |
Send an update message for a shape, updating colour. More... | |
#define | TES_COLOR_UPDATE(server, ShapeType, objectID, colour) if (server) { (server)->update(tes::ShapeType(objectID, 0).setColour(colour).setFlags(tes::OFUpdateMode | tes::OFColour)); } |
Send an update message for a shape, updating colour. More... | |
#define | TES_POSROT_UPDATE(server, ShapeType, objectID, pos, quaternion) if (server) { (server)->update(tes::ShapeType(objectID, 0).setPosition(pos).setRotation(quaternion).setFlags(tes::OFUpdateMode | tes::OFPosition | tes::OFRotation)); } |
Send an update message for a shape, updating position and rotation. More... | |
#define | TES_POSSCALE_UPDATE(server, ShapeType, objectID, pos, scale) if (server) { (server)->update(tes::ShapeType(objectID, 0).setPosition(pos).setScale(scale).setFlags(tes::OFUpdateMode | tes::OFPosition | tes::OFRotation)); } |
Send an update message for a shape, updating position and scale. More... | |
#define | TES_ROTSCALE_UPDATE(server, ShapeType, objectID, quaternion, scale) if (server) { (server)->update(tes::ShapeType(objectID, 0).setRotation(quaternion).setScale(scale).setFlags(tes::OFUpdateMode | tes::OFRotation | tes::OFScale )); } |
Send an update message for a shape, updating rotation and scale. More... | |
#define | TES_PRS_UPDATE(server, ShapeType, objectID, pos, quaternion, scale) if (server) { (server)->update(tes::ShapeType(objectID, 0).setPosition(pos).setRotation(quaternion).setScale(scale).setFlags(tes::OFUpdateMode | tes::OFPosition | tes::OFRotation | tes::OFScale )); } |
Send an update message for a shape, updating position, rotation and scale. More... | |
#define | TES_PRC_UPDATE(server, ShapeType, objectID, pos, quaternion, colour) if (server) { (server)->update(tes::ShapeType(objectID, 0).setPosition(pos).setRotation(quaternion).setColour(colour).setFlags(tes::OFUpdateMode | tes::OFPosition | tes::OFRotation | tes::OFColour )); } |
Send an update message for a shape, updating position, rotation and colour. More... | |
#define | TES_PSC_UPDATE(server, ShapeType, objectID, pos, scale, colour) if (server) { (server)->update(tes::ShapeType(objectID, 0).setPosition(pos).setScale(scale).setColour(colour).setFlags(tes::OFUpdateMode | tes::OFPosition | tes::OFScale | tes::OFColour )); } |
Send an update message for a shape, updating position, scale and colour. More... | |
#define | TES_RSC_UPDATE(server, ShapeType, objectID, quaternion, scale, colour) if (server) { (server)->update(tes::ShapeType(objectID, 0).setRotation(quaternion).setScale(scale).setColour(colour).setFlags(tes::OFUpdateMode | tes::OFRotation | tes::OFScale | tes::OFColour )); } |
Send an update message for a shape, updating rotation, scale and colour. More... | |
#define | TES_PRSC_UPDATE(server, ShapeType, objectID, pos, quaternion, scale, colour) if (server) { (server)->update(tes::ShapeType(objectID, 0).setPosition(pos).setRotation(quaternion).setScale(scale).setColour(colour) )); } |
Send an update message for a shape, updating all transform and colour attributes. More... | |
The 3rd Eye Scene macro interface provides a way of instrumenting your code with 3rd Eye Scene directives, while being able to conditionally remove these directives from selected builds.
The macros are enabled if TES_ENABLE
is defined when including 3esservermacros.h
. Otherwise the macros remove the code contained in their brackets.
#define TES_ACTIVE | ( | server | ) | ((server) != nullptr && (server)->active()) |
Check if server
is enabled.
server | The Server or Connection object. Must be a dereferenced pointer. |
#define TES_ARROW | ( | server, | |
colour, | |||
... | |||
) | if (server) { (server)->create(tes::Arrow(__VA_ARGS__).setColour(colour)); } |
Solid arrow.
server | The Server or Connection object. Must be a dereferenced pointer. |
colour | The colour to apply to the shape. |
... | Additional arguments follow, passed to Arrow() constructor. |
#define TES_ARROW_END | ( | server, | |
id | |||
) | if (server) { (server)->destroy(tes::Arrow(static_cast<uint32_t>(id))); } |
Destroy arrow with id
.
server | The Server or Connection object. Must be a dereferenced pointer. |
id | The ID of the shape to destroy. |
#define TES_ARROW_T | ( | server, | |
colour, | |||
... | |||
) | if (server) { (server)->create(tes::Arrow(__VA_ARGS__).setColour(colour).setTransparent(true)); } |
Transparent arrow.
server | The Server or Connection object. Must be a dereferenced pointer. |
colour | The colour to apply to the shape. |
... | Additional arguments follow, passed to Arrow() constructor. |
#define TES_ARROW_W | ( | server, | |
colour, | |||
... | |||
) | if (server) { (server)->create(tes::Arrow(__VA_ARGS__).setColour(colour).setWireframe(true)); } |
Wireframe arrow.
server | The Server or Connection object. Must be a dereferenced pointer. |
colour | The colour to apply to the shape. |
... | Additional arguments follow, passed to Arrow() constructor. |
#define TES_BOX | ( | server, | |
colour, | |||
... | |||
) | if (server) { (server)->create(tes::Box(__VA_ARGS__).setColour(colour)); } |
Solid box.
server | The Server or Connection object. Must be a dereferenced pointer. |
colour | The colour to apply to the shape. |
... | Additional arguments follow, passed to Box() constructor. |
#define TES_BOX_END | ( | server, | |
id | |||
) | if (server) { (server)->destroy(tes::Box(static_cast<uint32_t>(id))); } |
Destroy box with id
.
server | The Server or Connection object. Must be a dereferenced pointer. |
id | The ID of the shape to destroy. |
#define TES_BOX_T | ( | server, | |
colour, | |||
... | |||
) | if (server) { (server)->create(tes::Box(__VA_ARGS__).setColour(colour).setTransparent(true)); } |
Transparent box.
server | The Server or Connection object. Must be a dereferenced pointer. |
colour | The colour to apply to the shape. |
... | Additional arguments follow, passed to Box() constructor. |
#define TES_BOX_W | ( | server, | |
colour, | |||
... | |||
) | if (server) { (server)->create(tes::Box(__VA_ARGS__).setColour(colour).setWireframe(true)); } |
Wireframe box.
server | The Server or Connection object. Must be a dereferenced pointer. |
colour | The colour to apply to the shape. |
... | Additional arguments follow, passed to Box() constructor. |
#define TES_CAPSULE | ( | server, | |
colour, | |||
... | |||
) | if (server) { (server)->create(tes::Capsule(__VA_ARGS__).setColour(colour)); } |
Solid capsule.
server | The Server or Connection object. Must be a dereferenced pointer. |
colour | The colour to apply to the shape. |
... | Additional arguments follow, passed to Capsule() constructor. |
#define TES_CAPSULE_END | ( | server, | |
id | |||
) | if (server) { (server)->destroy(tes::Capsule(static_cast<uint32_t>(id))); } |
Destroy capsule with id
.
server | The Server or Connection object. Must be a dereferenced pointer. |
id | The ID of the shape to destroy. |
#define TES_CAPSULE_T | ( | server, | |
colour, | |||
... | |||
) | if (server) { (server)->create(tes::Capsule(__VA_ARGS__).setColour(colour).setTransparent(true)); } |
Transparent capsule.
server | The Server or Connection object. Must be a dereferenced pointer. |
colour | The colour to apply to the shape. |
... | Additional arguments follow, passed to Capsule() constructor. |
#define TES_CAPSULE_W | ( | server, | |
colour, | |||
... | |||
) | if (server) { (server)->create(tes::Capsule(__VA_ARGS__).setColour(colour).setWireframe(true)); } |
Wireframe capsule.
server | The Server or Connection object. Must be a dereferenced pointer. |
colour | The colour to apply to the shape. |
... | Additional arguments follow, passed to Capsule() constructor. |
#define TES_CATEGORY | ( | server, | |
_name, | |||
_categoryId, | |||
_parentId, | |||
_active | |||
) |
Exposes details of a category to connected clients.
server | The Server or Connection object. Must be a dereferenced pointer. |
_name | A null terminated, UTF-8 string name for the category. |
_categoryId | ID of the category being named [0, 65535]. |
_parentId | ID of the parent category, to support category trees. Zero for none. [0, 65535] |
_active | Default the category to the active state (true/false)? |
#define TES_COLOR_UPDATE | ( | server, | |
ShapeType, | |||
objectID, | |||
colour | |||
) | if (server) { (server)->update(tes::ShapeType(objectID, 0).setColour(colour).setFlags(tes::OFUpdateMode | tes::OFColour)); } |
Send an update message for a shape, updating colour.
server | The Server or Connection object. Must be a dereferenced pointer. |
ShapeType | The class of the shape to update. E.g., tes::Box |
objectID | The ID of the object to update. |
colour | The new object Colour . |
#define TES_COLOUR | ( | name | ) | tes::Colour::Colours[tes::Colour::name] |
Colour by name.
name | a member of tes::Colour::Predefined . |
#define TES_COLOUR_A | ( | name, | |
a | |||
) | tes::Colour(tes::Colour::Colours[tes::Colour::name], a) |
Colour by name with alpha.
name | a member of tes::Colour::Predefined . |
a | Alpha channel value [0, 255]. |
#define TES_COLOUR_I | ( | index | ) | tes::Colour::Colours[index] |
Colour by predefined index.
index | A valid value within tes::Colour::Predefined . |
#define TES_COLOUR_UPDATE | ( | server, | |
ShapeType, | |||
objectID, | |||
colour | |||
) | if (server) { (server)->update(tes::ShapeType(objectID, 0).setColour(colour).setFlags(tes::OFUpdateMode | tes::OFColour)); } |
Send an update message for a shape, updating colour.
server | The Server or Connection object. Must be a dereferenced pointer. |
ShapeType | The class of the shape to update. E.g., tes::Box |
objectID | The ID of the object to update. |
colour | The new object Colour . |
#define TES_CONE | ( | server, | |
colour, | |||
... | |||
) | if (server) { (server)->create(tes::Cone(__VA_ARGS__).setColour(colour)); } |
Solid cone.
server | The Server or Connection object. Must be a dereferenced pointer. |
colour | The colour to apply to the shape. |
... | Additional arguments follow, passed to Cone() constructor. |
#define TES_CONE_END | ( | server, | |
id | |||
) | if (server) { (server)->destroy(tes::Cone(static_cast<uint32_t>(id))); } |
Destroy cone with id
.
server | The Server or Connection object. Must be a dereferenced pointer. |
id | The ID of the shape to destroy. |
#define TES_CONE_T | ( | server, | |
colour, | |||
... | |||
) | if (server) { (server)->create(tes::Cone(__VA_ARGS__).setColour(colour).setTransparent(true)); } |
Transparent cone.
server | The Server or Connection object. Must be a dereferenced pointer. |
colour | The colour to apply to the shape. |
... | Additional arguments follow, passed to Cone() constructor. |
#define TES_CONE_W | ( | server, | |
colour, | |||
... | |||
) | if (server) { (server)->create(tes::Cone(__VA_ARGS__).setColour(colour).setWireframe(true)); } |
Wireframe cone.
server | The Server or Connection object. Must be a dereferenced pointer. |
colour | The colour to apply to the shape. |
... | Additional arguments follow, passed to Cone() constructor. |
#define TES_CYLINDER | ( | server, | |
colour, | |||
... | |||
) | if (server) { (server)->create(tes::Cylinder(__VA_ARGS__).setColour(colour)); } |
Solid cylinder.
server | The Server or Connection object. Must be a dereferenced pointer. |
colour | The colour to apply to the shape. |
... | Additional arguments follow, passed to Cylinder() constructor. |
#define TES_CYLINDER_END | ( | server, | |
id | |||
) | if (server) { (server)->destroy(tes::Cylinder(static_cast<uint32_t>(id))); } |
Destroy cylinder with id
.
server | The Server or Connection object. Must be a dereferenced pointer. |
id | The ID of the shape to destroy. |
#define TES_CYLINDER_T | ( | server, | |
colour, | |||
... | |||
) | if (server) { (server)->create(tes::Cylinder(__VA_ARGS__).setColour(colour).setTransparent(true)); } |
Transparent cylinder.
server | The Server or Connection object. Must be a dereferenced pointer. |
colour | The colour to apply to the shape. |
... | Additional arguments follow, passed to Cylinder() constructor. |
#define TES_CYLINDER_W | ( | server, | |
colour, | |||
... | |||
) | if (server) { (server)->create(tes::Cylinder(__VA_ARGS__).setColour(colour).setWireframe(true)); } |
Wireframe cylinder.
server | The Server or Connection object. Must be a dereferenced pointer. |
colour | The colour to apply to the shape. |
... | Additional arguments follow, passed to Cylinder() constructor. |
#define TES_FEATURE | ( | feature | ) | tes::checkFeature(feature) |
Check if a feature is enabled using checkFeature()
.
feature | The feature to check for. |
#define TES_FEATURE_FLAG | ( | feature | ) | tes::featureFlag(feature) |
Get the flag for a feature.
feature | The feature identifier. |
#define TES_FEATURES | ( | featureFlags | ) | tes::checkFeatures(featureFlags) |
Check if the given set of features are enabled using checkFeatures()
.
featureFlags | The flags to check for. |
#define TES_IF | ( | condition | ) | if (condition) |
Begins an if statement with condition, but only if TES is enabled.
Otherwise the macro is if (false)
condition | The if statement condition. |
#define TES_IF_FEATURES | ( | featureFlags, | |
expression | |||
) |
Execute expression
if featureFlags
are all present using checkFeatures()
.
featureFlags | The flags to require before executing expression . |
expression | The code statement or expression to execute if checkFeatures() passes. |
#define TES_LINE | ( | server, | |
colour, | |||
v0, | |||
v1, | |||
... | |||
) |
server | The Server or Connection object. Must be a dereferenced pointer. |
colour | The colour to apply to the shape. |
v0 | Vertex of the first line end point. |
v1 | Second vertex for the line starting at v0 . |
... | Additional arguments follow, passed to MeshShape() constructor. |
#define TES_LINES | ( | server, | |
colour, | |||
... | |||
) | if (server) { (server)->create(tes::MeshShape(tes::DtLines, ##__VA_ARGS__).setColour(colour)); } |
Render a set of lines.
server | The Server or Connection object. Must be a dereferenced pointer. |
colour | The colour to apply to the shape. |
... | Additional arguments follow, passed to MeshShape() constructor. |
#define TES_LINES_E | ( | server, | |
colour, | |||
... | |||
) | if (server) { (server)->create(tes::MeshShape(tes::DtLines, ##__VA_ARGS__).expandVertices().setColour(colour)); } |
Render a set of lines, calling MeshShape::expandVertices()
.
server | The Server or Connection object. Must be a dereferenced pointer. |
colour | The colour to apply to the shape. |
... | Additional arguments follow, passed to MeshShape() constructor. |
#define TES_LINES_END | ( | server, | |
id | |||
) | if (server) { (server)->destroy(tes::MeshShape(tes::DtLines, nullptr, 0, 0, static_cast<uint32_t>(id))); } |
Destroy lines with id
.
server | The Server or Connection object. Must be a dereferenced pointer. |
id | The ID of the shape to destroy. |
#define TES_MESH_PLACEHOLDER | ( | id | ) | tes::MeshPlaceholder(id) |
Makes a stack declaration of a placeholder mesh resource.
Primarily for use with TES_REFERENCE_RESOURCE()
, TES_RELEASE_RESOURCE
and TES_MESHSET_END()
.
id | The mesh resource ID to proxy. |
#define TES_MESHSET | ( | server, | |
... | |||
) | if (server) { (server)->create(tes::MeshSet(__VA_ARGS__)); } |
Render a complex mesh.
server | The Server or Connection object. Must be a dereferenced pointer. |
... | Additional arguments follow, passed to MeshSet() constructor. |
#define TES_MESHSET_END | ( | server, | |
id, | |||
resource | |||
) | if (server) { (server)->destroy(tes::MeshSet(static_cast<uint32_t>(resource, id))); } |
Destroy mesh with id
.
server | The Server or Connection object. Must be a dereferenced pointer. |
id | The ID of the shape to destroy. |
resource | The mesh resource associated with the set. Only supports one mesh. Must be a pointer type : tes::MeshResource * |
#define TES_PLANE | ( | server, | |
colour, | |||
... | |||
) | if (server) { (server)->create(tes::Plane(__VA_ARGS__).setColour(colour)); } |
Solid plane.
server | The Server or Connection object. Must be a dereferenced pointer. |
colour | The colour to apply to the shape. |
... | Additional arguments follow, passed to Plane() constructor. |
#define TES_PLANE_END | ( | server, | |
id | |||
) | if (server) { (server)->destroy(tes::Plane(static_cast<uint32_t>(id))); } |
Destroy plane with id
.
server | The Server or Connection object. Must be a dereferenced pointer. |
id | The ID of the shape to destroy. |
#define TES_PLANE_T | ( | server, | |
colour, | |||
... | |||
) | if (server) { (server)->create(tes::Plane(__VA_ARGS__).setColour(colour).setTransparent(true)); } |
Transparent plane.
server | The Server or Connection object. Must be a dereferenced pointer. |
colour | The colour to apply to the shape. |
... | Additional arguments follow, passed to Plane() constructor. |
#define TES_PLANE_W | ( | server, | |
colour, | |||
... | |||
) | if (server) { (server)->create(tes::Plane(__VA_ARGS__).setColour(colour).setWireframe(true)); } |
Wireframe plane.
server | The Server or Connection object. Must be a dereferenced pointer. |
colour | The colour to apply to the shape. |
... | Additional arguments follow, passed to Plane() constructor. |
#define TES_POINTCLOUDSHAPE | ( | server, | |
colour, | |||
... | |||
) | if (server) { (server)->create(tes::PointCloudShape(__VA_ARGS__).setColour(colour)); } |
Render a point cloud.
server | The Server or Connection object. Must be a dereferenced pointer. |
colour | The colour to apply to the shape. |
... | Additional arguments follow, passed to PointCloudShape() constructor. |
#define TES_POINTCLOUDSHAPE_END | ( | server, | |
cloud, | |||
id | |||
) | if (server) { (server)->destroy(tes::PointCloudShape(cloud, static_cast<uint32_t>(id))); } |
Destroy point cloud with id
.
server | The Server or Connection object. Must be a dereferenced pointer. |
cloud | The MeshResource (e.g., PointCloud ) containing the point vertex data. |
id | The ID of the shape to destroy. |
#define TES_POINTS | ( | server, | |
colour, | |||
... | |||
) | if (server) { (server)->create(tes::MeshShape(tes::DtPoints, ##__VA_ARGS__).setColour(colour)); } |
Render a small set of points.
server | The Server or Connection object. Must be a dereferenced pointer. |
colour | The colour to apply to the shape. |
... | Additional arguments follow, passed to MeshShape() constructor. |
#define TES_POINTS_E | ( | server, | |
colour, | |||
... | |||
) | if (server) { (server)->create(tes::MeshShape(tes::DtPoints, ##__VA_ARGS__).expandVertices().setColour(colour)); } |
Render a small set of points, calling MeshShape::expandVertices()
.
server | The Server or Connection object. Must be a dereferenced pointer. |
colour | The colour to apply to the shape. |
... | Additional arguments follow, passed to MeshShape() constructor. |
#define TES_POINTS_END | ( | server, | |
id | |||
) | if (server) { (server)->destroy(tes::MeshShape(tes::DtPoints, nullptr, 0, 0, static_cast<uint32_t>(id))); } |
Destroy point set with id
.
server | The Server or Connection object. Must be a dereferenced pointer. |
id | The ID of the shape to destroy. |
#define TES_POS_UPDATE | ( | server, | |
ShapeType, | |||
objectID, | |||
pos | |||
) | if (server) { (server)->update(tes::ShapeType(objectID, 0).setPosition(pos).setFlags(tes::OFUpdateMode | tes::OFPosition)); } |
Send a position update message for a shape.
server | The Server or Connection object. Must be a dereferenced pointer. |
ShapeType | The class of the shape to update. E.g., tes::Box |
objectID | The ID of the object to update. |
pos | The new position. A V3Arg compatible argument. |
#define TES_POSROT_UPDATE | ( | server, | |
ShapeType, | |||
objectID, | |||
pos, | |||
quaternion | |||
) | if (server) { (server)->update(tes::ShapeType(objectID, 0).setPosition(pos).setRotation(quaternion).setFlags(tes::OFUpdateMode | tes::OFPosition | tes::OFRotation)); } |
Send an update message for a shape, updating position and rotation.
server | The Server or Connection object. Must be a dereferenced pointer. |
ShapeType | The class of the shape to update. E.g., tes::Box |
objectID | The ID of the object to update. |
pos | The new position. A V3Arg compatible argument. |
quaternion | The updated quaternion rotation. A QuaternionArg compatible argument. |
#define TES_POSSCALE_UPDATE | ( | server, | |
ShapeType, | |||
objectID, | |||
pos, | |||
scale | |||
) | if (server) { (server)->update(tes::ShapeType(objectID, 0).setPosition(pos).setScale(scale).setFlags(tes::OFUpdateMode | tes::OFPosition | tes::OFRotation)); } |
Send an update message for a shape, updating position and scale.
server | The Server or Connection object. Must be a dereferenced pointer. |
ShapeType | The class of the shape to update. E.g., tes::Box |
objectID | The ID of the object to update. |
pos | The new position. A V3Arg compatible argument. |
scale | The new object scale. A V3Arg compatible argument. |
#define TES_PRC_UPDATE | ( | server, | |
ShapeType, | |||
objectID, | |||
pos, | |||
quaternion, | |||
colour | |||
) | if (server) { (server)->update(tes::ShapeType(objectID, 0).setPosition(pos).setRotation(quaternion).setColour(colour).setFlags(tes::OFUpdateMode | tes::OFPosition | tes::OFRotation | tes::OFColour )); } |
Send an update message for a shape, updating position, rotation and colour.
server | The Server or Connection object. Must be a dereferenced pointer. |
ShapeType | The class of the shape to update. E.g., tes::Box |
objectID | The ID of the object to update. |
pos | The new position. A V3Arg compatible argument. |
quaternion | The updated quaternion rotation. A QuaternionArg compatible argument. |
colour | The new object Colour . |
#define TES_PRS_UPDATE | ( | server, | |
ShapeType, | |||
objectID, | |||
pos, | |||
quaternion, | |||
scale | |||
) | if (server) { (server)->update(tes::ShapeType(objectID, 0).setPosition(pos).setRotation(quaternion).setScale(scale).setFlags(tes::OFUpdateMode | tes::OFPosition | tes::OFRotation | tes::OFScale )); } |
Send an update message for a shape, updating position, rotation and scale.
server | The Server or Connection object. Must be a dereferenced pointer. |
ShapeType | The class of the shape to update. E.g., tes::Box |
objectID | The ID of the object to update. |
pos | The new position. A V3Arg compatible argument. |
quaternion | The updated quaternion rotation. A QuaternionArg compatible argument. |
scale | The new object scale. A V3Arg compatible argument. |
#define TES_PRSC_UPDATE | ( | server, | |
ShapeType, | |||
objectID, | |||
pos, | |||
quaternion, | |||
scale, | |||
colour | |||
) | if (server) { (server)->update(tes::ShapeType(objectID, 0).setPosition(pos).setRotation(quaternion).setScale(scale).setColour(colour) )); } |
Send an update message for a shape, updating all transform and colour attributes.
server | The Server or Connection object. Must be a dereferenced pointer. |
ShapeType | The class of the shape to update. E.g., tes::Box |
objectID | The ID of the object to update. |
pos | The new position. A V3Arg compatible argument. |
quaternion | The updated quaternion rotation. A QuaternionArg compatible argument. |
scale | The new object scale. A V3Arg compatible argument. |
colour | The new object Colour . |
#define TES_PSC_UPDATE | ( | server, | |
ShapeType, | |||
objectID, | |||
pos, | |||
scale, | |||
colour | |||
) | if (server) { (server)->update(tes::ShapeType(objectID, 0).setPosition(pos).setScale(scale).setColour(colour).setFlags(tes::OFUpdateMode | tes::OFPosition | tes::OFScale | tes::OFColour )); } |
Send an update message for a shape, updating position, scale and colour.
server | The Server or Connection object. Must be a dereferenced pointer. |
ShapeType | The class of the shape to update. E.g., tes::Box |
objectID | The ID of the object to update. |
pos | The new position. A V3Arg compatible argument. |
scale | The new object scale. A V3Arg compatible argument. |
colour | The new object Colour . |
#define TES_PTR_ID | ( | ptr | ) | static_cast<uint32_t>(reinterpret_cast<uint64_t>(ptr)) |
A helper macro to convert a pointer, such as this
, into a 32-bit ID value.
This can be used as a rudimentary object ID assignment system.
ptr | A pointer value. |
#define TES_REFERENCE_RESOURCE | ( | server, | |
resource | |||
) | if (server) { (server)->referenceResource(resource); } |
Adds a reference to the given resource
.
See tes::Connection::referenceResource()
.
server | The Server or Connection object. Must be a dereferenced pointer. |
resource | A pointer to the resource. |
#define TES_RELEASE_RESOURCE | ( | server, | |
resource | |||
) | if (server) { (server)->releaseResource(resource); } |
Releases a reference to the given resource
.
See tes::Connection::referenceResource()
.
server | The Server or Connection object. Must be a dereferenced pointer. |
resource | A pointer to the resource. |
#define TES_RGB | ( | r, | |
g, | |||
b | |||
) | tes::Colour(r, g, b) |
Colour from RGB.
r | Red channel value [0, 255]. |
g | Green channel value [0, 255]. |
b | Blue channel value [0, 255]. |
#define TES_RGBA | ( | r, | |
g, | |||
b, | |||
a | |||
) | tes::Colour(r, g, b, a) |
Colour from RGBA.
r | Red channel value [0, 255]. |
g | Green channel value [0, 255]. |
b | Blue channel value [0, 255]. |
a | Alpha channel value [0, 255]. |
#define TES_ROT_UPDATE | ( | server, | |
ShapeType, | |||
objectID, | |||
quaternion | |||
) | if (server) { (server)->update(tes::ShapeType(objectID, 0).setRotation(quaternion).setFlags(tes::OFUpdateMode | tes::OFRotation)); } |
Send an update message for a shape, updating object rotation.
server | The Server or Connection object. Must be a dereferenced pointer. |
ShapeType | The class of the shape to update. E.g., tes::Box |
objectID | The ID of the object to update. |
quaternion | The updated quaternion rotation. A QuaternionArg compatible argument. |
#define TES_ROTSCALE_UPDATE | ( | server, | |
ShapeType, | |||
objectID, | |||
quaternion, | |||
scale | |||
) | if (server) { (server)->update(tes::ShapeType(objectID, 0).setRotation(quaternion).setScale(scale).setFlags(tes::OFUpdateMode | tes::OFRotation | tes::OFScale )); } |
Send an update message for a shape, updating rotation and scale.
server | The Server or Connection object. Must be a dereferenced pointer. |
ShapeType | The class of the shape to update. E.g., tes::Box |
objectID | The ID of the object to update. |
quaternion | The updated quaternion rotation. A QuaternionArg compatible argument. |
scale | The new object scale. A V3Arg compatible argument. |
#define TES_RSC_UPDATE | ( | server, | |
ShapeType, | |||
objectID, | |||
quaternion, | |||
scale, | |||
colour | |||
) | if (server) { (server)->update(tes::ShapeType(objectID, 0).setRotation(quaternion).setScale(scale).setColour(colour).setFlags(tes::OFUpdateMode | tes::OFRotation | tes::OFScale | tes::OFColour )); } |
Send an update message for a shape, updating rotation, scale and colour.
server | The Server or Connection object. Must be a dereferenced pointer. |
ShapeType | The class of the shape to update. E.g., tes::Box |
objectID | The ID of the object to update. |
quaternion | The updated quaternion rotation. A QuaternionArg compatible argument. |
scale | The new object scale. A V3Arg compatible argument. |
colour | The new object Colour . |
#define TES_SCALE_UPDATE | ( | server, | |
ShapeType, | |||
objectID, | |||
scale | |||
) | if (server) { (server)->update(tes::ShapeType(objectID, 0).setScale(scale).setFlags(tes::OFUpdateMode | tes::OFScale)); } |
Send an update message for a shape, updating scale.
server | The Server or Connection object. Must be a dereferenced pointer. |
ShapeType | The class of the shape to update. E.g., tes::Box |
objectID | The ID of the object to update. |
scale | The new object scale. A V3Arg compatible argument. |
#define TES_SERVER_CREATE | ( | server, | |
settings, | |||
info | |||
) | server = tes::Server::create(settings, info); |
Initialise server
to a new Server
object with the given ServerSettings
and ServerInfoMessage
.
server | The Server or Connection object. Must be a dereferenced pointer. |
settings | The ServerSettings structure to initialise the server with. |
info | The ServerInfoMessage structure to initialise the server with. |
#define TES_SERVER_DECL | ( | server | ) | tes::Server *server = nullptr; |
A helper macro used to declare a Server
pointer and compile out when TES is not enabled.
Initialises server
as a Server
variable with a null value.
server | The variable name for the Server object. |
#define TES_SERVER_INFO | ( | info, | |
infoCoordinateFrame | |||
) |
Initialise a default ServerInfoMessage
and assign the specified CoordinateFrame
.
The time unit details for info
can be initialise using TES_SERVER_INFO_TIME()
initDefaultServerInfo()
info | Variable name for the ServerInfoMessage structure. |
infoCoordinateFrame | The server's CoordinateFrame value. |
#define TES_SERVER_INFO_TIME | ( | info, | |
timeUnit, | |||
defaultFrameTime | |||
) |
Initialise the time unit details of a ServerInfoMessage
.
info | the ServerInfoMessage structure variable. |
timeUnit | The ServerInfoMessage::timeUnit value to set. |
defaultFrameTime | The ServerInfoMessage::defaultFrameTime value to set. |
#define TES_SERVER_START | ( | server, | |
mode | |||
) | if (server) { (server)->connectionMonitor()->start(mode); } |
Start the given Server
in the given mode (synchronous or asynchronous).
After this call, the server can accept connections.
server | The Server or Connection object. Must be a dereferenced pointer. |
mode | The server mode: ConnectionMonitor::Synchronous or ConnectionMonitor::Asynchronous . |
#define TES_SERVER_START_WAIT | ( | server, | |
timems | |||
) |
Wait for the server to be ready to accept incoming connections.
This blocks until at least one connection is established up to timems
milliseconds.
server | The Server or Connection object. Must be a dereferenced pointer. |
timems | The wait time out to wait for (milliseconds). |
#define TES_SERVER_STOP | ( | server | ) |
Stop the server.
The server is closed and disposed and is no longer valid for use after this call. Note the server
argument must be a pointer as it is first checked against null, then cleared to nullptr
.
server | The Server or Connection object. Must be a dereferenced pointer. |
#define TES_SERVER_UPDATE | ( | server, | |
... | |||
) |
Call to update the server flushing the frame and potentially monitoring new connections.
This update macro performs the following update commands:
Server::updateFrame()
Any additional macro arguments are passed to Server::updateFrame()
. At the very least a delta time value must be passed (floating point, in seconds). This should be zero when using TES for algorithm debugging, or a valid time delta in real-time debugging.
server | The Server or Connection object. Must be a dereferenced pointer. |
... | Arguments for Server::updateFrame() |
#define TES_SET_ACTIVE | ( | server, | |
_active | |||
) | if (server) { (server)->setActive(_active) } |
Enable/disable server
.
server | The Server or Connection object. Must be a dereferenced pointer. |
_active | true to activate, false to deactivate. |
#define TES_SET_CONNECTION_CALLBACK | ( | server, | |
... | |||
) | if (server) { (server)->connectionMonitor()->setConnectionCallback(__VA_ARGS__); } |
Set the connection callback via ConnectionMonitor::setConnectionCallback()
.
#define TES_SETTINGS | ( | settings, | |
... | |||
) | tes::ServerSettings settings = tes::ServerSettings(__VA_ARGS__); |
A helper macro used to declare and initialise ServerSettings
and compile out when TES is not enabled.
settings | The variable name for the ServerSettings . |
... | Additional arguments passed to the ServerSettings constructor. |
#define TES_SPHERE | ( | server, | |
colour, | |||
... | |||
) | if (server) { (server)->create(tes::Sphere(__VA_ARGS__).setColour(colour)); } |
Solid sphere.
server | The Server or Connection object. Must be a dereferenced pointer. |
colour | The colour to apply to the shape. |
... | Additional arguments follow, passed to Sphere() constructor. |
#define TES_SPHERE_END | ( | server, | |
id | |||
) | if (server) { (server)->destroy(tes::Sphere(static_cast<uint32_t>(id))); } |
Destroy sphere with id
.
server | The Server or Connection object. Must be a dereferenced pointer. |
id | The ID of the shape to destroy. |
#define TES_SPHERE_T | ( | server, | |
colour, | |||
... | |||
) | if (server) { (server)->create(tes::Sphere(__VA_ARGS__).setColour(colour).setTransparent(true)); } |
Transparent sphere.
server | The Server or Connection object. Must be a dereferenced pointer. |
colour | The colour to apply to the shape. |
... | Additional arguments follow, passed to Sphere() constructor. |
#define TES_SPHERE_W | ( | server, | |
colour, | |||
... | |||
) | if (server) { (server)->create(tes::Sphere(__VA_ARGS__).setColour(colour).setWireframe(true)); } |
Wireframe sphere.
server | The Server or Connection object. Must be a dereferenced pointer. |
colour | The colour to apply to the shape. |
... | Additional arguments follow, passed to Sphere() constructor. |
#define TES_STAR | ( | server, | |
colour, | |||
... | |||
) | if (server) { (server)->create(tes::Star(__VA_ARGS__).setColour(colour)); } |
Solid star.
server | The Server or Connection object. Must be a dereferenced pointer. |
colour | The colour to apply to the shape. |
... | Additional arguments follow, passed to Star() constructor. |
#define TES_STAR_END | ( | server, | |
id | |||
) | if (server) { (server)->destroy(tes::Star(static_cast<uint32_t>(id))); } |
Destroy star with id
.
server | The Server or Connection object. Must be a dereferenced pointer. |
id | The ID of the shape to destroy. |
#define TES_STAR_T | ( | server, | |
colour, | |||
... | |||
) | if (server) { (server)->create(tes::Star(__VA_ARGS__).setColour(colour).setTransparent(true)); } |
Transparent star.
server | The Server or Connection object. Must be a dereferenced pointer. |
colour | The colour to apply to the shape. |
... | Additional arguments follow, passed to Star() constructor. |
#define TES_STAR_W | ( | server, | |
colour, | |||
... | |||
) | if (server) { (server)->create(tes::Star(__VA_ARGS__).setColour(colour).setWireframe(true)); } |
Wireframe star.
server | The Server or Connection object. Must be a dereferenced pointer. |
colour | The colour to apply to the shape. |
... | Additional arguments follow, passed to Star() constructor. |
#define TES_STMT | ( | statement | ) | statement |
Enable statement
if TES is enabled.
The statement is completely removed when TES is not enabled.
statement | The code statement to execute. |
#define TES_TEXT2D_END | ( | server, | |
id | |||
) | if (server) { (server)->destroy(tes::Text2D("", static_cast<uint32_t>(id))); } |
Destroy 2D text with id
.
server | The Server or Connection object. Must be a dereferenced pointer. |
id | The ID of the shape to destroy. |
#define TES_TEXT2D_SCREEN | ( | server, | |
colour, | |||
... | |||
) | if (server) { (server)->create(tes::Text2D(__VA_ARGS__).setColour(colour)); } |
Render 2D text in screen space.
Range is from (0, 0) top left to (1, 1) bottom right. Z ignored.
server | The Server or Connection object. Must be a dereferenced pointer. |
colour | The colour to apply to the shape. |
... | Additional arguments follow, passed to Text2D() constructor. |
#define TES_TEXT2D_WORLD | ( | server, | |
colour, | |||
... | |||
) | if (server) { (server)->create(tes::Text2D(__VA_ARGS__).setInWorldSpace(true).setColour(colour)); } |
Render 2D text with a 3D world location.
server | The Server or Connection object. Must be a dereferenced pointer. |
colour | The colour to apply to the shape. |
... | Additional arguments follow, passed to Text2D() constructor. |
#define TES_TEXT3D | ( | server, | |
colour, | |||
... | |||
) | if (server) { (server)->create(tes::Text3D(__VA_ARGS__).setColour(colour)); } |
Render 3D text.
server | The Server or Connection object. Must be a dereferenced pointer. |
colour | The colour to apply to the shape. |
... | Additional arguments follow, passed to Text3D() constructor. |
#define TES_TEXT3D_END | ( | server, | |
id | |||
) | if (server) { (server)->destroy(tes::Text3D("", static_cast<uint32_t>(id))); } |
Destroy 3D text with id
.
server | The Server or Connection object. Must be a dereferenced pointer. |
id | The ID of the shape to destroy. |
#define TES_TEXT3D_FACING | ( | server, | |
colour, | |||
... | |||
) | if (server) { (server)->create(tes::Text3D(__VA_ARGS__).setScreenFacing(true).setColour(colour); } |
Render 3D text, always facing the screen.
server | The Server or Connection object. Must be a dereferenced pointer. |
colour | The colour to apply to the shape. |
... | Additional arguments follow, passed to Text3D() constructor. |
#define TES_TRIANGLE | ( | server, | |
colour, | |||
v0, | |||
v1, | |||
v2, | |||
... | |||
) |
Single triangle.
Vertices are specified as any type which can be used as a constructor argument to Vector3f
. Generally const float *
is recommended.
server | The Server or Connection object. Must be a dereferenced pointer. |
colour | The colour to apply to the shape. |
v0 | First triangle vertex: castable to a Vector3f (such as const float * ). |
v1 | Second triangle vertex. |
v2 | Third triangle vertex. |
... | Additional arguments follow, passed to MeshShape() constructor. |
#define TES_TRIANGLE_END | ( | server, | |
id | |||
) | if (server) { (server)->destroy(tes::MeshShape(tes::DtTriangles, nullptr, 0, 0, static_cast<uint32_t>(id))); } |
Destroy arrow with id
.
server | The Server or Connection object. Must be a dereferenced pointer. |
id | The ID of the shape to destroy. |
#define TES_TRIANGLE_I | ( | server, | |
colour, | |||
verts, | |||
i0, | |||
i1, | |||
i2, | |||
... | |||
) |
Single triangle extracted by indexing verts
using i0
, i1
, i2
.
verts
is expected as a float array with 3 elements per vertex.
Note: Only the indexed vertices are extracted and serialised.
server | The Server or Connection object. Must be a dereferenced pointer. |
colour | The colour to apply to the shape. |
verts | Vertices to index the triangle into. Must be a float array with 3 elements per vertex. |
i0 | Index to a triangle vertex. |
i1 | Index to a triangle vertex. |
i2 | Index to a triangle vertex. |
... | Additional arguments follow, passed to MeshShape() constructor. |
#define TES_TRIANGLE_IT | ( | server, | |
colour, | |||
verts, | |||
i0, | |||
i1, | |||
i2, | |||
... | |||
) |
Single transparent triangle extracted by indexing verts
using i0
, i1
, i2
.
verts
is expected as a float array with 3 elements per vertex.
Note: Only the indexed vertices are extracted and serialised.
server | The Server or Connection object. Must be a dereferenced pointer. |
colour | The colour to apply to the shape. |
verts | Vertices to index the triangle into. Must be a float array with 3 elements per vertex. |
i0 | Index to a triangle vertex. |
i1 | Index to a triangle vertex. |
i2 | Index to a triangle vertex. |
... | Additional arguments follow, passed to MeshShape() constructor. |
#define TES_TRIANGLE_IW | ( | server, | |
colour, | |||
verts, | |||
i0, | |||
i1, | |||
i2, | |||
... | |||
) |
Single wireframe triangle extracted by indexing verts
using i0
, i1
, i2
.
verts
is expected as a float array with 3 elements per vertex.
Note: Only the indexed vertices are extracted and serialised.
server | The Server or Connection object. Must be a dereferenced pointer. |
colour | The colour to apply to the shape. |
verts | Vertices to index the triangle into. Must be a float array with 3 elements per vertex. |
i0 | Index to a triangle vertex. |
i1 | Index to a triangle vertex. |
i2 | Index to a triangle vertex. |
... | Additional arguments follow, passed to MeshShape() constructor. |
#define TES_TRIANGLE_T | ( | server, | |
colour, | |||
v0, | |||
v1, | |||
v2, | |||
... | |||
) |
Single transparent triangle.
server | The Server or Connection object. Must be a dereferenced pointer. |
colour | The colour to apply to the shape. |
v0 | A triangle vertex. |
v1 | A triangle vertex. |
v2 | A triangle vertex. |
... | Additional arguments follow, passed to MeshShape() constructor. |
#define TES_TRIANGLE_W | ( | server, | |
colour, | |||
v0, | |||
v1, | |||
v2, | |||
... | |||
) |
Single wireframe triangle.
server | The Server or Connection object. Must be a dereferenced pointer. |
colour | The colour to apply to the shape. |
v0 | A triangle vertex. |
v1 | A triangle vertex. |
v2 | A triangle vertex. |
... | Additional arguments follow, passed to MeshShape() constructor. |
#define TES_TRIANGLES | ( | server, | |
colour, | |||
... | |||
) | if (server) { tes::MeshShape shape(tes::DtTriangles, ##__VA_ARGS__); shape.setColour(colour); (server)->create(shape); } |
Triangles shape.
server | The Server or Connection object. Must be a dereferenced pointer. |
colour | The colour to apply to the shape. |
... | Additional arguments follow, passed to MeshShape() constructor. |
#define TES_TRIANGLES_E | ( | server, | |
colour, | |||
... | |||
) | if (server) { tes::MeshShape shape(tes::DtTriangles, ##__VA_ARGS__); shape.expandVertices().setColour(colour); (server)->create(shape); } |
Triangles shape, calling MeshShape::expandVertices()
.
server | The Server or Connection object. Must be a dereferenced pointer. |
colour | The colour to apply to the shape. |
... | Additional arguments follow, passed to MeshShape() constructor. |
#define TES_TRIANGLES_END | ( | server, | |
id | |||
) | if (server) { (server)->destroy(tes::MeshShape(tes::DtTriangles, nullptr, 0, 0, static_cast<uint32_t>(id))); } |
Destroy triangle or triangles with id
.
server | The Server or Connection object. Must be a dereferenced pointer. |
id | The ID of the shape to destroy. |
#define TES_TRIANGLES_N | ( | server, | |
colour, | |||
... | |||
) | if (server) { tes::MeshShape shape(tes::DtTriangles, ##__VA_ARGS__); shape.setCalculateNormals(true).setColour(colour); (server)->create(shape); } |
Triangles shape with lighting (_N to calculate normals).
server | The Server or Connection object. Must be a dereferenced pointer. |
colour | The colour to apply to the shape. |
... | Additional arguments follow, passed to MeshShape() constructor. |
#define TES_TRIANGLES_NE | ( | server, | |
colour, | |||
... | |||
) | if (server) { tes::MeshShape shape(tes::DtTriangles, ##__VA_ARGS__); shape.expandVertices().setCalculateNormals(true).setColour(colour); (server)->create(shape); } |
Triangles shape with lighting (_N to calculate normals), calling MeshShape::expandVertices()
.
server | The Server or Connection object. Must be a dereferenced pointer. |
colour | The colour to apply to the shape. |
... | Additional arguments follow, passed to MeshShape() constructor. |
#define TES_TRIANGLES_T | ( | server, | |
colour, | |||
... | |||
) | if (server) { tes::MeshShape shape(tes::DtTriangles, ##__VA_ARGS__); shape.setTransparent(true); shape.setColour(colour); (server)->create(shape); } |
Triangles transparent shape.
server | The Server or Connection object. Must be a dereferenced pointer. |
colour | The colour to apply to the shape. |
... | Additional arguments follow, passed to MeshShape() constructor. |
#define TES_TRIANGLES_TE | ( | server, | |
colour, | |||
... | |||
) | if (server) { tes::MeshShape shape(tes::DtTriangles, ##__VA_ARGS__); shape.expandVertices().setTransparent(true); shape.setColour(colour); (server)->create(shape); } |
Triangles transparent shape, calling MeshShape::expandVertices()
server | The Server or Connection object. Must be a dereferenced pointer. |
colour | The colour to apply to the shape. |
... | Additional arguments follow, passed to MeshShape() constructor. |
#define TES_TRIANGLES_W | ( | server, | |
colour, | |||
... | |||
) | if (server) { tes::MeshShape shape(tes::DtTriangles, ##__VA_ARGS__); shape.setWireframe(true); shape.setColour(colour); (server)->create(shape); } |
Triangles wireframe shape.
server | The Server or Connection object. Must be a dereferenced pointer. |
colour | The colour to apply to the shape. |
... | Additional arguments follow, passed to MeshShape() constructor. |
#define TES_TRIANGLES_WE | ( | server, | |
colour, | |||
... | |||
) | if (server) { tes::MeshShape shape(tes::DtTriangles, ##__VA_ARGS__); shape.expandVertices().setWireframe(true); shape.setColour(colour); (server)->create(shape); } |
Triangles wireframe shape, calling MeshShape::expandVertices()
.
server | The Server or Connection object. Must be a dereferenced pointer. |
colour | The colour to apply to the shape. |
... | Additional arguments follow, passed to MeshShape() constructor. |
#define TES_VOXELS | ( | server, | |
colour, | |||
resolution, | |||
... | |||
) | if (server) { (server)->create(tes::MeshShape(tes::DtVoxels, ##__VA_ARGS__).setUniformNormal(tes::Vector3f(0.5f * resolution)).setColour(colour)); } |
Render a set of voxels.
Vertices represent voxel centres, normals are extents.
server | The Server or Connection object. Must be a dereferenced pointer. |
colour | The colour to apply to the shape. |
resolution | The length of the voxel edge. Only supports cubic voxels. |
... | Additional arguments follow, passed to MeshShape() constructor. Vertices and normals required. |
#define TES_VOXELS_END | ( | server, | |
id | |||
) | if (server) { (server)->destroy(tes::MeshShape(tes::DtVoxels, nullptr, 0, 0, static_cast<uint32_t>(id))); } |
Destroy voxel set with id
.
server | The Server or Connection object. Must be a dereferenced pointer. |
id | The ID of the shape to destroy. |