226 lines
8.2 KiB
Plaintext
226 lines
8.2 KiB
Plaintext
// Filename: lpoint3_src.I
|
|
// Created by: drose (25Sep99)
|
|
//
|
|
////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
////////////////////////////////////////////////////////////////////
|
|
// Function: LPoint3::Default Constructor
|
|
// Access: Public
|
|
// Description:
|
|
////////////////////////////////////////////////////////////////////
|
|
INLINE_LINMATH FLOATNAME(LPoint3)::
|
|
FLOATNAME(LPoint3)() {
|
|
}
|
|
|
|
////////////////////////////////////////////////////////////////////
|
|
// Function: LPoint3::Copy Constructor
|
|
// Access: Public
|
|
// Description:
|
|
////////////////////////////////////////////////////////////////////
|
|
INLINE_LINMATH FLOATNAME(LPoint3)::
|
|
FLOATNAME(LPoint3)(const FLOATNAME(LVecBase3) ©) : FLOATNAME(LVecBase3)(copy) {
|
|
}
|
|
|
|
////////////////////////////////////////////////////////////////////
|
|
// Function: LPoint3::Copy Assignment Operator
|
|
// Access: Public
|
|
// Description:
|
|
////////////////////////////////////////////////////////////////////
|
|
INLINE_LINMATH FLOATNAME(LPoint3) &FLOATNAME(LPoint3)::
|
|
operator = (const FLOATNAME(LVecBase3) ©) {
|
|
FLOATNAME(LVecBase3)::operator = (copy);
|
|
return *this;
|
|
}
|
|
|
|
////////////////////////////////////////////////////////////////////
|
|
// Function: LPoint3::Copy Fill Operator
|
|
// Access: Public
|
|
// Description:
|
|
////////////////////////////////////////////////////////////////////
|
|
INLINE_LINMATH FLOATNAME(LPoint3) &FLOATNAME(LPoint3)::
|
|
operator = (FLOATTYPE fill_value) {
|
|
FLOATNAME(LVecBase3)::operator = (fill_value);
|
|
return *this;
|
|
}
|
|
|
|
////////////////////////////////////////////////////////////////////
|
|
// Function: LPoint3::Constructor
|
|
// Access: Public
|
|
// Description:
|
|
////////////////////////////////////////////////////////////////////
|
|
INLINE_LINMATH FLOATNAME(LPoint3)::
|
|
FLOATNAME(LPoint3)(FLOATTYPE fill_value) :
|
|
FLOATNAME(LVecBase3)(fill_value)
|
|
{
|
|
}
|
|
|
|
////////////////////////////////////////////////////////////////////
|
|
// Function: LPoint3::Constructor
|
|
// Access: Public
|
|
// Description:
|
|
////////////////////////////////////////////////////////////////////
|
|
INLINE_LINMATH FLOATNAME(LPoint3)::
|
|
FLOATNAME(LPoint3)(FLOATTYPE x, FLOATTYPE y, FLOATTYPE z) :
|
|
FLOATNAME(LVecBase3)(x, y, z)
|
|
{
|
|
}
|
|
|
|
////////////////////////////////////////////////////////////////////
|
|
// Function: LPoint3::zero Named Constructor
|
|
// Access: Public
|
|
// Description: Returns a zero-length point.
|
|
////////////////////////////////////////////////////////////////////
|
|
INLINE_LINMATH const FLOATNAME(LPoint3) &FLOATNAME(LPoint3)::
|
|
zero() {
|
|
return (const FLOATNAME(LPoint3) &)FLOATNAME(LVecBase3)::zero();
|
|
}
|
|
|
|
////////////////////////////////////////////////////////////////////
|
|
// Function: LPoint3::unit_x Named Constructor
|
|
// Access: Public
|
|
// Description: Returns a unit X point.
|
|
////////////////////////////////////////////////////////////////////
|
|
INLINE_LINMATH const FLOATNAME(LPoint3) &FLOATNAME(LPoint3)::
|
|
unit_x() {
|
|
return (const FLOATNAME(LPoint3) &)FLOATNAME(LVecBase3)::unit_x();
|
|
}
|
|
|
|
////////////////////////////////////////////////////////////////////
|
|
// Function: LPoint3::unit_y Named Constructor
|
|
// Access: Public
|
|
// Description: Returns a unit Y point.
|
|
////////////////////////////////////////////////////////////////////
|
|
INLINE_LINMATH const FLOATNAME(LPoint3) &FLOATNAME(LPoint3)::
|
|
unit_y() {
|
|
return (const FLOATNAME(LPoint3) &)FLOATNAME(LVecBase3)::unit_y();
|
|
}
|
|
|
|
////////////////////////////////////////////////////////////////////
|
|
// Function: LPoint3::unit_z Named Constructor
|
|
// Access: Public
|
|
// Description: Returns a unit Z point.
|
|
////////////////////////////////////////////////////////////////////
|
|
INLINE_LINMATH const FLOATNAME(LPoint3) &FLOATNAME(LPoint3)::
|
|
unit_z() {
|
|
return (const FLOATNAME(LPoint3) &)FLOATNAME(LVecBase3)::unit_z();
|
|
}
|
|
|
|
////////////////////////////////////////////////////////////////////
|
|
// Function: LPoint3::unary -
|
|
// Access: Public
|
|
// Description:
|
|
////////////////////////////////////////////////////////////////////
|
|
INLINE_LINMATH FLOATNAME(LPoint3) FLOATNAME(LPoint3)::
|
|
operator - () const {
|
|
return FLOATNAME(LVecBase3)::operator - ();
|
|
}
|
|
|
|
////////////////////////////////////////////////////////////////////
|
|
// Function: LPoint3::point + vecbase
|
|
// Access: Public
|
|
// Description:
|
|
////////////////////////////////////////////////////////////////////
|
|
INLINE_LINMATH FLOATNAME(LVecBase3) FLOATNAME(LPoint3)::
|
|
operator + (const FLOATNAME(LVecBase3) &other) const {
|
|
return FLOATNAME(LVecBase3)::operator + (other);
|
|
}
|
|
|
|
////////////////////////////////////////////////////////////////////
|
|
// Function: LPoint3::point + vector
|
|
// Access: Public
|
|
// Description:
|
|
////////////////////////////////////////////////////////////////////
|
|
INLINE_LINMATH FLOATNAME(LPoint3) FLOATNAME(LPoint3)::
|
|
operator + (const FLOATNAME(LVector3) &other) const {
|
|
return FLOATNAME(LVecBase3)::operator + (other);
|
|
}
|
|
|
|
////////////////////////////////////////////////////////////////////
|
|
// Function: LPoint3::point - vecbase
|
|
// Access: Public
|
|
// Description:
|
|
////////////////////////////////////////////////////////////////////
|
|
INLINE_LINMATH FLOATNAME(LVecBase3) FLOATNAME(LPoint3)::
|
|
operator - (const FLOATNAME(LVecBase3) &other) const {
|
|
return FLOATNAME(LVecBase3)::operator - (other);
|
|
}
|
|
|
|
////////////////////////////////////////////////////////////////////
|
|
// Function: LPoint3::point - point
|
|
// Access: Public
|
|
// Description:
|
|
////////////////////////////////////////////////////////////////////
|
|
INLINE_LINMATH FLOATNAME(LVector3) FLOATNAME(LPoint3)::
|
|
operator - (const FLOATNAME(LPoint3) &other) const {
|
|
return FLOATNAME(LVecBase3)::operator - (other);
|
|
}
|
|
|
|
////////////////////////////////////////////////////////////////////
|
|
// Function: LPoint3::point - vector
|
|
// Access: Public
|
|
// Description:
|
|
////////////////////////////////////////////////////////////////////
|
|
INLINE_LINMATH FLOATNAME(LPoint3) FLOATNAME(LPoint3)::
|
|
operator - (const FLOATNAME(LVector3) &other) const {
|
|
return FLOATNAME(LVecBase3)::operator - (other);
|
|
}
|
|
|
|
////////////////////////////////////////////////////////////////////
|
|
// Function: LPoint3::cross
|
|
// Access: Public
|
|
// Description:
|
|
////////////////////////////////////////////////////////////////////
|
|
INLINE_LINMATH FLOATNAME(LPoint3) FLOATNAME(LPoint3)::
|
|
cross(const FLOATNAME(LVecBase3) &other) const {
|
|
return FLOATNAME(LVecBase3)::cross(other);
|
|
}
|
|
|
|
////////////////////////////////////////////////////////////////////
|
|
// Function: LPoint3::operator * scalar
|
|
// Access: Public
|
|
// Description:
|
|
////////////////////////////////////////////////////////////////////
|
|
INLINE_LINMATH FLOATNAME(LPoint3) FLOATNAME(LPoint3)::
|
|
operator * (FLOATTYPE scalar) const {
|
|
return FLOATNAME(LPoint3)(FLOATNAME(LVecBase3)::operator * (scalar));
|
|
}
|
|
|
|
////////////////////////////////////////////////////////////////////
|
|
// Function: LPoint3::operator / scalar
|
|
// Access: Public
|
|
// Description:
|
|
////////////////////////////////////////////////////////////////////
|
|
INLINE_LINMATH FLOATNAME(LPoint3) FLOATNAME(LPoint3)::
|
|
operator / (FLOATTYPE scalar) const {
|
|
return FLOATNAME(LPoint3)(FLOATNAME(LVecBase3)::operator / (scalar));
|
|
}
|
|
|
|
////////////////////////////////////////////////////////////////////
|
|
// Function: LPoint3::origin
|
|
// Access: Public, Static
|
|
// Description: Returns the origin of the indicated coordinate
|
|
// system. This is always 0, 0, 0 with all of our
|
|
// existing coordinate systems; it's hard to imagine it
|
|
// ever being different.
|
|
////////////////////////////////////////////////////////////////////
|
|
INLINE_LINMATH FLOATNAME(LPoint3) FLOATNAME(LPoint3)::
|
|
origin(CoordinateSystem) {
|
|
return FLOATNAME(LPoint3)(0.0, 0.0, 0.0);
|
|
}
|
|
|
|
////////////////////////////////////////////////////////////////////
|
|
// Function: LPoint3::rfu
|
|
// Access: Public, Static
|
|
// Description: Returns a point described by right, forward, up
|
|
// displacements from the origin, wherever that maps to
|
|
// in the given coordinate system.
|
|
////////////////////////////////////////////////////////////////////
|
|
INLINE_LINMATH FLOATNAME(LPoint3) FLOATNAME(LPoint3)::
|
|
rfu(FLOATTYPE right_v, FLOATTYPE fwd_v, FLOATTYPE up_v,
|
|
CoordinateSystem cs) {
|
|
return origin(cs) +
|
|
FLOATNAME(LVector3)::rfu(right_v, fwd_v, up_v, cs);
|
|
}
|
|
|