raisin::tcp_viewer::RemoteScene
class · #include <rayrai/RaisimTcpCommon.hpp>
Client-side representation of a remote raisim scene.
Owns the state updated through TCP messages and exposes helper queries for selection, bounds, and visual lists.
Constructors & destructor
RemoteScene
explicit RemoteScene(const std::shared_ptr<raisin::RayraiWindow> &viewer)Construct a remote scene bound to a viewer instance.
Parameters
| Parameter | Description |
|---|---|
viewer | Shared RayraiWindow used for rendering. |
RemoteScene(RemoteScene &&) noexceptMove constructor.
RemoteScene(const RemoteScene &) = delete~RemoteScene
~RemoteScene()Public member functions
operator=
RemoteScene &operator=(RemoteScene &&) noexceptMove assignment.
RemoteScene &operator=(const RemoteScene &) = deletesetVerbose
void setVerbose(bool verbose)Enable or disable verbose logging.
Parameters
| Parameter | Description |
|---|---|
verbose | True to enable verbose logs. |
setSelectionTag
void setSelectionTag(uint32_t tag)Set the object whose detailed state is reported in getSelectedInfo().
Parameters
| Parameter | Description |
|---|---|
tag | Object tag. |
getSelectedInfo
const SelectedObjectInfo &getSelectedInfo() constGet the current selection info.
Returns Selection info struct.
getServerWorldTime
double getServerWorldTime() constGet the latest server world time.
Returns World time value.
hasServerWorldTime
bool hasServerWorldTime() constCheck if server world time is available.
Returns True if a time value has been received.
setShowCollisionBodies
void setShowCollisionBodies(bool show)Toggle collision body rendering.
Parameters
| Parameter | Description |
|---|---|
show | True to render collision shapes. |
setForceTransparent
void setForceTransparent(bool enabled)Force all visuals to render as transparent.
Parameters
| Parameter | Description |
|---|---|
enabled | True to force transparency. |
addSearchPath
void addSearchPath(const std::string &path)Add a search path for mesh resources.
Parameters
| Parameter | Description |
|---|---|
path | Directory path. |
setResourceSearchPaths
void setResourceSearchPaths(const std::vector<std::string> &paths)Replace the resource directories configured in the viewer settings.
Parameters
| Parameter | Description |
|---|---|
paths | Directories searched when resolving mesh files. |
getObjectName
std::string getObjectName(uint32_t tag) constGet object name by tag.
Parameters
| Parameter | Description |
|---|---|
tag | Object tag. |
Returns Name string or empty if not found.
getSensorsForTag
std::vector<SensorInfo> getSensorsForTag(uint32_t tag) constReturn the sensors declared by the object identified by tag.
Parameters
| Parameter | Description |
|---|---|
tag | Object tag. |
Returns Sensor list (empty if the object has none).
shutdown
void shutdown()Clear the scene and release the viewer reference.
clear
void clear()Clear all cached remote scene data.
getVisualInfo
bool getVisualInfo(
const raisin::Visuals *visual,
uint32_t &tag,
int &index,
const VisualEntry *&entry) constLook up a visual by pointer and return its metadata.
Parameters
| Parameter | Description |
|---|---|
visual | Visual pointer to look up. |
tag | Output object tag. |
index | Output body index within the object. |
entry | Output entry pointer. |
Returns True if found.
getVisualEntries
std::vector<VisualEntrySnapshot> getVisualEntries() constCopy every visual entry with its tag and body index.
Returns Snapshot of all entries.
getBodyFrames
std::vector<BodyFramePose> getBodyFrames() constOne pose per body, sorted by tag/body index. Articulated/compound frames require negotiated body offsets; ground/terrain/deformables are omitted.
getSelectableObjects
std::vector<ObjectListItem> getSelectableObjects() constGet a list of selectable objects.
Returns Vector of object list items.
selectableObjectCount
size_t selectableObjectCount() constCount of selectable objects.
Returns Selectable object count.
visualCount
size_t visualCount() constCount of visual objects.
Returns Visual count.
instancedCount
size_t instancedCount() constCount of instanced visual sets.
Returns Instanced visual count.
tcpMeshBatchCount
size_t tcpMeshBatchCount() constCount of TCP mesh batches synthesized from repeated articulated meshes.
Returns Batch count.
tcpMeshBatchMeshColorCount
size_t tcpMeshBatchMeshColorCount() constCount of TCP mesh batches using mesh-authored colors.
Returns Batch count.
tcpMeshBatchRegroupCount
size_t tcpMeshBatchRegroupCount() constNumber of full TCP mesh-batch membership rebuilds since the last clear().
Returns Regroup count (diagnostics).
pointCloudCount
size_t pointCloudCount() constCount of remote point clouds.
Returns Point cloud count.
unresolvedAssetCount
size_t unresolvedAssetCount() constCount mesh entries whose referenced asset could not be resolved.
Returns Unresolved entry count.
contactCount
size_t contactCount() constCount of parsed remote contact samples.
Returns Contact sample count.
contactCountForTag
size_t contactCountForTag(uint32_t tag) constCount contacts in which the object with tag participates.
Parameters
| Parameter | Description |
|---|---|
tag | Object tag. |
Returns Contact count (0 unless serverSupportsContactObjectTags()).
serverSupportsContactObjectTags
bool serverSupportsContactObjectTags() constWhether contact samples contain object ownership tags.
Returns True if the server advertised kProtocolFeatureContactObjectTags.
computeSceneBounds
bool computeSceneBounds(glm::vec3 &outMin, glm::vec3 &outMax) constCompute scene bounds from current visuals.
Parameters
| Parameter | Description |
|---|---|
outMin | Output AABB minimum. |
outMax | Output AABB maximum. |
Returns True if bounds were computed.
applyResponse
bool applyResponse(
BufferReader &reader,
std::vector<PendingSensorUpdate> &pending)Apply a response message to the scene state.
Parameters
| Parameter | Description |
|---|---|
reader | Buffer reader positioned at the response payload. |
pending | Output list of pending sensor updates. |
Returns True if the response was parsed successfully.
consumeDisconnectRequested
bool consumeDisconnectRequested()Check and consume a pending disconnect request.
Returns True if a disconnect was requested.
takeViewerCommands
std::vector<ViewerCommand> takeViewerCommands()Move pending server-originated capture/window commands to the caller.
Returns Commands in arrival order; the internal queue is left empty.
updateContactVisuals
void updateContactVisuals(
bool showPoints,
float pointSize,
bool showForces,
float forceSize,
bool absoluteScale=false)Update contact point/force visuals.
Parameters
| Parameter | Description |
|---|---|
showPoints | Whether to draw contact points. |
pointSize | Point size. |
showForces | Whether to draw force vectors. |
forceSize | Force vector scaling. |
absoluteScale | If true, arrow length = magnitude * forceSize (m per N). If false (default), arrows are normalized to the strongest contact each frame. |
serverSupportsSimControl
bool serverSupportsSimControl() constWhether the server speaks the SIM_CONTROL feature bit. The viewer uses this to grey out the pause / step buttons against legacy servers.
Returns True if the server advertised kProtocolFeatureSimControl.
takeSceneFileBlock
SceneFileBlock takeSceneFileBlock()Take the scene-file block of the last response (see SceneSync).
Returns The block; present is false when the server did not negotiate scene files.
setServerPathMap
void setServerPathMap(std::vector<std::pair<std::string, std::string>> map)Local copies of the server's scene files, for the mesh paths the server streams.
Parameters
| Parameter | Description |
|---|---|
map | Sorted (normalizeServerPath(server path), local path) pairs, see SceneSync::pathMap(). |