Panda3D

- Main Page
- Packages
- Classes

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Member Functions | Static Public Member Functions

# CurveFitter Class Reference

List of all members.

## Public Member Functions
| CurveFitter ()
| addHpr (float t, VBase3 const hpr)
| Adds a single sample hpr.
| addXyz (float t, VBase3 const xyz)
| Adds a single sample xyz.
| addXyzHpr (float t, VBase3 const xyz, VBase3 const hpr)
| Adds a single sample xyz & hpr simultaneously.
| computeTangents (float scale)
| Once a set of points has been built, and prior to calling MakeHermite() or MakeNurbs(), ComputeTangents() must be called to set up the tangents correctly (unless the tangents were defined as the points were added).
| desample (float factor)
| Removes sample points in order to reduce the complexity of a sampled curve.
int | getNumSamples ()
| Returns the number of sample points that have been added.
VBase3 | getSampleHpr (int n)
| Returns the orientation of the nth sample added.
float | getSampleT (int n)
| Returns the parametric value of the nth sample added.
VBase3 | getSampleTangent (int n)
| Returns the tangent associated with the nth sample added.
VBase3 | getSampleXyz (int n)
| Returns the point in space of the nth sample added.
ParametricCurveCollection | makeHermite ()
| Converts the current set of data points into a Hermite curve.
ParametricCurveCollection | makeNurbs ()
| Converts the current set of data points into a NURBS curve.
| output (ostream out)
| removeSamples (int begin, int end)
| Eliminates all samples from index begin, up to but not including index end, from the database.
| reset ()
| Removes all the data points previously added to the CurveFitter, and initializes it for a new curve.
| sample (ParametricCurveCollection curves, int count)
| Generates a series of data points by sampling the given curve (or xyz/hpr curves) the indicated number of times.
| sortPoints ()
| Sorts all the data points in order by parametric time, in case they were added in an incorrect order.
| wrapHpr ()
| Resets each HPR data point so that the maximum delta between any two consecutive points is 180 degrees, which should prevent incorrect HPR wrapping.
| write (ostream out)
## Static Public Member Functions
static TypeHandle | getClassType ()

## Constructor & Destructor Documentation

CurveFitter | ( |  | ) |

## Member Function Documentation

addHpr | ( | float | t,
|  | VBase3 const | hpr
| ) |  |

Adds a single sample hpr.

addXyz | ( | float | t,
|  | VBase3 const | xyz
| ) |  |

Adds a single sample xyz.

addXyzHpr | ( | float | t,
|  | VBase3 const | xyz,
|  | VBase3 const | hpr
| ) |  |

Adds a single sample xyz & hpr simultaneously.

computeTangents | ( | float | scale | ) |

Once a set of points has been built, and prior to calling MakeHermite() or MakeNurbs(), ComputeTangents() must be called to set up the tangents correctly (unless the tangents were defined as the points were added).

desample | ( | float | factor | ) |

Removes sample points in order to reduce the complexity of a sampled curve.

Keeps one out of every factor samples. Also keeps the first and the last samples.

static TypeHandle getClassType | ( |  | ) | `[static]`

int getNumSamples | ( |  | ) |

Returns the number of sample points that have been added.

VBase3 getSampleHpr | ( | int | n | ) |

Returns the orientation of the nth sample added.

float getSampleT | ( | int | n | ) |

Returns the parametric value of the nth sample added.

VBase3 getSampleTangent | ( | int | n | ) |

Returns the tangent associated with the nth sample added.

This is only meaningful if compute_tangents() has already been called.

VBase3 getSampleXyz | ( | int | n | ) |

Returns the point in space of the nth sample added.

ParametricCurveCollection makeHermite | ( |  | ) |

Converts the current set of data points into a Hermite curve.

ParametricCurveCollection makeNurbs | ( |  | ) |

Converts the current set of data points into a NURBS curve.

This gives a smoother curve than produced by MakeHermite().

output | ( | ostream | out | ) |

removeSamples | ( | int | begin,
|  | int | end
| ) |  |

Eliminates all samples from index begin, up to but not including index end, from the database.

reset | ( |  | ) |

Removes all the data points previously added to the CurveFitter, and initializes it for a new curve.

sample | ( | ParametricCurveCollection | curves,
|  | int | count
| ) |  |

Generates a series of data points by sampling the given curve (or xyz/hpr curves) the indicated number of times.

The sampling is made evenly in parametric time, and then the timewarps, if any, are applied.

sortPoints | ( |  | ) |

Sorts all the data points in order by parametric time, in case they were added in an incorrect order.

wrapHpr | ( |  | ) |

Resets each HPR data point so that the maximum delta between any two consecutive points is 180 degrees, which should prevent incorrect HPR wrapping.

write | ( | ostream | out | ) |

All Classes Namespaces Functions Variables Enumerations Enumerator Properties