00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027 #ifndef _OBJECT_H_
00028 #define _OBJECT_H_
00029
00030 #include <SOLID/solid.h>
00031
00032 #include "Transform.h"
00033 #include "BBox.h"
00034 #include "Endpoint.h"
00035 #include "Shape.h"
00036
00037 class Object {
00038 public:
00039 Object(DtObjectRef obj, ShapePtr shape);
00040
00041 void move();
00042 void proceed();
00043
00044 void translate(const Vector& v) { curr.translate(v); }
00045 void rotate(const Quaternion& q) { curr.rotate(q); }
00046 void scale(Scalar x, Scalar y, Scalar z) { curr.scale(x, y, z); }
00047
00048 void setIdentity() { curr.setIdentity(); }
00049
00050 void setMatrix(const float v[16]) { curr.setValue(v); }
00051 void setMatrix(const double v[16]) { curr.setValue(v); }
00052
00053 void multMatrix(const float v[16]) { curr *= Transform(v); }
00054 void multMatrix(const double v[16]) { curr *= Transform(v); }
00055
00056 const BBox& getBBox() const { return bbox; }
00057
00058 Transform curr;
00059 Transform prev;
00060 DtObjectRef ref;
00061 ShapePtr shapePtr;
00062 BBox bbox;
00063 Endpoint lower[3];
00064 Endpoint upper[3];
00065 };
00066
00067 bool intersect(const Object&, const Object&, Vector& v);
00068 bool common_point(const Object&, const Object&, Vector&, Point&, Point&);
00069 bool prev_closest_points(const Object&, const Object&,
00070 Vector&, Point&, Point&);
00071 #endif
00072
00073
00074
00075
00076