2008-03-25 18:02:13 +08:00
|
|
|
|
|
|
|
#ifndef __DSC_H
|
|
|
|
#define __DSC_H
|
|
|
|
|
|
|
|
typedef unsigned long DWORD;
|
|
|
|
typedef unsigned char BYTE;
|
|
|
|
|
2008-03-27 17:53:51 +08:00
|
|
|
typedef struct VectorTag Vector;
|
|
|
|
|
|
|
|
typedef struct VectorTag {
|
2008-03-25 18:02:13 +08:00
|
|
|
double x, y, z;
|
2008-03-27 17:53:51 +08:00
|
|
|
|
|
|
|
Vector Cross(Vector b);
|
|
|
|
double Vector::Dot(Vector b);
|
|
|
|
Vector RotatedAbout(Vector axis, double theta);
|
|
|
|
double Magnitude(void);
|
|
|
|
Vector ScaledBy(double v);
|
|
|
|
|
2008-03-25 18:02:13 +08:00
|
|
|
} Vector;
|
|
|
|
|
2008-03-27 17:53:51 +08:00
|
|
|
typedef struct {
|
|
|
|
double x, y;
|
|
|
|
} Point2d;
|
|
|
|
|
2008-03-26 17:18:12 +08:00
|
|
|
template <class T, class H> struct IdList {
|
|
|
|
typedef struct {
|
|
|
|
T v;
|
|
|
|
int tag;
|
|
|
|
} Elem;
|
|
|
|
|
|
|
|
Elem elem;
|
|
|
|
int elems;
|
|
|
|
int elemsAllocated;
|
|
|
|
|
|
|
|
void addAndAssignId(T *v);
|
|
|
|
void removeTagged(void);
|
|
|
|
|
|
|
|
void clear(void);
|
|
|
|
};
|
|
|
|
|
2008-03-25 18:02:13 +08:00
|
|
|
#endif
|