ParametricCurveCollection

from panda3d.core import ParametricCurveCollection
class ParametricCurveCollection

Bases: ReferenceCount

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.

Inheritance diagram

Inheritance diagram of ParametricCurveCollection

__init__(*args, **kwargs)
addCurve()

C++ Interface: add_curve(const ParametricCurveCollection self, ParametricCurve curve) add_curve(const ParametricCurveCollection self, ParametricCurve curve, int index)

/**
  • Adds a new ParametricCurve to the collection at the indicated index.

  • @deprecated Use insert_curve(index, curve) instead.

*/

/**
  • Adds a new ParametricCurve to the collection.

*/

addCurves()

C++ Interface: add_curves(const ParametricCurveCollection self, PandaNode node)

/**
  • Adds all the curves found in the scene graph rooted at the given node.

  • Returns the number of curves found.

*/

add_curve()

C++ Interface: add_curve(const ParametricCurveCollection self, ParametricCurve curve) add_curve(const ParametricCurveCollection self, ParametricCurve curve, int index)

/**
  • Adds a new ParametricCurve to the collection at the indicated index.

  • @deprecated Use insert_curve(index, curve) instead.

*/

/**
  • Adds a new ParametricCurve to the collection.

*/

add_curves()

C++ Interface: add_curves(const ParametricCurveCollection self, PandaNode node)

/**
  • Adds all the curves found in the scene graph rooted at the given node.

  • Returns the number of curves found.

*/

adjustHpr()

C++ Interface: adjust_hpr(const ParametricCurveCollection self, float t, const LVecBase3f xyz) adjust_hpr(const ParametricCurveCollection self, float t, float h, float p, float r)

/**
  • 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.

*/

/**
  • 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.

*/

adjustXyz()

C++ Interface: adjust_xyz(const ParametricCurveCollection self, float t, const LVecBase3f xyz) adjust_xyz(const ParametricCurveCollection self, float t, float x, float y, float z)

/**
  • 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.

*/

/**
  • 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.

*/

adjust_hpr()

C++ Interface: adjust_hpr(const ParametricCurveCollection self, float t, const LVecBase3f xyz) adjust_hpr(const ParametricCurveCollection self, float t, float h, float p, float r)

/**
  • 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.

*/

/**
  • 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.

*/

adjust_xyz()

C++ Interface: adjust_xyz(const ParametricCurveCollection self, float t, const LVecBase3f xyz) adjust_xyz(const ParametricCurveCollection self, float t, float x, float y, float z)

/**
  • 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.

*/

/**
  • 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.

*/

clear()

C++ Interface: clear(const ParametricCurveCollection self)

/**
  • Removes all ParametricCurves from the collection.

*/

clearTimewarps()

C++ Interface: clear_timewarps(const ParametricCurveCollection self)

/**
  • Removes all the timewarp curves from the collection.

*/

clear_timewarps()

C++ Interface: clear_timewarps(const ParametricCurveCollection self)

/**
  • Removes all the timewarp curves from the collection.

*/

curves
default_curve
evaluate()

C++ Interface: evaluate(ParametricCurveCollection self, float t, LMatrix4f result) evaluate(ParametricCurveCollection self, float t, LMatrix4f result, int cs) evaluate(ParametricCurveCollection self, float t, LVecBase3f xyz, LVecBase3f hpr)

/**
  • 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.

  • 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.

*/

/**
  • 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.

*/

evaluateHpr()

C++ Interface: evaluate_hpr(ParametricCurveCollection self, float t, LVecBase3f hpr)

/**
  • Computes only the HPR part of the curves. See evaluate().

*/

evaluateT()

C++ Interface: evaluate_t(ParametricCurveCollection self, float t)

/**
  • 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. Return -1.0f if

  • the value of t exceeds one of the timewarps’ ranges.

*/

evaluateXyz()

C++ Interface: evaluate_xyz(ParametricCurveCollection self, float t, LVecBase3f xyz)

/**
  • Computes only the XYZ part of the curves. See evaluate().

*/

evaluate_hpr()

C++ Interface: evaluate_hpr(ParametricCurveCollection self, float t, LVecBase3f hpr)

/**
  • Computes only the HPR part of the curves. See evaluate().

*/

evaluate_t()

