server/observer.h
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef EQSERVER_OBSERVER_H
00019 #define EQSERVER_OBSERVER_H
00020
00021 #include "types.h"
00022 #include "observerVisitor.h"
00023
00024 #include <eq/client/eye.h>
00025 #include <eq/client/observer.h>
00026 #include <string>
00027
00028 namespace eq
00029 {
00030 namespace server
00031 {
00032 struct ObserverPath;
00033
00037 class Observer : public eq::Observer
00038 {
00039 public:
00043 Observer();
00044
00046 Observer( const Observer& from, Config* config );
00047
00049 virtual ~Observer();
00050
00056 ObserverPath getPath() const;
00057
00059 const Vector3f& getEyePosition( const eq::Eye eye ) const
00060 { return _eyes[ eye ]; }
00061
00063 const Matrix4f& getInverseHeadMatrix() const
00064 { return _inverseHeadMatrix; }
00065
00067 Config* getConfig() { return _config; }
00069
00075 void init();
00076
00083 VisitorResult accept( ObserverVisitor& visitor )
00084 { return visitor.visit( this ); }
00085 VisitorResult accept( ConstObserverVisitor& visitor ) const
00086 { return visitor.visit( this ); }
00087
00089 void unmap();
00091
00092 protected:
00094 virtual void deserialize( net::DataIStream& is,
00095 const uint64_t dirtyBits );
00096
00097 private:
00098 virtual void getInstanceData( net::DataOStream& os );
00099
00101 Config* _config;
00102 friend class Config;
00103
00105 Matrix4f _inverseHeadMatrix;
00106
00108 Vector3f _eyes[eq::EYE_ALL];
00109
00110 union
00111 {
00112 char dummy[64];
00113 };
00114
00115 void _updateEyes();
00116 };
00117 }
00118 }
00119 #endif // EQSERVER_OBSERVER_H