#include <User.h>
Public Methods | |
| User () | |
| Constructs the user. More... | |
| virtual | ~User () |
| int | getId () |
| Returns the ID of the user in the system. More... | |
| std::string | getName () |
| Returns the name of the user object. More... | |
| virtual bool | config (jccl::ConfigElementPtr element) |
| Configures the user object. More... | |
| gadget::PositionProxy * | getHeadPosProxy () |
| vpr::Interval | getHeadUpdateTime () |
| float | getInterocularDistance () |
Each user has a system assigned id as well as a string name from the 'user' config element the created the user. These ids can be used to identify a user at set points in a VR Juggler application where user information is is given.
The system-assigned ID number can also be useful to use as an index into a program array (or other data structure) that stores user-specific data (for example, nativgation matrices or input devices).
Definition at line 57 of file User.h.
|
|
Constructs the user.
Definition at line 61 of file User.h.
00062 : mUserId(-1)
00063 , mName("")
00064 , mInterocularDist(0.0f)
00065 {;}
|
|
|
Definition at line 67 of file User.h.
00068 {;}
|
|
|
Returns the ID of the user in the system.
Definition at line 46 of file User.cpp.
00047 { return mUserId; }
|
|
|
Returns the name of the user object.
Definition at line 49 of file User.cpp.
00050 { return mName; }
|
|
|
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 }
|
|
|
Definition at line 89 of file User.h.
00090 {
00091 return mHead.getProxy();
00092 }
|
|
|
Definition at line 94 of file User.h.
00095 { return mHead->getTimeStamp(); }
|
|
|
Definition at line 97 of file User.h.
00098 { return mInterocularDist;}
|
1.2.14 written by Dimitri van Heesch,
© 1997-2002