00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef NURBSMATRIXVECTOR_H
00020 #define NURBSMATRIXVECTOR_H
00021
00022 #include "pandabase.h"
00023 #include "luse.h"
00024 #include "pvector.h"
00025 #include "pmap.h"
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040 class EXPCL_PANDA NurbsMatrixVector {
00041 public:
00042 INLINE NurbsMatrixVector();
00043 INLINE ~NurbsMatrixVector();
00044
00045 INLINE int get_num_segments() const;
00046 INLINE float get_start_t() const;
00047 INLINE float get_end_t() const;
00048
00049 INLINE int get_vertex_index(int segment) const;
00050 INLINE float get_from(int segment) const;
00051 INLINE float get_to(int segment) const;
00052 INLINE const LMatrix4f &get_matrix(int segment) const;
00053 INLINE float scale_t(int segment, float t) const;
00054
00055 void clear();
00056 void append_segment(int order, int vertex_index, const float knots[]);
00057 void compose_segment(const NurbsMatrixVector &basis, int segment,
00058 const LMatrix4f &geom);
00059
00060 private:
00061 static LVecBase4f nurbs_blending_function(int order, int i, int j,
00062 const float knots[]);
00063
00064 private:
00065 class Segment {
00066 public:
00067 int _vertex_index;
00068 float _from;
00069 float _to;
00070 LMatrix4f _matrix;
00071 };
00072
00073 typedef pvector<Segment> Segments;
00074 Segments _segments;
00075 };
00076
00077 #include "nurbsMatrixVector.I"
00078
00079 #endif
00080