KeyTrack.h

Go to the documentation of this file.
00001 
00002 // This file should really be called vector.h, since it defines the internally used
00003 // class, vector, as well as the path_property classes.  SDK users should not need this file,
00004 // except to compile any programs which include iMoFlow.h.  Only the motion flow snippet class 
00005 // references these classes in a function call which SDK users will probably not use.  
00006 // This file is part of an old file structure which is being kept in place only for the sake of 
00007 // allowing older programs using the CS SDK to run.
00008 
00009 #pragma once
00010 
00011 #include "..\maxheap.h"
00012 #include "BipExp.h"
00013 #include "Tracks.h"
00014 #include "..\point4.h"
00015 /*
00016 //This is all in bipexp.h now
00017 #define BIPSLAVE_CONTROL_CLASS_ID Class_ID(0x9154,0)
00018 // this is the class for the center of mass, biped root controller ("Bip01")
00019 #define BIPBODY_CONTROL_CLASS_ID  Class_ID(0x9156,0) 
00020 // this is the class for the biped footstep controller ("Bip01 Footsteps")
00021 #define FOOTPRINT_CLASS_ID Class_ID(0x3011,0)
00022 #define SKELOBJ_CLASS_ID Class_ID(0x9125, 0)
00023 #define BIPED_CLASS_ID Class_ID(0x9155, 0)
00024 */
00025 
00026 // This class is used internally
00027 class vector: public MaxHeapOperators {
00028 public: 
00029     float x;
00030     float y;
00031     float z;
00032     float w;
00033 
00034     //constructors
00035     vector() 
00036         : x(0.0f),y(0.0f),z(0.0f),w(1.0f) {} // Should be twice as fast now
00037     vector(float X, float Y, float Z) 
00038         : x(X), y(Y), z(Z), w(1.0f) {} // Should be twice as fast now
00039     vector (float xx, float yy, float zz, float ww) 
00040         : x(xx), y(yy), z(zz), w(ww) { }
00041     vector(Point4 p) 
00042         : x(p.x), y(p.y), z(p.z), w(p.w) { }
00043 
00044     // Binary operators
00045     inline  vector operator-(const vector&) const;
00046     inline  vector operator+(const vector&) const; 
00047 };
00048 
00049 inline vector vector::operator-(const vector& b) const {
00050     return(vector(x-b.x,y-b.y,z-b.z));
00051     }
00052 
00053 inline vector vector::operator+(const vector& b) const {
00054     return(vector(x+b.x,y+b.y,z+b.z));
00055     }
00056 
00057 inline vector operator*(float f, const vector& a) {
00058     return(vector(a.x*f, a.y*f, a.z*f, a.w)); //MG was a.w*f
00059     }
00060 
00061 inline Point4 VtoP4(const vector& v) { return Point4(v.x, v.y, v.z, v.w); }
00062 
00063 typedef Point3 vector2D;
00064 
00065 
00066 // This class is used internally
00067 class path_property: public MaxHeapOperators
00068 {
00069 public:
00070     float val;
00071     int   time;
00072     float distance;
00073     path_property(){
00074         val = 0.0;
00075         time = 0;
00076         distance = 0;
00077     }
00078 
00079 };
00080 
00081 // This class is used internally
00082 class path_properties: public MaxHeapOperators
00083 { 
00084         public:
00085             float  turn_angle;
00086             float  line_distance;
00087             float  path_distance;
00088             float  average_speed;
00089             float speed_change;
00090             vector direction;
00091             path_property min_speed;
00092             path_property max_speed;
00093             path_property stop;
00094             path_properties(){
00095                 turn_angle = 0.0;
00096                 line_distance    = 0.0;
00097                 path_distance = 0.0;
00098                 average_speed = 0.0;
00099                 speed_change  = 1.0;
00100                 min_speed.val     = 1000000.0;
00101             }
00102 
00103          path_properties& operator=(const path_properties& T);
00104 
00105 };
00106 
00107