vrecko
virtual reality framework
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
mvect.h
Go to the documentation of this file.
1 /* mvect - movement vector
2 * Ludek Pokluda, xpokluda@fi.muni.cz
3 * v0.0.2 21.11.2002
4 */
5 #ifndef _MVECT_
6 #define _MVECT_
7 
8 #include "gm.h"
9 
10 namespace mv{
11 
12 struct CPoint{
14  //bool Relativ; //true relative, false absolute
15  bool Movable; //true relative, false absolute
16 // double Velocity; //velocity at control point
17  double WTime; //wait time
18  //int Control;
19 };
20 
21 //enum _VType {ABS,REL,POINT}; //vector type .. absolute (P+V), relative (V), point (P)
22 //typedef enum _VType VTYPE; //vector type .. absolute (P+V), relative (V), point (P)
23 
24 class CMVect{
25 // CPoint *PBeg; //first point of vector
26 // CPoint *PEnd; //last point of vector
27  gmVector3 Vect; //vector itself (PEnd - PBeg, but could be relative)
28  bool Once; //play once (and remove) if true, else play many times
30 
31  double V0; //starting velocity
32  double V1; //ending velocity
33 
34 // VTYPE VType; //vector type (absolute, relative, point)
35 public:
36 /*
37  CMVect();//
38 */
39  CMVect(gmVector3 newvect, double newv0=1, double newv1=1, bool newonce=false);
40  CMVect(double nx=0, double ny=0, double nz=0, double newv0=1, double newv1=1, bool newonce=false);
41 // CMVect(CPoint *NewPBeg);
42 // CMVect(CPoint *NewPBeg,Point *NewPEnd,gmVector3 Vect, VTYPE newvtype);
43  CMVect(CMVect &OtherVector);
44  ~CMVect();
45 
46 // VTYPE getVType();
47 // void setVType(VTYPE val);
48 // CPoint* getPBeg();
49 // CPoint* getPEnd();
50  void setOnce(bool newonce) {Once = newonce;}; //deprecated
51  bool getOnce() {return Once;}; //deprecated
52  void setV0(double newv0) {V0 = newv0;};
53  double getV0() {return V0;};
54  void setV1(double newv1) {V1 = newv1;};
55  double getV1(){return V1;};
56  void setVect(gmVector3 newvect) {Vect=newvect;};
57  gmVector3 getVect() {return Vect;};
58  gmVector3 Eval(double p); //position on vector by param from <0,1>
59 
60  double Length() {return Vect.length();};
61 };
62 
63 }
64 
65 #endif