C++ Interface: evaluate_t(ParametricCurveCollection self, float t)

/**
  • 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. Return -1.0f if

  • the value of t exceeds one of the timewarps’ ranges.

*/

evaluate_xyz()

C++ Interface: evaluate_xyz(ParametricCurveCollection self, float t, LVecBase3f xyz)

/**
  • Computes only the XYZ part of the curves. See evaluate().

*/

faceForward()

C++ Interface: face_forward(const ParametricCurveCollection self, float 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.

*/

face_forward()

C++ Interface: face_forward(const ParametricCurveCollection self, float 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.

*/

getCurve()

C++ Interface: get_curve(ParametricCurveCollection self, int index)

/**
  • Returns the nth ParametricCurve in the collection.

*/

getCurves()
getDefaultCurve()

C++ Interface: get_default_curve(ParametricCurveCollection self)

/**
  • If there is an XYZ curve in the collection, returns it; otherwise, returns

  • the first curve whose type is unspecified. Returns NULL if no curve meets

  • the criteria.

*/

getHprCurve()

C++ Interface: get_hpr_curve(ParametricCurveCollection self)

/**
  • Returns the first HPR curve in the collection, if any, or NULL if there are

  • none.

*/

getMaxT()

C++ Interface: get_max_t(ParametricCurveCollection self)

/**
  • Returns the maximum T value associated with the last curve in the

  • collection. Normally, this will be either the XYZ or HPR curve, or a

  • timewarp curve.

*/

getNumCurves()

C++ Interface: get_num_curves(ParametricCurveCollection self)

/**
  • Returns the number of ParametricCurves in the collection.

*/

getNumTimewarps()

C++ Interface: get_num_timewarps(ParametricCurveCollection self)

/**
  • Returns the number of timewarp curves in the collection.

*/

getTimewarpCurve()

C++ Interface: get_timewarp_curve(ParametricCurveCollection self, int n)

/**
  • Returns the nth timewarp curve in the collection.

*/

getTimewarpCurves()
getXyzCurve()

C++ Interface: get_xyz_curve(ParametricCurveCollection self)

/**
  • Returns the first XYZ curve in the collection, if any, or NULL if there are

  • none.

*/

get_curve()

C++ Interface: get_curve(ParametricCurveCollection self, int index)

/**
  • Returns the nth ParametricCurve in the collection.

*/

get_curves()
get_default_curve()

C++ Interface: get_default_curve(ParametricCurveCollection self)

/**
  • If there is an XYZ curve in the collection, returns it; otherwise, returns

  • the first curve whose type is unspecified. Returns NULL if no curve meets

  • the criteria.

*/

get_hpr_curve()

C++ Interface: get_hpr_curve(ParametricCurveCollection self)

/**
  • Returns the first HPR curve in the collection, if any, or NULL if there are

  • none.

*/

get_max_t()

C++ Interface: get_max_t(ParametricCurveCollection self)

/**
  • Returns the maximum T value associated with the last curve in the

  • collection. Normally, this will be either the XYZ or HPR curve, or a

  • timewarp curve.

*/

get_num_curves()

C++ Interface: get_num_curves(ParametricCurveCollection self)

/**
  • Returns the number of ParametricCurves in the collection.

*/

get_num_timewarps()

C++ Interface: get_num_timewarps(ParametricCurveCollection self)

/**
  • Returns the number of timewarp curves in the collection.

*/

get_timewarp_curve()

C++ Interface: get_timewarp_curve(ParametricCurveCollection self, int n)

/**
  • Returns the nth timewarp curve in the collection.

*/

get_timewarp_curves()
get_xyz_curve()

C++ Interface: get_xyz_curve(ParametricCurveCollection self)

/**
  • Returns the first XYZ curve in the collection, if any, or NULL if there are

  • none.

*/

hasCurve()

C++ Interface: has_curve(ParametricCurveCollection self, ParametricCurve curve)

/**
  • Returns true if the indicated ParametricCurve appears in this collection,

  • false otherwise.

*/

has_curve()

C++ Interface: has_curve(ParametricCurveCollection self, ParametricCurve curve)

/**
  • Returns true if the indicated ParametricCurve appears in this collection,

  • false otherwise.

*/

hpr_curve
insertCurve()

C++ Interface: insert_curve(const ParametricCurveCollection self, int index, ParametricCurve curve)

/**
  • Adds a new ParametricCurve to the collection at the indicated index.

*/

insert_curve()

C++ Interface: insert_curve(const ParametricCurveCollection self, int index, ParametricCurve curve)

/**
  • Adds a new ParametricCurve to the collection at the indicated index.

*/

makeEven()

C++ Interface: make_even(const ParametricCurveCollection self, float max_t, float 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.

  • 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.

*/

make_even()

C++ Interface: make_even(const ParametricCurveCollection self, float max_t, float 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.

  • 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.

*/

max_t
output()

C++ Interface: output(ParametricCurveCollection self, ostream out)

/**
  • Writes a brief one-line description of the ParametricCurveCollection to the

  • indicated output stream.

*/

recompute()

C++ Interface: recompute(const ParametricCurveCollection self)

/**
  • Ensures all the curves are freshly computed and up-to-date. Returns true

  • if everything is valid, false if at least one curve is incorrect.

*/

removeCurve()

C++ Interface: remove_curve(const ParametricCurveCollection self, ParametricCurve curve) remove_curve(const ParametricCurveCollection self, int index)

/**
  • Removes the indicated ParametricCurve from the collection. Returns true if

  • the curve was removed, false if it was not a member of the collection.

*/

/**
  • Removes the indicated ParametricCurve from the collection, by its index

  • number.

*/

remove_curve()

C++ Interface: remove_curve(const ParametricCurveCollection self, ParametricCurve curve) remove_curve(const ParametricCurveCollection self, int index)

/**
  • Removes the indicated ParametricCurve from the collection. Returns true if

  • the curve was removed, false if it was not a member of the collection.

*/

/**
  • Removes the indicated ParametricCurve from the collection, by its index

  • number.

*/

resetMaxT()

C++ Interface: reset_max_t(const ParametricCurveCollection self, float 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()]. After this call,

  • the curve collection will contain one more timewarp curve, and get_max_t()

  • will return the given max_t value.

*/

reset_max_t()

C++ Interface: reset_max_t(const ParametricCurveCollection self, float 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()]. After this call,

  • the curve collection will contain one more timewarp curve, and get_max_t()

  • will return the given max_t value.

*/

setCurve()

C++ Interface: set_curve(const ParametricCurveCollection self, int index, ParametricCurve curve)

/**
  • Replaces the indicated ParametricCurve from the collection, by its index

  • number.

*/

set_curve()

C++ Interface: set_curve(const ParametricCurveCollection self, int index, ParametricCurve curve)

/**
  • Replaces the indicated ParametricCurve from the collection, by its index

  • number.

*/

stitch()

C++ Interface: stitch(const ParametricCurveCollection self, const ParametricCurveCollection a, const ParametricCurveCollection b)

/**
  • Regenerates this curve as one long curve: the first curve connected end-to-

  • end with the second one. Either a or b may be the same as ‘this’. This

  • will lose any timewarps on the input curves.

  • Returns true if successful, false on failure.

*/

timewarp_curves
write()

C++ Interface: write(ParametricCurveCollection self, ostream out, int indent_level)

/**
  • Writes a complete multi-line description of the ParametricCurveCollection

  • to the indicated output stream.

*/

writeEgg()

C++ Interface: write_egg(const ParametricCurveCollection self, Filename filename) write_egg(const ParametricCurveCollection self, Filename filename, int cs) write_egg(const ParametricCurveCollection self, ostream out, const Filename filename, int cs)

/**
  • Writes an egg description of all the nurbs curves in the collection to the

  • specified output file. Returns true if the file is successfully written.

*/

/**
  • Writes an egg description of all the nurbs curves in the collection to the

  • specified output stream. Returns true if the file is successfully written.

*/

write_egg()

C++ Interface: write_egg(const ParametricCurveCollection self, Filename filename) write_egg(const ParametricCurveCollection self, Filename filename, int cs) write_egg(const ParametricCurveCollection self, ostream out, const Filename filename, int cs)

/**
  • Writes an egg description of all the nurbs curves in the collection to the

  • specified output file. Returns true if the file is successfully written.

*/

/**
  • Writes an egg description of all the nurbs curves in the collection to the

  • specified output stream. Returns true if the file is successfully written.

*/

xyz_curve