LParabolad

class LParabolad

An abstract mathematical description of a parabola, particularly useful for describing arcs of projectiles.

The parabolic equation, given parametrically here, is P = At^2 + Bt + C.

Inheritance diagram

Inheritance diagram of LParabolad

LParabolad(void)
LParabolad(LVecBase3d const &a, LVecBase3d const &b, LVecBase3d const &c)
LParabolad(LParabolad const &copy)

Constructs a meaningless degenerate parabola.

Constructs a parabola given the three points of the parametric equation: the acceleration, initial velocity, and start point.

LPoint3d calc_point(double t) const

Computes the point on the parabola at time t.

LVecBase3d const &get_a(void) const

Returns the first point of the parabola’s parametric equation: the acceleration.

LVecBase3d const &get_b(void) const

Returns the second point of the parabola’s parametric equation: the initial velocity.

LVecBase3d const &get_c(void) const

Returns the third point of the parabola’s parametric equation: the start point.

void output(std::ostream &out) const
void read_datagram(DatagramIterator &source)

Reads the parabola from the Datagram using get_stdfloat().

void read_datagram_fixed(DatagramIterator &source)

Reads the parabola from the Datagram using get_float32() or get_float64(). See write_datagram_fixed().

void write(std::ostream &out, int indent_level = 0) const
void write_datagram(Datagram &destination) const

Writes the parabola to the Datagram using add_stdfloat(). This is appropriate when you want to write the vector using the standard width setting, especially when you are writing a bam file.

void write_datagram_fixed(Datagram &destination) const

Writes the parabola to the Datagram using add_float32() or add_float64(), depending on the type of floats in the parabola, regardless of the setting of Datagram::set_stdfloat_double(). This is appropriate when you want to write a fixed-width value to the datagram, especially when you are not writing a bam file.

void xform(LMatrix4d const &mat)

Transforms the parabola by the indicated matrix.