00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef ARCHON_X3D_NAVIGATE_H
00021 #define ARCHON_X3D_NAVIGATE_H
00022
00029 #include <archon/x3d/server/appear.H>
00030
00031 namespace Archon
00032 {
00033 namespace X3D
00034 {
00038 struct Billboard: GroupingNode, BoundedObject
00039 {
00040 static Ref<NodeBase> instantiate(BackRef<ExecutionContext> c)
00041 {
00042 return new Billboard(c);
00043 }
00044
00045 static const NodeType *type;
00046 const NodeType *getType() const { return type; }
00047
00048 Billboard(BackRef<ExecutionContext> c):
00049 NodeBase(c),
00050 axisOfRotation(Vector3(0, 1, 0)) {}
00051
00052 const Vector3 &getAxisOfRotation() const { return axisOfRotation; }
00053
00054 private:
00055 friend class Viewer;
00056 friend void initializeNavigateComponent();
00057
00058 Vector3 axisOfRotation;
00059
00060 EventSource axisOfRotationChanged;
00061
00062 Time axisOfRotationStamp;
00063 };
00064
00068 struct Viewpoint: BindableNode
00069 {
00070 static Ref<NodeBase> instantiate(BackRef<ExecutionContext> c)
00071 {
00072 return new Viewpoint(c);
00073 }
00074
00075 static const NodeType *type;
00076 const NodeType *getType() const { return type; }
00077
00078 Viewpoint(BackRef<ExecutionContext> c):
00079 NodeBase(c),
00080 jump(true),
00081 position(Vector3(0, 0, 10)),
00082 orientation(Rotation3(Vector3(0, 0, 1), 0)),
00083 fieldOfView(M_PI_4),
00084 centerOfRotation(Vector3::zero()) {}
00085
00086 bool getJump() const { return jump; }
00087 const Vector3 &getPosition() const { return position; }
00088 const Rotation3 &getOrientation() const { return orientation; }
00089 double getFieldOfView() const { return fieldOfView; }
00090 const Vector3 &getCenterOfRotation() const { return centerOfRotation; }
00091 string getDescription() const { return description; }
00092
00093 private:
00094 friend void initializeNavigateComponent();
00095
00096 bool jump;
00097 Vector3 position;
00098 Rotation3 orientation;
00099 double fieldOfView;
00100 Vector3 centerOfRotation;
00101 string description;
00102
00103 EventSource jumpChanged;
00104 EventSource positionChanged;
00105 EventSource orientationChanged;
00106 EventSource fieldOfViewChanged;
00107 EventSource centerOfRotationChanged;
00108
00109 Time jumpStamp;
00110 Time positionStamp;
00111 Time orientationStamp;
00112 Time fieldOfViewStamp;
00113 Time centerOfRotationStamp;
00114 };
00115 }
00116 }
00117
00118 #endif // ARCHON_X3D_NAVIGATE_H