#include <MC_MocapStreamImpl.h>
|
| MC_MocapStreamImpl (MC_MocapServerFunc f, const ServerOptions &myServerOptions) |
|
virtual | ~MC_MocapStreamImpl () |
|
virtual UT_UniquePtr
< MC_MocapStreamImpl > | clone (const ServerOptions &opts)=0 |
|
virtual bool | parsePacket (UT_StringHolder &packet, fpreal packet_time, bool &parse_incomplete)=0 |
|
virtual void | buildSkeleton (GU_Detail *, UT_StringHolder name)=0 |
|
virtual void | removeSkeleton (const UT_StringHolder &name) |
| Removes the stored data for a skeleton. More...
|
|
virtual bool | removeExpiredSkeletons () const |
|
virtual int | expirationCount () |
|
virtual void | updateJoints (GU_Detail *gdp, const MC_MocapStreamCookParms &cookparms, const MC_MocapStreamCookParms &prev_cookparms)=0 |
|
void | receivedSkeleton (const UT_StringHolder &name) |
|
void | renamedSkeleton (const UT_StringHolder &old_name, const UT_StringHolder &new_name) |
| Call this to let the base class know an actor's name has changed. More...
|
|
void | setPacketTime (fpreal64 time) |
|
template<typename... Args> |
void | addParseError (const char *fmt, Args &&...args) |
| Call this to report an error when parsing. More...
|
|
template<typename... Args> |
void | addParseWarning (const char *fmt, Args &&...args) |
| Call this to report a warning when parsing. More...
|
|
void | rebuildSkeletons () |
|
void | queueServerTask (const UT_Function< void(void *)> &task) |
|
virtual const char * | name () const =0 |
| The unique name used to identify a subclass's mocap stream device. More...
|
|
virtual const char * | label () const =0 |
|
bool | cook (GU_Detail *gdp, uint64 &skeleton_version, fpreal time, const MC_MocapStreamCookParms &cookparms, const MC_MocapStreamCookParms &prev_cookparms, bool &is_killed) |
|
void | clear () |
| Removes all actors/skeletons. More...
|
|
void | startRecording (UT_SharedPtr< MC_MocapRecorder > recorder, const MC_MocapStreamCookParms &cookparms) |
| Starts recording the motion capture data and stores it in a MotionClip. More...
|
|
void | stopRecording (UT_SharedPtr< MC_MocapRecorder > recorder) |
| Stops recording the motion capture data. More...
|
|
const UT_ArrayStringMap< exint > & | getActorMap () |
|
bool | hasHitError () |
| Used to determine if the stream has run into an error. More...
|
|
virtual MC_MocapStreamImpl::~MC_MocapStreamImpl |
( |
| ) |
|
|
virtual |
template<typename... Args>
void MC_MocapStreamImpl::addParseError |
( |
const char * |
fmt, |
|
|
Args &&... |
args |
|
) |
| |
|
inline |
template<typename... Args>
void MC_MocapStreamImpl::addParseWarning |
( |
const char * |
fmt, |
|
|
Args &&... |
args |
|
) |
| |
|
inline |
A function for establishing a basic TPC connection, receiving motion capture data, and passing it along to be parsed.
A function for establishing a basic UDP connection to a server, receiving motion capture data, and passing it along to be parsed.
Appends the skeleton's geometry to the gdp The theActorAttribName attribute should store the name of the skeleton, and the name attribute will store the names of each joint.
Implemented in HDK_Sample::MocapStreamRokokoHDK.
void MC_MocapStreamImpl::clear |
( |
| ) |
|
Removes all actors/skeletons.
The main entry point into MocapStreamImpl for creating or updating a SOP's skeleton geometry. Returns true if it has successfully parsed new data.
virtual int MC_MocapStreamImpl::expirationCount |
( |
| ) |
|
|
virtual |
Each time we sucessfully parse a packet we increment a counter, if receivedSkeleton has not been called the last 'expirationCount' of successful parses then we will remove the skeleton. Return -1 to disable this.
static void MC_MocapStreamImpl::getBoostErrorMessage |
( |
hboost::system::error_code |
e, |
|
|
UT_StringHolder & |
err_msg |
|
) |
| |
|
static |
Gets the error message corresponding to an hboost error code.
Gets the error message corresponding to an hboost error code.
static void MC_MocapStreamImpl::handleBoostError |
( |
hboost::system::error_code |
e, |
|
|
ServerState & |
state |
|
) |
| |
|
static |
Adds an error message to the log corresponding to an hboost error code.
bool MC_MocapStreamImpl::hasHitError |
( |
| ) |
|
Used to determine if the stream has run into an error.
virtual const char* MC_MocapStreamImpl::label |
( |
| ) |
const |
|
pure virtual |
virtual const char* MC_MocapStreamImpl::name |
( |
| ) |
const |
|
pure virtual |
virtual bool MC_MocapStreamImpl::parsePacket |
( |
UT_StringHolder & |
packet, |
|
|
fpreal |
packet_time, |
|
|
bool & |
parse_incomplete |
|
) |
| |
|
pure virtual |
Called for each packet received from the server. Return true when a packet which defines a pose is valid. parse_incomplete is set to true when a portion of the packet remains to be parsed. In this case, packet is set to the appropriate value to call this method again.
NOTE: If this returns true and parse_incomplete is set to true, that means that the "packet" that was passed in contained parts of more that one packet. This can occur when the data is from a constant stream that has been cut up.
Implemented in HDK_Sample::MocapStreamRokokoHDK.
Used by the main thread to queue a task for the server. The server function will access these tasks via state.myTasks so it can call them. Ensure your task functions accept the same data type your server passes into them.
Your functions should not bind any data that would be unsafe to access within the server thread.
void MC_MocapStreamImpl::rebuildSkeletons |
( |
| ) |
|
|
inline |
Should be called when an actor's data has been parsed. The base class will keep track of the actors and and call build/removeSkeleton when needed.
virtual bool MC_MocapStreamImpl::removeExpiredSkeletons |
( |
| ) |
const |
|
inlinevirtual |
Call this to let the base class know an actor's name has changed.
Call this in parsePacket to specify the time in seconds of the received packet. Otherwise it will default to the time it was received This is used for timing in the recorded MotionClip.
Starts recording the motion capture data and stores it in a MotionClip.
Stops recording the motion capture data.
Call this from updateJoints to rename any of the attributes for storing the parsed blendshapes.
Updates the joints' attributes in place based on the results of parsePacket you can assume that all desired skeletons have already been built in the gdp, so you should keep the same geometry, just update the attributes you need.
Implemented in HDK_Sample::MocapStreamRokokoHDK.
friend class MC_MocapStreamManager |
|
friend |
The documentation for this class was generated from the following file: