3es  0.7
3rd Eye Scene Macro Interface

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...
 

Detailed Description

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.

Macro Definition Documentation

◆ TES_ACTIVE

#define TES_ACTIVE (   server)    ((server) != nullptr && (server)->active())

Check if server is enabled.

Parameters
serverThe Server or Connection object. Must be a dereferenced pointer.

◆ TES_ARROW

#define TES_ARROW (   server,
  colour,
  ... 
)    if (server) { (server)->create(tes::Arrow(__VA_ARGS__).setColour(colour)); }

Solid arrow.

Parameters
serverThe Server or Connection object. Must be a dereferenced pointer.
colourThe colour to apply to the shape.
...Additional arguments follow, passed to Arrow() constructor.

◆ TES_ARROW_END

#define TES_ARROW_END (   server,
  id 
)    if (server) { (server)->destroy(tes::Arrow(static_cast<uint32_t>(id))); }

Destroy arrow with id.

Parameters
serverThe Server or Connection object. Must be a dereferenced pointer.
idThe ID of the shape to destroy.

◆ TES_ARROW_T

#define TES_ARROW_T (   server,
  colour,
  ... 
)    if (server) { (server)->create(tes::Arrow(__VA_ARGS__).setColour(colour).setTransparent(true)); }

Transparent arrow.

Parameters
serverThe Server or Connection object. Must be a dereferenced pointer.
colourThe colour to apply to the shape.
...Additional arguments follow, passed to Arrow() constructor.

◆ TES_ARROW_W

#define TES_ARROW_W (   server,
  colour,
  ... 
)    if (server) { (server)->create(tes::Arrow(__VA_ARGS__).setColour(colour).setWireframe(true)); }

Wireframe arrow.

Parameters
serverThe Server or Connection object. Must be a dereferenced pointer.
colourThe colour to apply to the shape.
...Additional arguments follow, passed to Arrow() constructor.

◆ TES_BOX

#define TES_BOX (   server,
  colour,
  ... 
)    if (server) { (server)->create(tes::Box(__VA_ARGS__).setColour(colour)); }

Solid box.

Parameters
serverThe Server or Connection object. Must be a dereferenced pointer.
colourThe colour to apply to the shape.
...Additional arguments follow, passed to Box() constructor.

◆ TES_BOX_END

#define TES_BOX_END (   server,
  id 
)    if (server) { (server)->destroy(tes::Box(static_cast<uint32_t>(id))); }

Destroy box with id.

Parameters
serverThe Server or Connection object. Must be a dereferenced pointer.
idThe ID of the shape to destroy.

◆ TES_BOX_T

#define TES_BOX_T (   server,
  colour,
  ... 
)    if (server) { (server)->create(tes::Box(__VA_ARGS__).setColour(colour).setTransparent(true)); }

Transparent box.

Parameters
serverThe Server or Connection object. Must be a dereferenced pointer.
colourThe colour to apply to the shape.
...Additional arguments follow, passed to Box() constructor.

◆ TES_BOX_W

#define TES_BOX_W (   server,
  colour,
  ... 
)    if (server) { (server)->create(tes::Box(__VA_ARGS__).setColour(colour).setWireframe(true)); }

Wireframe box.

Parameters
serverThe Server or Connection object. Must be a dereferenced pointer.
colourThe colour to apply to the shape.
...Additional arguments follow, passed to Box() constructor.

◆ TES_CAPSULE

#define TES_CAPSULE (   server,
  colour,
  ... 
)    if (server) { (server)->create(tes::Capsule(__VA_ARGS__).setColour(colour)); }

Solid capsule.

Parameters
serverThe Server or Connection object. Must be a dereferenced pointer.
colourThe colour to apply to the shape.
...Additional arguments follow, passed to Capsule() constructor.

◆ TES_CAPSULE_END

#define TES_CAPSULE_END (   server,
  id 
)    if (server) { (server)->destroy(tes::Capsule(static_cast<uint32_t>(id))); }

Destroy capsule with id.

Parameters
serverThe Server or Connection object. Must be a dereferenced pointer.
idThe ID of the shape to destroy.

◆ TES_CAPSULE_T

#define TES_CAPSULE_T (   server,
  colour,
  ... 
)    if (server) { (server)->create(tes::Capsule(__VA_ARGS__).setColour(colour).setTransparent(true)); }

Transparent capsule.

Parameters
serverThe Server or Connection object. Must be a dereferenced pointer.
colourThe colour to apply to the shape.
...Additional arguments follow, passed to Capsule() constructor.

◆ TES_CAPSULE_W

#define TES_CAPSULE_W (   server,
  colour,
  ... 
)    if (server) { (server)->create(tes::Capsule(__VA_ARGS__).setColour(colour).setWireframe(true)); }

Wireframe capsule.

Parameters
serverThe Server or Connection object. Must be a dereferenced pointer.
colourThe colour to apply to the shape.
...Additional arguments follow, passed to Capsule() constructor.

◆ TES_CATEGORY

#define TES_CATEGORY (   server,
  _name,
  _categoryId,
  _parentId,
  _active 
)
Value:
if (server) \
{ \
tes::CategoryNameMessage msg; \
msg.categoryId = _categoryId; \
msg.parentId = _parentId; \
msg.defaultActive = (_active) ? 1 : 0; \
const size_t nameLen = (_name) ? strlen(_name) : 0u; \
msg.nameLength = (uint16_t)((nameLen <= 0xffffu) ? nameLen : 0xffffu); \
msg.name = _name; \
tes::sendMessage(*(server), tes::MtCategory, tes::CategoryNameMessage::MessageId, msg); \
}

Exposes details of a category to connected clients.

Parameters
serverThe Server or Connection object. Must be a dereferenced pointer.
_nameA null terminated, UTF-8 string name for the category.
_categoryIdID of the category being named [0, 65535].
_parentIdID of the parent category, to support category trees. Zero for none. [0, 65535]
_activeDefault the category to the active state (true/false)?

◆ TES_COLOR_UPDATE

#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.

Parameters
serverThe Server or Connection object. Must be a dereferenced pointer.
ShapeTypeThe class of the shape to update. E.g., tes::Box
objectIDThe ID of the object to update.
colourThe new object Colour.

◆ TES_COLOUR

#define TES_COLOUR (   name)    tes::Colour::Colours[tes::Colour::name]

Colour by name.

Parameters
namea member of tes::Colour::Predefined.

◆ TES_COLOUR_A

#define TES_COLOUR_A (   name,
 
)    tes::Colour(tes::Colour::Colours[tes::Colour::name], a)

Colour by name with alpha.

Parameters
namea member of tes::Colour::Predefined.
aAlpha channel value [0, 255].

◆ TES_COLOUR_I

#define TES_COLOUR_I (   index)    tes::Colour::Colours[index]

Colour by predefined index.

Parameters
indexA valid value within tes::Colour::Predefined.

◆ TES_COLOUR_UPDATE

#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.

Parameters
serverThe Server or Connection object. Must be a dereferenced pointer.
ShapeTypeThe class of the shape to update. E.g., tes::Box
objectIDThe ID of the object to update.
colourThe new object Colour.

◆ TES_CONE

#define TES_CONE (   server,
  colour,
  ... 
)    if (server) { (server)->create(tes::Cone(__VA_ARGS__).setColour(colour)); }

Solid cone.

Parameters
serverThe Server or Connection object. Must be a dereferenced pointer.
colourThe colour to apply to the shape.
...Additional arguments follow, passed to Cone() constructor.

◆ TES_CONE_END

#define TES_CONE_END (   server,
  id 
)    if (server) { (server)->destroy(tes::Cone(static_cast<uint32_t>(id))); }

Destroy cone with id.

Parameters
serverThe Server or Connection object. Must be a dereferenced pointer.
idThe ID of the shape to destroy.

◆ TES_CONE_T

#define TES_CONE_T (   server,
  colour,
  ... 
)    if (server) { (server)->create(tes::Cone(__VA_ARGS__).setColour(colour).setTransparent(true)); }

Transparent cone.

Parameters
serverThe Server or Connection object. Must be a dereferenced pointer.
colourThe colour to apply to the shape.
...Additional arguments follow, passed to Cone() constructor.

◆ TES_CONE_W

#define TES_CONE_W (   server,
  colour,
  ... 
)    if (server) { (server)->create(tes::Cone(__VA_ARGS__).setColour(colour).setWireframe(true)); }

Wireframe cone.

Parameters
serverThe Server or Connection object. Must be a dereferenced pointer.
colourThe colour to apply to the shape.
...Additional arguments follow, passed to Cone() constructor.

◆ TES_CYLINDER

#define TES_CYLINDER (   server,
  colour,
  ... 
)    if (server) { (server)->create(tes::Cylinder(__VA_ARGS__).setColour(colour)); }

Solid cylinder.

Parameters
serverThe Server or Connection object. Must be a dereferenced pointer.
colourThe colour to apply to the shape.
...Additional arguments follow, passed to Cylinder() constructor.

◆ TES_CYLINDER_END

#define TES_CYLINDER_END (   server,
  id 
)    if (server) { (server)->destroy(tes::Cylinder(static_cast<uint32_t>(id))); }

Destroy cylinder with id.

Parameters
serverThe Server or Connection object. Must be a dereferenced pointer.
idThe ID of the shape to destroy.

◆ TES_CYLINDER_T

#define TES_CYLINDER_T (   server,
  colour,
  ... 
)    if (server) { (server)->create(tes::Cylinder(__VA_ARGS__).setColour(colour).setTransparent(true)); }

Transparent cylinder.

Parameters
serverThe Server or Connection object. Must be a dereferenced pointer.
colourThe colour to apply to the shape.
...Additional arguments follow, passed to Cylinder() constructor.

◆ TES_CYLINDER_W

#define TES_CYLINDER_W (   server,
  colour,
  ... 
)    if (server) { (server)->create(tes::Cylinder(__VA_ARGS__).setColour(colour).setWireframe(true)); }

Wireframe cylinder.

Parameters
serverThe Server or Connection object. Must be a dereferenced pointer.
colourThe colour to apply to the shape.
...Additional arguments follow, passed to Cylinder() constructor.

◆ TES_FEATURE

#define TES_FEATURE (   feature)    tes::checkFeature(feature)

Check if a feature is enabled using checkFeature().

Parameters
featureThe feature to check for.

◆ TES_FEATURE_FLAG

#define TES_FEATURE_FLAG (   feature)    tes::featureFlag(feature)

Get the flag for a feature.

Parameters
featureThe feature identifier.

◆ TES_FEATURES

#define TES_FEATURES (   featureFlags)    tes::checkFeatures(featureFlags)

Check if the given set of features are enabled using checkFeatures().

Parameters
featureFlagsThe flags to check for.

◆ TES_IF

#define TES_IF (   condition)    if (condition)

Begins an if statement with condition, but only if TES is enabled.

Otherwise the macro is if (false)

Parameters
conditionThe if statement condition.

◆ TES_IF_FEATURES

#define TES_IF_FEATURES (   featureFlags,
  expression 
)
Value:
if (tes::checkFeatures(featureFlags)) \
{ \
expression; \
}
bool _3es_coreAPI checkFeatures(uint64_t featureFlags)
Check if a set of features are available.

Execute expression if featureFlags are all present using checkFeatures().

Parameters
featureFlagsThe flags to require before executing expression.
expressionThe code statement or expression to execute if checkFeatures() passes.

◆ TES_LINE

#define TES_LINE (   server,
  colour,
  v0,
  v1,
  ... 
)
Value:
if (server) \
{ \
const tes::Vector3f _line[2] = { tes::Vector3f(v0), tes::Vector3f(v1) }; \
tes::MeshShape shape(tes::DtLines, _line[0].v, 2, sizeof(_line[0]), ##__VA_ARGS__); shape.setColour(colour); \
(server)->create(shape); \
}
Vector3< float > Vector3f
Defines a single precision vector.
Definition: 3esvector3.h:14
Represents a vector in R3.
Definition: 3esvector3.h:14
Vector4< T > create(const Vector3< T > &normal, T distance)
Create a plane from a normal and distance (D) value.
Definition: 3esplanegeom.h:30
Parameters
serverThe Server or Connection object. Must be a dereferenced pointer.
colourThe colour to apply to the shape.
v0Vertex of the first line end point.
v1Second vertex for the line starting at v0.
...Additional arguments follow, passed to MeshShape() constructor.

◆ TES_LINES

#define TES_LINES (   server,
  colour,
  ... 
)    if (server) { (server)->create(tes::MeshShape(tes::DtLines, ##__VA_ARGS__).setColour(colour)); }

Render a set of lines.

Parameters
serverThe Server or Connection object. Must be a dereferenced pointer.
colourThe colour to apply to the shape.
...Additional arguments follow, passed to MeshShape() constructor.

◆ TES_LINES_E

#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().

Parameters
serverThe Server or Connection object. Must be a dereferenced pointer.
colourThe colour to apply to the shape.
...Additional arguments follow, passed to MeshShape() constructor.

◆ TES_LINES_END

#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.

Parameters
serverThe Server or Connection object. Must be a dereferenced pointer.
idThe ID of the shape to destroy.

◆ TES_MESH_PLACEHOLDER

#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().

Parameters
idThe mesh resource ID to proxy.

◆ TES_MESHSET

#define TES_MESHSET (   server,
  ... 
)    if (server) { (server)->create(tes::MeshSet(__VA_ARGS__)); }

Render a complex mesh.

Parameters
serverThe Server or Connection object. Must be a dereferenced pointer.
...Additional arguments follow, passed to MeshSet() constructor.

◆ TES_MESHSET_END

#define TES_MESHSET_END (   server,
  id,
  resource 
)    if (server) { (server)->destroy(tes::MeshSet(static_cast<uint32_t>(resource, id))); }

Destroy mesh with id.

Parameters
serverThe Server or Connection object. Must be a dereferenced pointer.
idThe ID of the shape to destroy.
resourceThe mesh resource associated with the set. Only supports one mesh. Must be a pointer type : tes::MeshResource *

◆ TES_PLANE

#define TES_PLANE (   server,
  colour,
  ... 
)    if (server) { (server)->create(tes::Plane(__VA_ARGS__).setColour(colour)); }

Solid plane.

Parameters
serverThe Server or Connection object. Must be a dereferenced pointer.
colourThe colour to apply to the shape.
...Additional arguments follow, passed to Plane() constructor.

◆ TES_PLANE_END

#define TES_PLANE_END (   server,
  id 
)    if (server) { (server)->destroy(tes::Plane(static_cast<uint32_t>(id))); }

Destroy plane with id.

Parameters
serverThe Server or Connection object. Must be a dereferenced pointer.
idThe ID of the shape to destroy.

◆ TES_PLANE_T

#define TES_PLANE_T (   server,
  colour,
  ... 
)    if (server) { (server)->create(tes::Plane(__VA_ARGS__).setColour(colour).setTransparent(true)); }

Transparent plane.

Parameters
serverThe Server or Connection object. Must be a dereferenced pointer.
colourThe colour to apply to the shape.
...Additional arguments follow, passed to Plane() constructor.

◆ TES_PLANE_W

#define TES_PLANE_W (   server,
  colour,
  ... 
)    if (server) { (server)->create(tes::Plane(__VA_ARGS__).setColour(colour).setWireframe(true)); }

Wireframe plane.

Parameters
serverThe Server or Connection object. Must be a dereferenced pointer.
colourThe colour to apply to the shape.
...Additional arguments follow, passed to Plane() constructor.

◆ TES_POINTCLOUDSHAPE

