Kaim::VisualDebugServer Class Reference
#include <visualdebugserver.h>
The VisualDebugServer manages the sending of data to clients.
Each World maintains an instance of this class, accessible through its World::GetVisualDebugServer() and created on World::StartVisualDebug() call.
Call NewFrame() must be called at the beginning of each game frame in your game loop in order to get frames correctly rendered in the NavigationLab.
IsConnected() should be called to know when VisualDebugServer is ready for calling Send* functions to be sure not to do useless computations.
VisualDebugServer is considered ready, i.e. IsConnected returning true, after NewFrame() was called while the connection is established and the synchronization step ended.
With KY_BUILD_SHIPPING defined, this class is still present but replaced by a fully inlined emptied version.
|
Send the key-value with min, max, average values that will be displayed in the NavigationLab under the given group name with other key-values.
|
void | SendStats (const char *statName, const KyFloat32 value, const KyFloat32 average, const KyFloat32 max, const KyFloat32 min, const char *groupName) |
|
void | SendStats (const FloatStat &timeStat, const char *groupName) |
|
void | SendStats (const char *statName, const FloatStat &timeStat, const char *groupName) |
|
|
Send a key-value pair that will be displayed in the NavigationLab under the given group name with other key-values.
|
void | SendUInt32 (const char *statName, const KyUInt32 value, const char *groupName) |
|
void | SendInt32 (const char *statName, const KyInt32 value, const char *groupName) |
|
void | SendFloat32 (const char *statName, const KyFloat32 value, const char *groupName) |
|
void | SendString (const char *statName, const char *value, const char *groupName) |
|
|
void | SendGameCamera (const Vec3f &cameraPos, const Vec3f &cameraLookAtPos, const Vec3f &cameraUp, KyFloat32 fovInDegrees) |
|
void | SendGameCameraAttitude (const Vec3f &cameraPos, const Vec3f &cameraRight, const Vec3f &cameraUp, const Vec3f &cameraFront, KyFloat32 fovInDegrees) |
|
|
void | PauseMessageProcessing () |
|
void | ResumeMessageProcessing () |
|
bool Kaim::VisualDebugServer::CanSafelyOperate |
( |
| ) |
const |
|
inline |
Check if it is safe to call Update and Send functions.
void Kaim::VisualDebugServer::Flush |
( |
| ) |
|
Effectively, send/write all messages (exactly they are passed to the OS).
KyUInt32 Kaim::VisualDebugServer::GetFrameIndex |
( |
| ) |
const |
|
inline |
Retrieves the number of the current frame.
MemoryHeap* Kaim::VisualDebugServer::GetHeap |
( |
| ) |
|
|
inline |
- Returns
- The MemoryHeap used for sending messages.
static KyUInt32 Kaim::VisualDebugServer::GetInfiniteWaitDelay |
( |
| ) |
|
|
inlinestatic |
Ptr<Net::AMP::Message> Kaim::VisualDebugServer::GetNextReceivedMessage |
( |
| ) |
|
Return next received message.
ThreadId Kaim::VisualDebugServer::GetThreadId |
( |
| ) |
const |
|
inline |
Get the ThreadId that Send and Update are supposed to be called from.
Net::AMP::ThreadMgr* Kaim::VisualDebugServer::GetThreadMgr |
( |
| ) |
|
|
inline |
Accessor to the internal ThreadMgr.
const Net::AMP::ThreadMgr* Kaim::VisualDebugServer::GetThreadMgr |
( |
| ) |
const |
|
inline |
Accessor to the internal ThreadMgr.
KyResult Kaim::VisualDebugServer::HandleAllReceivedMessages |
( |
| ) |
|
Get and handle all received messages based on the MessageReceiverRegistry parameter provided to Start()
KyResult Kaim::VisualDebugServer::HandleMessage |
( |
Ptr< Net::AMP::Message > |
msg | ) |
|
Handle the given message.
KyResult Kaim::VisualDebugServer::HandleNextReceivedMessage |
( |
| ) |
|
- Returns
- KY_SUCCESS if a message was handled, KY_ERROR if there's no message to handle.
bool Kaim::VisualDebugServer::IsConnected |
( |
| ) |
|
|
inline |
Tells if it's worth calling the Send* functions.
bool Kaim::VisualDebugServer::IsConnectionEstablished |
( |
| ) |
const |
Indicates whether the ThreadManager has established a connection to a network socket or if the localFile can be written.
The connection being established doesn't mean the VisualDebugServer is ready to send information, cf. IsConnected()
bool Kaim::VisualDebugServer::IsStarted |
( |
| ) |
const |
|
inline |
- Returns
- true between Start and Stop calls, false otherwise.
bool Kaim::VisualDebugServer::IsSynchronizing |
( |
| ) |
|
|
inline |
Tells if currently synchronizing, in this state Send should only be called to send synchronization data (typically the NavData to be used for debugging).
void Kaim::VisualDebugServer::NewFrame |
( |
| ) |
|
Indicates the beginning of a new game frame.
Auto-increment the frame index NOTE : NewFrame() must be called at the beginning of the Game frame so that a frame of VisualDebugServer mathces exactly a Game frame
void Kaim::VisualDebugServer::NewFrame |
( |
KyUInt32 |
gameFrameIndex | ) |
|
|
inline |
Sends a blob from a BlobBuilder, the blob will be built into the message, no copy occurs.
This Send function should be favor over Send(BaseBlobHandler&) since the memory used to build the blobs is reused here
KyResult Kaim::VisualDebugServer::Send |
( |
BaseBlobHandler & |
blobHandler | ) |
|
Sends a blob, the blob will be copied into a secondary buffer.
Send(BaseBlobBuilder<T>&) should be favor over this Send function since the memory used to build the blobs will be reused there.
Portion of code using this function when KY_BUILD_SHIPPING is defined should be guarded with #ifndef KY_BUILD_SHIPPING in order to save cpu and memory taken to build the blob in Shipping build.
void Kaim::VisualDebugServer::SetAdvancedInternalStatistics |
( |
bool |
enable | ) |
|
|
inline |
Enable additional statistics to be sent. These statistics are mainly useful for internal development/debugging.
void Kaim::VisualDebugServer::SetSimulationTime |
( |
KyFloat32 |
simulationTimeInSeconds | ) |
|
|
inline |
Usually, set by Kaim::World with the given simulation time passed to Kaim::World::Update().
It can differ from the frame time computed in NewFrame(), so a VisualDebug replay can be played with the frame time or the simulation time.
By default, the NavigationLab will use the simulation time if it is provided instead of the frame time, because simulation time is usually a fix step which is better to use for debugging purposes.
void Kaim::VisualDebugServer::SetThreadId |
( |
ThreadId |
threadId | ) |
|
|
inline |
Set the ThreadId that Send and Update are supposed to be called from. By default, assigned when calling Start.
bool Kaim::VisualDebugServer::WaitWhileEstablishingConnection |
( |
KyUInt32 |
maxDelayMilliseconds | ) |
|
The documentation for this class was generated from the following file: