|
|
@@ -19,16 +19,16 @@
|
|
|
// Includes
|
|
|
////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
-#include "pandabase.h"
|
|
|
-
|
|
|
+#include "pandabase.h"
|
|
|
+
|
|
|
#include <typedef.h>
|
|
|
#include <list>
|
|
|
-#include <vector>
|
|
|
-using namespace std;
|
|
|
-
|
|
|
-#include "typedWriteableReferenceCount.h"
|
|
|
-#include "namable.h"
|
|
|
-#include "luse.h"
|
|
|
+#include <vector>
|
|
|
+using namespace std;
|
|
|
+
|
|
|
+#include "typedWriteableReferenceCount.h"
|
|
|
+#include "namable.h"
|
|
|
+#include "luse.h"
|
|
|
|
|
|
|
|
|
////////////////////////////////////////////////////////////////////
|
|
|
@@ -40,7 +40,7 @@ using namespace std;
|
|
|
// and writer code about the intention of this curve, and have no
|
|
|
// other effect on the curve.
|
|
|
|
|
|
-BEGIN_PUBLISH //[
|
|
|
+BEGIN_PUBLISH //[
|
|
|
#define PCT_NONE 0
|
|
|
// Unspecified type.
|
|
|
|
|
|
@@ -51,7 +51,7 @@ BEGIN_PUBLISH //[
|
|
|
// The curve represents Euler rotation angles.
|
|
|
|
|
|
#define PCT_T 3
|
|
|
-// A one-dimensional timewarp curve.
|
|
|
+// A one-dimensional timewarp curve.
|
|
|
END_PUBLISH //]
|
|
|
|
|
|
|
|
|
@@ -80,7 +80,7 @@ class NurbsCurve;
|
|
|
// This encapsulates all curves in 3-d space defined
|
|
|
// for a single parameter t in the range [0,get_max_t()].
|
|
|
////////////////////////////////////////////////////////////////////
|
|
|
-class EXPCL_PANDA ParametricCurve : public TypedWriteableReferenceCount,
|
|
|
+class EXPCL_PANDA ParametricCurve : public TypedWriteableReferenceCount,
|
|
|
public Namable {
|
|
|
|
|
|
////////////////////////////////////////////////////////////////////
|
|
|
@@ -97,17 +97,17 @@ PUBLISHED:
|
|
|
|
|
|
void set_num_dimensions(int num);
|
|
|
int get_num_dimensions() const;
|
|
|
-
|
|
|
- float calc_length() const;
|
|
|
- float calc_length(double from, double to) const;
|
|
|
- double compute_t(double start_t, double length_offset, double guess,
|
|
|
- double threshold) const;
|
|
|
-
|
|
|
- bool convert_to_nurbs(NurbsCurve &nc) const;
|
|
|
-
|
|
|
- void ascii_draw() const;
|
|
|
-
|
|
|
-public:
|
|
|
+
|
|
|
+ float calc_length() const;
|
|
|
+ float calc_length(double from, double to) const;
|
|
|
+ double compute_t(double start_t, double length_offset, double guess,
|
|
|
+ double threshold) const;
|
|
|
+
|
|
|
+ bool convert_to_nurbs(NurbsCurve &nc) const;
|
|
|
+
|
|
|
+ void ascii_draw() const;
|
|
|
+
|
|
|
+public:
|
|
|
virtual bool get_point(double t, LVector3f &point) const=0;
|
|
|
virtual bool get_tangent(double t, LVector3f &tangent) const=0;
|
|
|
virtual bool get_pt(double t, LVector3f &point, LVector3f &tangent) const=0;
|
|
|
@@ -127,8 +127,8 @@ public:
|
|
|
|
|
|
ParametricCurve();
|
|
|
|
|
|
- virtual void write_datagram(BamWriter *, Datagram &);
|
|
|
-
|
|
|
+ virtual void write_datagram(BamWriter *, Datagram &);
|
|
|
+
|
|
|
virtual bool GetBezierSegs(BezierSegs &) const {
|
|
|
return false;
|
|
|
}
|
|
|
@@ -154,22 +154,22 @@ protected:
|
|
|
DrawerList _drawers;
|
|
|
int _curve_type;
|
|
|
int _num_dimensions;
|
|
|
-
|
|
|
-
|
|
|
-public:
|
|
|
- static TypeHandle get_class_type() {
|
|
|
- return _type_handle;
|
|
|
- }
|
|
|
- static void init_type() {
|
|
|
- register_type(_type_handle, "ParametricCurve");
|
|
|
- }
|
|
|
- virtual TypeHandle get_type() const {
|
|
|
- return get_class_type();
|
|
|
- }
|
|
|
- virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
|
|
|
-
|
|
|
-private:
|
|
|
- static TypeHandle _type_handle;
|
|
|
+
|
|
|
+
|
|
|
+public:
|
|
|
+ static TypeHandle get_class_type() {
|
|
|
+ return _type_handle;
|
|
|
+ }
|
|
|
+ static void init_type() {
|
|
|
+ register_type(_type_handle, "ParametricCurve");
|
|
|
+ }
|
|
|
+ virtual TypeHandle get_type() const {
|
|
|
+ return get_class_type();
|
|
|
+ }
|
|
|
+ virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
|
|
|
+
|
|
|
+private:
|
|
|
+ static TypeHandle _type_handle;
|
|
|
};
|
|
|
|
|
|
|
|
|
@@ -254,24 +254,24 @@ protected:
|
|
|
|
|
|
vector<Curveseg> _segs;
|
|
|
int _last_ti;
|
|
|
-
|
|
|
-
|
|
|
-public:
|
|
|
- static TypeHandle get_class_type() {
|
|
|
- return _type_handle;
|
|
|
- }
|
|
|
- static void init_type() {
|
|
|
- ParametricCurve::init_type();
|
|
|
- register_type(_type_handle, "PiecewiseCurve",
|
|
|
- ParametricCurve::get_class_type());
|
|
|
- }
|
|
|
- virtual TypeHandle get_type() const {
|
|
|
- return get_class_type();
|
|
|
- }
|
|
|
- virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
|
|
|
-
|
|
|
-private:
|
|
|
- static TypeHandle _type_handle;
|
|
|
+
|
|
|
+
|
|
|
+public:
|
|
|
+ static TypeHandle get_class_type() {
|
|
|
+ return _type_handle;
|
|
|
+ }
|
|
|
+ static void init_type() {
|
|
|
+ ParametricCurve::init_type();
|
|
|
+ register_type(_type_handle, "PiecewiseCurve",
|
|
|
+ ParametricCurve::get_class_type());
|
|
|
+ }
|
|
|
+ virtual TypeHandle get_type() const {
|
|
|
+ return get_class_type();
|
|
|
+ }
|
|
|
+ virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
|
|
|
+
|
|
|
+private:
|
|
|
+ static TypeHandle _type_handle;
|
|
|
};
|
|
|
|
|
|
|
|
|
@@ -364,24 +364,24 @@ public:
|
|
|
|
|
|
protected:
|
|
|
virtual ~CubicCurveseg();
|
|
|
-
|
|
|
-
|
|
|
-public:
|
|
|
- static TypeHandle get_class_type() {
|
|
|
- return _type_handle;
|
|
|
- }
|
|
|
- static void init_type() {
|
|
|
- ParametricCurve::init_type();
|
|
|
- register_type(_type_handle, "CubicCurveseg",
|
|
|
- ParametricCurve::get_class_type());
|
|
|
- }
|
|
|
- virtual TypeHandle get_type() const {
|
|
|
- return get_class_type();
|
|
|
- }
|
|
|
- virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
|
|
|
-
|
|
|
-private:
|
|
|
- static TypeHandle _type_handle;
|
|
|
+
|
|
|
+
|
|
|
+public:
|
|
|
+ static TypeHandle get_class_type() {
|
|
|
+ return _type_handle;
|
|
|
+ }
|
|
|
+ static void init_type() {
|
|
|
+ ParametricCurve::init_type();
|
|
|
+ register_type(_type_handle, "CubicCurveseg",
|
|
|
+ ParametricCurve::get_class_type());
|
|
|
+ }
|
|
|
+ virtual TypeHandle get_type() const {
|
|
|
+ return get_class_type();
|
|
|
+ }
|
|
|
+ virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
|
|
|
+
|
|
|
+private:
|
|
|
+ static TypeHandle _type_handle;
|
|
|
};
|
|
|
|
|
|
// This function is used internally to build the NURBS basis matrix
|