#define TES_POINTCLOUDSHAPE (   server,
  colour,
  ... 
)    if (server) { (server)->create(tes::PointCloudShape(__VA_ARGS__).setColour(colour)); }

Render a point cloud.

Parameters
serverThe Server or Connection object. Must be a dereferenced pointer.
colourThe colour to apply to the shape.
...Additional arguments follow, passed to PointCloudShape() constructor.

◆ TES_POINTCLOUDSHAPE_END

#define TES_POINTCLOUDSHAPE_END (   server,
  cloud,
  id 
)    if (server) { (server)->destroy(tes::PointCloudShape(cloud, static_cast<uint32_t>(id))); }

Destroy point cloud with id.

Parameters
serverThe Server or Connection object. Must be a dereferenced pointer.
cloudThe MeshResource (e.g., PointCloud) containing the point vertex data.
idThe ID of the shape to destroy.

◆ TES_POINTS

#define TES_POINTS (   server,
  colour,
  ... 
)    if (server) { (server)->create(tes::MeshShape(tes::DtPoints, ##__VA_ARGS__).setColour(colour)); }

Render a small set of points.

Parameters
serverThe Server or Connection object. Must be a dereferenced pointer.
colourThe colour to apply to the shape.
...Additional arguments follow, passed to MeshShape() constructor.

◆ TES_POINTS_E

#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().

Parameters
serverThe Server or Connection object. Must be a dereferenced pointer.
colourThe colour to apply to the shape.
...Additional arguments follow, passed to MeshShape() constructor.

◆ TES_POINTS_END

#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.

Parameters
serverThe Server or Connection object. Must be a dereferenced pointer.
idThe ID of the shape to destroy.

◆ TES_POS_UPDATE

#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.

Parameters
serverThe Server or Connection object. Must be a dereferenced pointer.
ShapeTypeThe class of the shape to update. E.g., tes::Box
objectIDThe ID of the object to update.
posThe new position. A V3Arg compatible argument.

◆ TES_POSROT_UPDATE

#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.

Parameters
serverThe Server or Connection object. Must be a dereferenced pointer.
ShapeTypeThe class of the shape to update. E.g., tes::Box
objectIDThe ID of the object to update.
posThe new position. A V3Arg compatible argument.
quaternionThe updated quaternion rotation. A QuaternionArg compatible argument.

◆ TES_POSSCALE_UPDATE

#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.

Parameters
serverThe Server or Connection object. Must be a dereferenced pointer.
ShapeTypeThe class of the shape to update. E.g., tes::Box
objectIDThe ID of the object to update.
posThe new position. A V3Arg compatible argument.
scaleThe new object scale. A V3Arg compatible argument.

◆ TES_PRC_UPDATE

#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.

Parameters
serverThe Server or Connection object. Must be a dereferenced pointer.
ShapeTypeThe class of the shape to update. E.g., tes::Box
objectIDThe ID of the object to update.
posThe new position. A V3Arg compatible argument.
quaternionThe updated quaternion rotation. A QuaternionArg compatible argument.
colourThe new object Colour.

◆ TES_PRS_UPDATE

#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.

Parameters
serverThe Server or Connection object. Must be a dereferenced pointer.
ShapeTypeThe class of the shape to update. E.g., tes::Box
objectIDThe ID of the object to update.
posThe new position. A V3Arg compatible argument.
quaternionThe updated quaternion rotation. A QuaternionArg compatible argument.
scaleThe new object scale. A V3Arg compatible argument.

◆ TES_PRSC_UPDATE

#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.

Parameters
serverThe Server or Connection object. Must be a dereferenced pointer.
ShapeTypeThe class of the shape to update. E.g., tes::Box
objectIDThe ID of the object to update.
posThe new position. A V3Arg compatible argument.
quaternionThe updated quaternion rotation. A QuaternionArg compatible argument.
scaleThe new object scale. A V3Arg compatible argument.
colourThe new object Colour.

◆ TES_PSC_UPDATE

#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.

Parameters
serverThe Server or Connection object. Must be a dereferenced pointer.
ShapeTypeThe class of the shape to update. E.g., tes::Box
objectIDThe ID of the object to update.
posThe new position. A V3Arg compatible argument.
scaleThe new object scale. A V3Arg compatible argument.
colourThe new object Colour.

◆ TES_PTR_ID

#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.

Parameters
ptrA pointer value.

◆ TES_REFERENCE_RESOURCE

#define TES_REFERENCE_RESOURCE (   server,
  resource 
)    if (server) { (server)->referenceResource(resource); }

Adds a reference to the given resource.

See tes::Connection::referenceResource().

Parameters
serverThe Server or Connection object. Must be a dereferenced pointer.
resourceA pointer to the resource.

◆ TES_RELEASE_RESOURCE

#define TES_RELEASE_RESOURCE (   server,
  resource 
)    if (server) { (server)->releaseResource(resource); }

Releases a reference to the given resource.

See tes::Connection::referenceResource().

Parameters
serverThe Server or Connection object. Must be a dereferenced pointer.
resourceA pointer to the resource.

◆ TES_RGB

#define TES_RGB (   r,
  g,
 
)    tes::Colour(r, g, b)

Colour from RGB.

Parameters
rRed channel value [0, 255].
gGreen channel value [0, 255].
bBlue channel value [0, 255].

◆ TES_RGBA

