|
|
|
This is a set of zero or more ParametricCurves, which may or may not be related.
More...
#include "parametricCurveCollection.h"
List of all members.
Public Member Functions |
| void | add_curve (ParametricCurve *curve) |
| | Adds a new ParametricCurve to the collection.
|
| void | add_curve (ParametricCurve *curve, int index) |
| | Adds a new ParametricCurve to the collection at the indicated index.
|
| int | add_curves (PandaNode *node) |
| | Adds all the curves found in the scene graph rooted at the given node.
|
| bool | adjust_hpr (PN_stdfloat t, PN_stdfloat h, PN_stdfloat p, PN_stdfloat r) |
| | Adjust the HPR curve at the indicated time to the new value.
|
| bool | adjust_hpr (PN_stdfloat t, const LVecBase3 &xyz) |
| | Adjust the HPR curve at the indicated time to the new value.
|
| bool | adjust_xyz (PN_stdfloat t, PN_stdfloat x, PN_stdfloat y, PN_stdfloat z) |
| | Adjust the XYZ curve at the indicated time to the new value.
|
| bool | adjust_xyz (PN_stdfloat t, const LVecBase3 &xyz) |
| | Adjust the XYZ curve at the indicated time to the new value.
|
| void | clear () |
| | Removes all ParametricCurves from the collection.
|
| void | clear_timewarps () |
| | Removes all the timewarp curves from the collection.
|
| bool | evaluate (PN_stdfloat t, LVecBase3 &xyz, LVecBase3 &hpr) const |
| | Computes the position and rotation represented by the first XYZ and HPR curves in the collection at the given point t, after t has been modified by all the timewarp curves in the collection applied in sequence, from back to front.
|
| bool | evaluate (PN_stdfloat t, LMatrix4 &result, CoordinateSystem cs=CS_default) const |
| | Computes the transform matrix representing translation to the position indicated by the first XYZ curve in the collection and the rotation indicated by the first HPR curve in the collection, after t has been modified by all the timewarp curves in the collection applied in sequence, from back to front.
|
| bool | evaluate_hpr (PN_stdfloat t, LVecBase3 &hpr) const |
| | Computes only the HPR part of the curves.
|
| PN_stdfloat | evaluate_t (PN_stdfloat t) const |
| | Determines the value of t that should be passed to the XYZ and HPR curves, after applying the given value of t to all the timewarps.
|
| bool | evaluate_xyz (PN_stdfloat t, LVecBase3 &xyz) const |
| | Computes only the XYZ part of the curves.
|
| void | face_forward (PN_stdfloat segments_per_unit) |
| | Discards the existing HPR curve and generates a new one that looks in the direction of travel along the XYZ curve, based on the XYZ curve's tangent at each point.
|
| ParametricCurve * | get_curve (int index) const |
| | Returns the nth ParametricCurve in the collection.
|
| ParametricCurve * | get_default_curve () const |
| | If there is an XYZ curve in the collection, returns it; otherwise, returns the first curve whose type is unspecified.
|
| ParametricCurve * | get_hpr_curve () const |
| | Returns the first HPR curve in the collection, if any, or NULL if there are none.
|
| PN_stdfloat | get_max_t () const |
| | Returns the maximum T value associated with the last* curve in the collection.
|
| int | get_num_curves () const |
| | Returns the number of ParametricCurves in the collection.
|
| int | get_num_timewarps () const |
| | Returns the number of timewarp curves in the collection.
|
| ParametricCurve * | get_timewarp_curve (int n) const |
| | Returns the nth timewarp curve in the collection.
|
| ParametricCurve * | get_xyz_curve () const |
| | Returns the first XYZ curve in the collection, if any, or NULL if there are none.
|
| bool | has_curve (ParametricCurve *curve) const |
| | Returns true if the indicated ParametricCurve appears in this collection, false otherwise.
|
| void | make_even (PN_stdfloat max_t, PN_stdfloat segments_per_unit) |
| | Discards all existing timewarp curves and recomputes a new timewarp curve that maps distance along the curve to parametric time, so that the distance between any two points in parametric time is proportional to the approximate distance of those same two points along the XYZ curve.
|
|
| MAKE_SEQ (get_curves, get_num_curves, get_curve) |
|
| MAKE_SEQ (get_timewarp_curves, get_num_timewarps, get_timewarp_curve) |
| void | output (ostream &out) const |
| | Writes a brief one-line description of the ParametricCurveCollection to the indicated output stream.
|
| int | r_add_curves (PandaNode *node) |
| | The recursive implementation of add_curves().
|
| bool | recompute () |
| | Ensures all the curves are freshly computed and up-to-date.
|
| void | register_drawer (ParametricCurveDrawer *drawer) |
| | Registers a Drawer with this curve collection that will automatically be updated whenever the collection is modified, so that the visible representation of the curve is kept up to date.
|
| bool | remove_curve (ParametricCurve *curve) |
| | Removes the indicated ParametricCurve from the collection.
|
| void | remove_curve (int index) |
| | Removes the indicated ParametricCurve from the collection, by its index number.
|
| void | reset_max_t (PN_stdfloat max_t) |
| | Adjusts the apparent length of the curve by applying a new timewarp that maps the range [0..max_t] to the range [0..get_max_t()].
|
| bool | stitch (const ParametricCurveCollection *a, const ParametricCurveCollection *b) |
| | Regenerates this curve as one long curve: the first curve connected end-to-end with the second one.
|
| void | unregister_drawer (ParametricCurveDrawer *drawer) |
| | Removes a previously registered drawer from the list of automatically-refreshed drawers.
|
| void | write (ostream &out, int indent_level=0) const |
| | Writes a complete multi-line description of the ParametricCurveCollection to the indicated output stream.
|
| bool | write_egg (Filename filename, CoordinateSystem cs=CS_default) |
| | Writes an egg description of all the nurbs curves in the collection to the specified output file.
|
| bool | write_egg (ostream &out, const Filename &filename, CoordinateSystem cs) |
| | Writes an egg description of all the nurbs curves in the collection to the specified output stream.
|
Detailed Description
This is a set of zero or more ParametricCurves, which may or may not be related.
If they are related, the set should contain no more than one XYZ curve, no more than one HPR curve, and zero or more Timewarp curves, which can then be evaluated as a unit to return a single transformation matrix for a given unit of time.
Definition at line 41 of file parametricCurveCollection.h.
Member Function Documentation
Adjust the HPR curve at the indicated time to the new value.
The curve shape will change correspondingly. Returns true if successful, false if unable to make the adjustment for some reason.
Definition at line 108 of file parametricCurveCollection.I.
Adjust the XYZ curve at the indicated time to the new value.
The curve shape will change correspondingly. Returns true if successful, false if unable to make the adjustment for some reason.
Definition at line 95 of file parametricCurveCollection.I.
Computes the transform matrix representing translation to the position indicated by the first XYZ curve in the collection and the rotation indicated by the first HPR curve in the collection, after t has been modified by all the timewarp curves in the collection applied in sequence, from back to front.
Returns true if the point is valid (i.e. t is within the bounds indicated by all the timewarp curves and within the bounds of the curves themselves), or false otherwise.
Definition at line 558 of file parametricCurveCollection.cxx.
References evaluate().
Discards all existing timewarp curves and recomputes a new timewarp curve that maps distance along the curve to parametric time, so that the distance between any two points in parametric time is proportional to the approximate distance of those same two points along the XYZ curve.
segments_per_unit represents the number of segments to take per each unit of parametric time of the original XYZ curve.
The new timewarp curve (and thus, the apparent range of the collection) will range from 0 to max_t.
Definition at line 320 of file parametricCurveCollection.cxx.
References add_curve(), CurveFitter::add_xyz(), ParametricCurve::calc_length(), clear_timewarps(), CurveFitter::compute_tangents(), ParametricCurve::find_length(), ParametricCurve::get_max_t(), get_xyz_curve(), and ParametricCurve::set_curve_type().
Registers a Drawer with this curve collection that will automatically be updated whenever the collection is modified, so that the visible representation of the curve is kept up to date.
This is called automatically by the ParametricCurveDrawer.
Any number of Drawers may be registered with a particular curve collection.
Definition at line 884 of file parametricCurveCollection.cxx.
References ParametricCurve::register_drawer().
The documentation for this class was generated from the following files:
| | |