#include <vrj/Kernel/User.h>
Public Member Functions | |
| User () | |
| Constructs the user. | |
| virtual | ~User () |
| int | getId () |
| Returns the ID of the user in the system. | |
| std::string | getName () |
| Returns the name of this user object. | |
| virtual bool | config (jccl::ConfigElementPtr element) |
| Configures the user object. | |
| gadget::PositionProxy * | getHeadPosProxy () |
| vpr::Interval | getHeadUpdateTime () |
| Returns the time stamp of the last head tracker update. | |
| float | getInterocularDistance () |
| Gets the eye separation. | |
Each user has a system-assigned ID as well as a string name from the 'user' config element that created the user. These IDs can be used to identify a user at set points in the execution of a VR Juggler application object where user information is given.
The system-assigned ID number can also be useful as an index into a program array (or other data structure) that stores user-specific data such as navigation matrices or input devices.
Definition at line 58 of file User.h.
| vrj::User::User | ( | ) | [inline] |
| int vrj::User::getId | ( | ) |
| std::string vrj::User::getName | ( | ) |
Returns the name of this user object.
Definition at line 49 of file User.cpp.
Referenced by vrj::Viewport::outStream(), and vrj::Kernel::removeUser().
| bool vrj::User::config | ( | jccl::ConfigElementPtr | element | ) | [virtual] |
Configures the user object.
Definition at line 52 of file User.cpp.
References vrjDBG_KERNEL().
00053 { 00054 vprASSERT(element.get() != NULL); 00055 vprASSERT(element->getID() == "user"); 00056 00057 vprDEBUG_BEGIN(vrjDBG_KERNEL, vprDBG_STATE_LVL) 00058 << "vjUser::config: Creating a new user\n" << vprDEBUG_FLUSH; 00059 00060 // Assign user id 00061 mUserId = mNextUserId++; 00062 00063 // Setup user name 00064 mName = element->getName(); 00065 00066 // Initialize the head stuff 00067 std::string head_alias = element->getProperty<std::string>("head_position"); 00068 mHead.init(head_alias); 00069 00070 // Initialize interocular distance 00071 mInterocularDist = element->getProperty<float>("interocular_distance"); 00072 00073 if(mInterocularDist == 0.0f) 00074 { 00075 vprDEBUG(vrjDBG_KERNEL,vprDBG_CONFIG_LVL) << clrOutNORM(clrRED, "WARNING:") << "User: " << mName << " has interocular distance is set to 0.0f. This is probably not what you wanted.\n" << vprDEBUG_FLUSH; 00076 } 00077 00078 vprDEBUG(vrjDBG_KERNEL,vprDBG_STATE_LVL) << "id: " << mUserId << " Name:" << mName.c_str() 00079 << " head_positon:" << head_alias.c_str() 00080 << " interocular_distance:" << mInterocularDist 00081 << std::endl << vprDEBUG_FLUSH; 00082 00083 return true; 00084 }
| gadget::PositionProxy* vrj::User::getHeadPosProxy | ( | ) | [inline] |
Definition at line 90 of file User.h.
Referenced by vrj::PfBasicSimulator::updateInternalData(), vrj::GlBasicSimulator::updateInternalData(), and vrj::SurfaceViewport::updateProjections().
| vpr::Interval vrj::User::getHeadUpdateTime | ( | ) | [inline] |
| float vrj::User::getInterocularDistance | ( | ) | [inline] |
Gets the eye separation.
Definition at line 102 of file User.h.
Referenced by vrj::GlDrawEllipsoidHeadFunctor::draw(), vrj::PfBasicSimulator::updateProjectionData(), vrj::GlBasicSimulator::updateProjectionData(), and vrj::SurfaceViewport::updateProjections().
1.5.1