#define TES_RGBA (   r,
  g,
  b,
 
)    tes::Colour(r, g, b, a)

Colour from RGBA.

Parameters
rRed channel value [0, 255].
gGreen channel value [0, 255].
bBlue channel value [0, 255].
aAlpha channel value [0, 255].

◆ TES_ROT_UPDATE

#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.

Parameters
serverThe Server or Connection object. Must be a dereferenced pointer.
ShapeTypeThe class of the shape to update. E.g., tes::Box
objectIDThe ID of the object to update.
quaternionThe updated quaternion rotation. A QuaternionArg compatible argument.

◆ TES_ROTSCALE_UPDATE

#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.

Parameters
serverThe Server or Connection object. Must be a dereferenced pointer.
ShapeTypeThe class of the shape to update. E.g., tes::Box
objectIDThe ID of the object to update.
quaternionThe updated quaternion rotation. A QuaternionArg compatible argument.
scaleThe new object scale. A V3Arg compatible argument.

◆ TES_RSC_UPDATE

#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.

Parameters
serverThe Server or Connection object. Must be a dereferenced pointer.
ShapeTypeThe class of the shape to update. E.g., tes::Box
objectIDThe ID of the object to update.
quaternionThe updated quaternion rotation. A QuaternionArg compatible argument.
scaleThe new object scale. A V3Arg compatible argument.
colourThe new object Colour.

◆ TES_SCALE_UPDATE

#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.

Parameters
serverThe Server or Connection object. Must be a dereferenced pointer.
ShapeTypeThe class of the shape to update. E.g., tes::Box
objectIDThe ID of the object to update.
scaleThe new object scale. A V3Arg compatible argument.

◆ TES_SERVER_CREATE

#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.

Parameters
serverThe Server or Connection object. Must be a dereferenced pointer.
settingsThe ServerSettings structure to initialise the server with.
infoThe ServerInfoMessage structure to initialise the server with.

◆ TES_SERVER_DECL

#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.

Parameters
serverThe variable name for the Server object.

◆ TES_SERVER_INFO

#define TES_SERVER_INFO (   info,
  infoCoordinateFrame 
)
Value:
tes::initDefaultServerInfo(&info); \
info.coordinateFrame = infoCoordinateFrame;
Information about the server.
Definition: 3esmessages.h:160

Initialise a default ServerInfoMessage and assign the specified CoordinateFrame.

The time unit details for info can be initialise using TES_SERVER_INFO_TIME()

See also
initDefaultServerInfo()
Parameters
infoVariable name for the ServerInfoMessage structure.
infoCoordinateFrameThe server's CoordinateFrame value.

◆ TES_SERVER_INFO_TIME

#define TES_SERVER_INFO_TIME (   info,
  timeUnit,
  defaultFrameTime 
)
Value:
info.timeUnit = timeUnit; \
info.defaultFrameTime = defaultFrameTime;

Initialise the time unit details of a ServerInfoMessage.

Parameters
infothe ServerInfoMessage structure variable.
timeUnitThe ServerInfoMessage::timeUnit value to set.
defaultFrameTimeThe ServerInfoMessage::defaultFrameTime value to set.

◆ TES_SERVER_START

#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.

Parameters
serverThe Server or Connection object. Must be a dereferenced pointer.
modeThe server mode: ConnectionMonitor::Synchronous or ConnectionMonitor::Asynchronous.

◆ TES_SERVER_START_WAIT

#define TES_SERVER_START_WAIT (   server,
  timems 
)
Value:
if ((server) && (server)->connectionMonitor()->waitForConnection(timems) > 0) \
{ \
(server)->connectionMonitor()->commitConnections(); \
}

Wait for the server to be ready to accept incoming connections.

This blocks until at least one connection is established up to timems milliseconds.

Parameters
serverThe Server or Connection object. Must be a dereferenced pointer.
timemsThe wait time out to wait for (milliseconds).

◆ TES_SERVER_STOP

#define TES_SERVER_STOP (   server)
Value:
if (server) \
{ \
(server)->close(); \
(server)->dispose(); \
(server) = nullptr; \
}

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.

Parameters
serverThe Server or Connection object. Must be a dereferenced pointer.

◆ TES_SERVER_UPDATE

#define TES_SERVER_UPDATE (   server,
  ... 
)
Value:
if (server) \
{ \
(server)->updateTransfers(0); \
(server)->updateFrame(__VA_ARGS__); \
tes::ConnectionMonitor *_conMon = (server)->connectionMonitor(); \
if (_conMon->mode() == tes::ConnectionMonitor::Synchronous) \
{ \
_conMon->monitorConnections(); \
} \
_conMon->commitConnections(); \
}

Call to update the server flushing the frame and potentially monitoring new connections.

This update macro performs the following update commands:

  • Call Server::updateFrame()
  • Update connections, accepting new and expiring old.
  • Updates any pending cache transfers.

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.

Parameters
serverThe Server or Connection object. Must be a dereferenced pointer.
...Arguments for Server::updateFrame()

◆ TES_SET_ACTIVE

#define TES_SET_ACTIVE (   server,
  _active 
)    if (server) { (server)->setActive(_active) }

Enable/disable server.

Parameters
serverThe Server or Connection object. Must be a dereferenced pointer.
_activetrue to activate, false to deactivate.

◆ TES_SET_CONNECTION_CALLBACK

#define TES_SET_CONNECTION_CALLBACK (   server,
  ... 
)    if (server) { (server)->connectionMonitor()->setConnectionCallback(__VA_ARGS__); }

Set the connection callback via ConnectionMonitor::setConnectionCallback().

◆ TES_SETTINGS

#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.

Parameters
settingsThe variable name for the ServerSettings.
...Additional arguments passed to the ServerSettings constructor.

◆ TES_SPHERE

#define TES_SPHERE (   server,
  colour,
  ... 
)    if (server) { (server)->create(tes::Sphere(__VA_ARGS__).setColour(colour)); }

Solid sphere.

Parameters
serverThe Server or Connection object. Must be a dereferenced pointer.
colourThe colour to apply to the shape.
...Additional arguments follow, passed to Sphere() constructor.

◆ TES_SPHERE_END

#define TES_SPHERE_END (   server,
  id 
)    if (server) { (server)->destroy(tes::Sphere(static_cast<uint32_t>(id))); }

Destroy sphere with id.

Parameters
serverThe Server or Connection object. Must be a dereferenced pointer.
idThe ID of the shape to destroy.

◆ TES_SPHERE_T

#define TES_SPHERE_T (   server,
  colour,
  ... 
)    if (server) { (server)->create(tes::Sphere(__VA_ARGS__).setColour(colour).setTransparent(true)); }

Transparent sphere.

Parameters
serverThe Server or Connection object. Must be a dereferenced pointer.
colourThe colour to apply to the shape.
...Additional arguments follow, passed to Sphere() constructor.

◆ TES_SPHERE_W

#define TES_SPHERE_W (   server,
  colour,
  ... 
)    if (server) { (server)->create(tes::Sphere(__VA_ARGS__).setColour(colour).setWireframe(true)); }

Wireframe sphere.

Parameters
serverThe Server or Connection object. Must be a dereferenced pointer.
colourThe colour to apply to the shape.
...Additional arguments follow, passed to Sphere() constructor.

◆ TES_STAR

#define TES_STAR (   server,
  colour,
  ... 
)    if (server) { (server)->create(tes::Star(__VA_ARGS__).setColour(colour)); }

Solid star.

Parameters
serverThe Server or Connection object. Must be a dereferenced pointer.
colourThe colour to apply to the shape.
...Additional arguments follow, passed to Star() constructor.

◆ TES_STAR_END

#define TES_STAR_END (   server,
  id 
)    if (server) { (server)->destroy(tes::Star(static_cast<uint32_t>(id))); }

Destroy star with id.

Parameters
serverThe Server or Connection object. Must be a dereferenced pointer.
idThe ID of the shape to destroy.

◆ TES_STAR_T

#define TES_STAR_T (   server,
  colour,
  ... 
)    if (server) { (server)->create(tes::Star(__VA_ARGS__).setColour(colour).setTransparent(true)); }

Transparent star.

Parameters
serverThe Server or Connection object. Must be a dereferenced pointer.
colourThe colour to apply to the shape.
...Additional arguments follow, passed to Star() constructor.

◆ TES_STAR_W

#define TES_STAR_W (   server,
  colour,
  ... 
)    if (server) { (server)->create(tes::Star(__VA_ARGS__).setColour(colour).setWireframe(true)); }

Wireframe star.

Parameters
serverThe Server or Connection object. Must be a dereferenced pointer.
colourThe colour to apply to the shape.
...Additional arguments follow, passed to Star() constructor.

◆ TES_STMT

#define TES_STMT (   statement)    statement

Enable statement if TES is enabled.

The statement is completely removed when TES is not enabled.

Parameters
statementThe code statement to execute.

◆ TES_TEXT2D_END

#define TES_TEXT2D_END (   server,
  id 
)    if (server) { (server)->destroy(tes::Text2D("", static_cast<uint32_t>(id))); }

Destroy 2D text with id.

Parameters
serverThe Server or Connection object. Must be a dereferenced pointer.
idThe ID of the shape to destroy.

◆ TES_TEXT2D_SCREEN

#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.

Parameters
serverThe Server or Connection object. Must be a dereferenced pointer.
colourThe colour to apply to the shape.
...Additional arguments follow, passed to Text2D() constructor.

◆ TES_TEXT2D_WORLD

#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.

Parameters
serverThe Server or Connection object. Must be a dereferenced pointer.
colourThe colour to apply to the shape.
...Additional arguments follow, passed to Text2D() constructor.

◆ TES_TEXT3D

#define TES_TEXT3D (   server,
  colour,
  ... 
)    if (server) { (server)->create(tes::Text3D(__VA_ARGS__).setColour(colour)); }

Render 3D text.

Parameters
serverThe Server or Connection object. Must be a dereferenced pointer.
colourThe colour to apply to the shape.
...Additional arguments follow, passed to Text3D() constructor.

◆ TES_TEXT3D_END

#define TES_TEXT3D_END (   server,
  id 
)    if (server) { (server)->destroy(tes::Text3D("", static_cast<uint32_t>(id))); }

Destroy 3D text with id.

Parameters
serverThe Server or Connection object. Must be a dereferenced pointer.
idThe ID of the shape to destroy.

◆ TES_TEXT3D_FACING

#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.

Parameters
serverThe Server or Connection object. Must be a dereferenced pointer.
colourThe colour to apply to the shape.
...Additional arguments follow, passed to Text3D() constructor.

◆ TES_TRIANGLE

#define TES_TRIANGLE (   server,
  colour,
  v0,
  v1,
  v2,
  ... 
)
Value:
if (server) \
{ \
const tes::Vector3f _tri[3] = { tes::Vector3f(v0), tes::Vector3f(v1), tes::Vector3f(v2) }; \
tes::MeshShape shape(tes::DtTriangles, _tri[0].v, 3, sizeof(tes::Vector3f), ##__VA_ARGS__); \
shape.setColour(colour).setTwoSided(true); \
(server)->create(shape); \
}
Vector3< float > Vector3f
Defines a single precision vector.
Definition: 3esvector3.h:14
Represents a vector in R3.
Definition: 3esvector3.h:14
Vector4< T > create(const Vector3< T > &normal, T distance)
Create a plane from a normal and distance (D) value.
Definition: 3esplanegeom.h:30

Single triangle.

Vertices are specified as any type which can be used as a constructor argument to Vector3f. Generally const float * is recommended.

Parameters
serverThe Server or Connection object. Must be a dereferenced pointer.
colourThe colour to apply to the shape.
v0First triangle vertex: castable to a Vector3f (such as const float *).
v1Second triangle vertex.
v2Third triangle vertex.
...Additional arguments follow, passed to MeshShape() constructor.

◆ TES_TRIANGLE_END

#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.

Parameters
serverThe Server or Connection object. Must be a dereferenced pointer.
idThe ID of the shape to destroy.

◆ TES_TRIANGLE_I

#define TES_TRIANGLE_I (   server,
  colour,
  verts,
  i0,
  i1,
  i2,
  ... 
)
Value:
if (server) \
{ \
const tes::Vector3f _tri[3] = { tes::Vector3f((verts) + (i0 * 3)), tes::Vector3f((verts) + (i1 * 3)), tes::Vector3f((verts) + (i2 * 3)) }; \
tes::MeshShape shape(tes::DtTriangles, _tri[0].v, 3, sizeof(_tri[0]), ##__VA_ARGS__); \
shape.setColour(colour); \
(server)->create(shape); \
}
Vector3< float > Vector3f
Defines a single precision vector.
Definition: 3esvector3.h:14
Represents a vector in R3.
Definition: 3esvector3.h:14
Vector4< T > create(const Vector3< T > &normal, T distance)
Create a plane from a normal and distance (D) value.
Definition: 3esplanegeom.h:30

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.

Parameters
serverThe Server or Connection object. Must be a dereferenced pointer.
colourThe colour to apply to the shape.
vertsVertices to index the triangle into. Must be a float array with 3 elements per vertex.
i0Index to a triangle vertex.
i1Index to a triangle vertex.
i2Index to a triangle vertex.
...Additional arguments follow, passed to MeshShape() constructor.

◆ TES_TRIANGLE_IT

#define TES_TRIANGLE_IT (   server,
  colour,
  verts,
  i0,
  i1,
  i2,
  ... 
)
Value:
if (server) \
{ \
const tes::Vector3f _tri[3] = { tes::Vector3f((verts) + (i0 * 3)), tes::Vector3f((verts) + (i1 * 3)), tes::Vector3f((verts) + (i2 * 3)) }; \
tes::MeshShape shape(tes::DtTriangles, _tri[0].v, 3, sizeof(_tri[0]), ##__VA_ARGS__); \
shape.setColour(colour); \
shape.setTransparent(true).setTwoSided(true); \
(server)->create(shape); \
}
Vector3< float > Vector3f
Defines a single precision vector.
Definition: 3esvector3.h:14
Represents a vector in R3.
Definition: 3esvector3.h:14
Vector4< T > create(const Vector3< T > &normal, T distance)
Create a plane from a normal and distance (D) value.
Definition: 3esplanegeom.h:30

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.

Parameters
serverThe Server or Connection object. Must be a dereferenced pointer.
colourThe colour to apply to the shape.
vertsVertices to index the triangle into. Must be a float array with 3 elements per vertex.
i0Index to a triangle vertex.
i1Index to a triangle vertex.
i2Index to a triangle vertex.
...Additional arguments follow, passed to MeshShape() constructor.

◆ TES_TRIANGLE_IW

#define TES_TRIANGLE_IW (   server,
  colour,
  verts,
  i0,
  i1,
  i2,
  ... 
)
Value:
if (server) \
{ \
const tes::Vector3f _tri[3] = { tes::Vector3f((verts) + (i0 * 3)), tes::Vector3f((verts) + (i1 * 3)), tes::Vector3f((verts) + (i2 * 3)) }; \
tes::MeshShape shape(tes::DtTriangles, _tri[0].v, 3, sizeof(_tri[0]), ##__VA_ARGS__); \
shape.setColour(colour); \
shape.setWireframe(true); \
(server)->create(shape); \
}
Vector3< float > Vector3f
Defines a single precision vector.
Definition: 3esvector3.h:14
Represents a vector in R3.
Definition: 3esvector3.h:14
Vector4< T > create(const Vector3< T > &normal, T distance)
Create a plane from a normal and distance (D) value.
Definition: 3esplanegeom.h:30

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.

Parameters
serverThe Server or Connection object. Must be a dereferenced pointer.
colourThe colour to apply to the shape.
vertsVertices to index the triangle into. Must be a float array with 3 elements per vertex.
i0Index to a triangle vertex.
i1Index to a triangle vertex.
i2Index to a triangle vertex.
...Additional arguments follow, passed to MeshShape() constructor.

◆ TES_TRIANGLE_T

#define TES_TRIANGLE_T (   server,
  colour,
  v0,
  v1,
  v2,
  ... 
)
Value:
{ \
const tes::Vector3f _tri[3] = { tes::Vector3f(v0), tes::Vector3f(v1), tes::Vector3f(v2) }; \
tes::MeshShape shape(tes::DtTriangles, _tri[0].v, 3, sizeof(_tri[0]), ##__VA_ARGS__); \
shape.setColour(colour); \
shape.setTransparent(true).setTwoSided(true); \
(server)->create(shape); \
}
Vector3< float > Vector3f
Defines a single precision vector.
Definition: 3esvector3.h:14
Represents a vector in R3.
Definition: 3esvector3.h:14
Vector4< T > create(const Vector3< T > &normal, T distance)
Create a plane from a normal and distance (D) value.
Definition: 3esplanegeom.h:30

Single transparent triangle.

Parameters
serverThe Server or Connection object. Must be a dereferenced pointer.
colourThe colour to apply to the shape.
v0A triangle vertex.
v1A triangle vertex.
v2A triangle vertex.
...Additional arguments follow, passed to MeshShape() constructor.

◆ TES_TRIANGLE_W

#define TES_TRIANGLE_W (   server,
  colour,
  v0,
  v1,
  v2,
  ... 
)
Value:
if (server) \
{ \
const tes::Vector3f _tri[3] = { tes::Vector3f(v0), tes::Vector3f(v1), tes::Vector3f(v2) }; \
tes::MeshShape shape(tes::DtTriangles, _tri[0].v, 3, sizeof(_tri[0]), ##__VA_ARGS__); shape.setColour(colour); \
shape.setWireframe(true); \
(server)->create(shape); \
}
Vector3< float > Vector3f
Defines a single precision vector.
Definition: 3esvector3.h:14
Represents a vector in R3.
Definition: 3esvector3.h:14
Vector4< T > create(const Vector3< T > &normal, T distance)
Create a plane from a normal and distance (D) value.
Definition: 3esplanegeom.h:30

Single wireframe triangle.

Parameters
serverThe Server or Connection object. Must be a dereferenced pointer.
colourThe colour to apply to the shape.
v0A triangle vertex.
v1A triangle vertex.
v2A triangle vertex.
...Additional arguments follow, passed to MeshShape() constructor.

◆ TES_TRIANGLES

#define TES_TRIANGLES (   server,
  colour,
  ... 
)    if (server) { tes::MeshShape shape(tes::DtTriangles, ##__VA_ARGS__); shape.setColour(colour); (server)->create(shape); }

Triangles shape.

Parameters
serverThe Server or Connection object. Must be a dereferenced pointer.
colourThe colour to apply to the shape.
...Additional arguments follow, passed to MeshShape() constructor.

◆ TES_TRIANGLES_E

#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().

Parameters
serverThe Server or Connection object. Must be a dereferenced pointer.
colourThe colour to apply to the shape.
...Additional arguments follow, passed to MeshShape() constructor.

◆ TES_TRIANGLES_END

#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.

Parameters
serverThe Server or Connection object. Must be a dereferenced pointer.
idThe ID of the shape to destroy.

◆ TES_TRIANGLES_N

#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).

Parameters
serverThe Server or Connection object. Must be a dereferenced pointer.
colourThe colour to apply to the shape.
...Additional arguments follow, passed to MeshShape() constructor.

◆ TES_TRIANGLES_NE

#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().

Parameters
serverThe Server or Connection object. Must be a dereferenced pointer.
colourThe colour to apply to the shape.
...Additional arguments follow, passed to MeshShape() constructor.

◆ TES_TRIANGLES_T

#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.

Parameters
serverThe Server or Connection object. Must be a dereferenced pointer.
colourThe colour to apply to the shape.
...Additional arguments follow, passed to MeshShape() constructor.

◆ TES_TRIANGLES_TE

#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()

Parameters
serverThe Server or Connection object. Must be a dereferenced pointer.
colourThe colour to apply to the shape.
...Additional arguments follow, passed to MeshShape() constructor.

◆ TES_TRIANGLES_W

#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.

Parameters
serverThe Server or Connection object. Must be a dereferenced pointer.
colourThe colour to apply to the shape.
...Additional arguments follow, passed to MeshShape() constructor.

◆ TES_TRIANGLES_WE

#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().

Parameters
serverThe Server or Connection object. Must be a dereferenced pointer.
colourThe colour to apply to the shape.
...Additional arguments follow, passed to MeshShape() constructor.

◆ TES_VOXELS

#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.

Parameters
serverThe Server or Connection object. Must be a dereferenced pointer.
colourThe colour to apply to the shape.
resolutionThe length of the voxel edge. Only supports cubic voxels.
...Additional arguments follow, passed to MeshShape() constructor. Vertices and normals required.

◆ TES_VOXELS_END

#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.

Parameters
serverThe Server or Connection object. Must be a dereferenced pointer.
idThe ID of the shape to destroy.