120 SbVec3d() { vec[0] = 0.; vec[1] = 0.; vec[2] = 0.; }
124 { vec[0] = v[0]; vec[1] = v[1]; vec[2] = v[2]; }
128 { vec[0] = x; vec[1] = y; vec[2] = z; }
143 void getValue(
double &x,
double &y,
double &z)
const;
156 { vec[0] = v[0]; vec[1] = v[1]; vec[2] = v[2];
return *
this; }
160 { vec[0] = x; vec[1] = y; vec[2] = z;
return *
this; }
168 double & operator [](
int i) {
return (vec[i]); }
169 const double & operator [](
int i)
const {
return (vec[i]); }
176 {
return *
this *= (1.0 / d); }
216{
return v * (1.0 / d); }
223{
return !(v1 == v2); }
252 SbVec2d(
double x,
double y) { setValue(x, y); }
279 double & operator [](
int i) {
return (vec[i]); }
280 const double & operator [](
int i)
const {
return (vec[i]); }
287 {
return *
this *= (1.0 / d); }
323{
return v * (1.0 / d); }
330{
return !(v1 == v2); }
353 SbVec4d() { vec[0] = 0.; vec[1] = 0.; vec[2] = 0.; vec[3] = 0.; }
359 SbVec4d(
double x,
double y,
double z,
double w) { setValue(x, y, z, w); }
374 void getValue(
double &x,
double &y,
double &z,
double &w)
const;
392 double & operator [](
int i) {
return (vec[i]); }
393 const double & operator [](
int i)
const {
return (vec[i]); }
400 {
return *
this *= (1.0 / d); }
436{
return v * (1.0 / d); }
443{
return !(v1 == v2); }
473 quat[0] = 0.; quat[1] = 0.; quat[2] = 0.; quat[3] = 1.;
482 { setValue(q0, q1, q2, q3); }
490 { setValue(axis, radians); }
502 { setValue(rotateFrom, rotateTo); }
510 double &q2,
double &q3)
const;
524 double getAngle()
const {
SbVec3d axis;
double radians; getValue(axis, radians);
return radians; }
594{
return !(q1 == q2); }
625 SbMatrixd(
double a11,
double a12,
double a13,
double a14,
626 double a21,
double a22,
double a23,
double a24,
627 double a31,
double a32,
double a33,
double a34,
628 double a41,
double a42,
double a43,
double a44);
673 { setTransform(t, r, s,
677 { setTransform(t, r, s, so,
SbVec3d(0,0,0)); }
693 { getTransform(t, r, s, so,
SbVec3d(0,0,0)); }
704 double det3(
int r1,
int r2,
int r3,
int c1,
int c2,
int c3)
const;
707 double det3()
const {
return det3(0, 1, 2, 0, 1, 2); }
788 operator double *() {
return &matrix[0][0]; }
794 double * operator [](
int i) {
return &matrix[i][0]; }
795 const double * operator [](
int i)
const {
return &matrix[i][0]; }
823 void jacobi3(
double evalues[3],
SbVec3d evectors[3],
int &rots)
const;
833{
return !(m1 == m2); }
976{
return !(p1 == p2); }
1024 static bool unitCylinderIntersect(
const SbLined &l,
INVENTOR_API bool operator!=(const SbBox3f &b1, const SbBox3f &b2)
INVENTOR_API bool operator==(const SbBox3f &b1, const SbBox3f &b2)
INVENTOR_API SbVec3f operator-(const SbVec3f &v1, const SbVec3f &v2)
INVENTOR_API SbVec3f operator/(const SbVec3f &v, float d)
INVENTOR_API SbVec3f operator*(const SbVec3f &v, float d)
INVENTOR_API SbVec3f operator+(const SbVec3f &v1, const SbVec3f &v2)
INVENTOR_API SbVec3d operator/(const SbVec3d &v, double d)
INVENTOR_API bool operator!=(const SbVec3d &v1, const SbVec3d &v2)
INVENTOR_API SbVec3d operator-(const SbVec3d &v1, const SbVec3d &v2)
INVENTOR_API bool operator==(const SbVec3d &v1, const SbVec3d &v2)
INVENTOR_API SbVec3d operator*(const SbVec3d &v, double d)
INVENTOR_API SbVec3d operator+(const SbVec3d &v1, const SbVec3d &v2)
#define INVENTOR_API
Disable some annoying warnings on MSVC 6.
Class for representing a cylinder with double values.
void setRadius(double r)
Set just the axis or radius.
double getRadius() const
Return the axis and radius.
bool intersect(const SbLined &l, SbVec3d &intersection) const
Intersect line and cylinder, returning TRUE if there is an intersection.
SbCylinderd()
Constructors. One takes an axis and radius.
SbCylinderd(const SbLined &a, double r)
Constructors. One takes an axis and radius.
void setAxis(const SbLined &a)
Set just the axis or radius.
bool intersect(const SbLined &l, SbVec3d &enter, SbVec3d &exit) const
const SbLined & getAxis() const
Return the axis and radius.
void setValue(const SbLined &a, double r)
Change the axis and radius.
Directed line in 3D with double values.
bool intersect(double angle, const SbBox3d &box) const
bool intersect(double angle, const SbVec3d &point) const
SbVec3d getClosestPoint(const SbVec3d &point) const
Returns the closest point on the line to the given point.
SbLined(const SbVec3d &p0, const SbVec3d &p1)
Constructors.
bool getClosestPoints(const SbLined &line2, SbVec3d &ptOnThis, SbVec3d &ptOnLine2) const
Finds the two closest points between this line and line2, and loads them into ptOnThis and ptOnLine2.
bool intersect(double angle, const SbVec3d &v0, const SbVec3d &v1, SbVec3d &pt) const
void setValue(const SbVec3d &p0, const SbVec3d &p1)
Sets line to pass through points p0 and p1.
const SbVec3d & getDirection() const
Returns position of line origin point and direction vector of line.
const SbVec3d & getPosition() const
Returns position of line origin point and direction vector of line.
bool intersect(const SbBox3d &box, SbVec3d &enter, SbVec3d &exit) const
Intersect the line with a box, point, line, and triangle.
bool intersect(const SbVec3d &v0, const SbVec3d &v1, const SbVec3d &v2, SbVec3d &pt, SbVec3d &barycentric, bool &front) const
4x4 matrix class with double values.
void multDirMatrix(const SbVec3d &src, SbVec3d &dst) const
Multiplies given row vector by matrix, giving vector result.
void LUBackSubstitution(int index[4], double b[4]) const
Perform back-substitution on LU-decomposed matrix.
SbMatrixd(const SbMatd &m)
Constructors.
SbVec3d transformDirection(const SbVec3d &src) const
Multiplies given row vector by matrix, giving vector result.
void getTransform(SbVec3d &translation, SbRotationd &rotation, SbVec3d &scaleFactor, SbRotationd &scaleOrientation, const SbVec3d ¢er) const
Decomposes the matrix into a translation, rotation, scale, and scale orientation.
SbMatrixd & multLeft(const SbMatrixd &m)
Multiplies matrix by given matrix on right or left.
SbMatrixd transpose() const
Returns transpose of matrix.
double det3() const
Returns determinant of upper-left 3x3 submatrix.
void setTransform(const SbVec3d &translation, const SbRotationd &rotation, const SbVec3d &scaleFactor, const SbRotationd &scaleOrientation, const SbVec3d ¢er)
Composes the matrix based on a translation, rotation, scale, orientation for scale,...
void getValue(SbMatd &m) const
The following methods return matrix values and other info:
void multVecMatrix(const SbVec4d &src, SbVec4d &dst) const
Multiplies given row vector by matrix, giving vector result. Takes homogenous coordinate and returns ...
void setValue(const double *data)
Sets value from a double array of 16 elements.
void setRotate(const SbRotationd &q)
Sets matrix to rotate by given rotation.
void multVecMatrix(const SbVec3d &src, SbVec3d &dst) const
Multiplies given row vector by matrix, giving vector result. Use this method to transform points from...
const SbMatd & getValue() const
void makeIdentity()
Sets matrix to be identity.
void setScale(const SbVec3d &s)
Sets matrix to scale by given vector.
void setTransform(const SbVec3d &t, const SbRotationd &r, const SbVec3d &s)
Overloaded methods as a kludge because the compiler won't let us have SbVec3d(0,0,...
void multVecMatrix(const SbVec3d &src, SbVec4d &dst) const
Multiplies given row vector by matrix, giving vector result. Takes SbVec4(src,1.) coordinate and retu...
static SbMatrixd identity()
Returns an identity matrix.
SbMatrixd()
Default constructor, initialized to identity.
void setValue(const SbMatd &m)
Sets value from 4x4 array of elements.
bool factor(SbMatrixd &r, SbVec3d &s, SbMatrixd &u, SbVec3d &t, SbMatrixd &proj) const
Factors a matrix m into 5 pieces: m = r s r^ u t, where r^ means transpose of r, and r and u are rota...
void multLineMatrix(const SbLined &src, SbLined &dst) const
Multiplies the given line's origin by the matrix, and the line's direction by the rotation portion of...
void print(FILE *fp) const
Prints a formatted version of the matrix to the given file pointer.
bool LUDecomposition(int index[4], double &d)
Perform in-place LU decomposition of matrix.
void setScale(double s)
Sets matrix to scale by given uniform factor.
SbMatrixd(double a11, double a12, double a13, double a14, double a21, double a22, double a23, double a24, double a31, double a32, double a33, double a34, double a41, double a42, double a43, double a44)
Constructor given all 16 elements in row-major order.
double det3(int r1, int r2, int r3, int c1, int c2, int c3) const
Returns determinant of 3x3 submatrix composed of given row and column indices (0-3 for each).
SbMatrixd inverse() const
Returns inverse of matrix.
double det4() const
Returns determinant of entire matrix.
SbVec4d transformPoint(const SbVec4d &src) const
Multiplies given row vector by matrix, giving vector result. Takes homogenous coordinate and returns ...
void getTransform(SbVec3d &t, SbRotationd &r, SbVec3d &s, SbRotationd &so) const
SbLined transformLine(const SbLined &src) const
Multiplies the given line's origin by the matrix, and the line's direction by the rotation portion of...
bool equals(const SbMatrixd &m, double tolerance) const
Equality comparison within given tolerance, for each component.
void setTranslate(const SbVec3d &t)
Sets matrix to translate by given vector.
void setTransform(const SbVec3d &t, const SbRotationd &r, const SbVec3d &s, const SbRotationd &so)
SbVec3d transformPoint(const SbVec3d &src) const
Multiplies given row vector by matrix, giving vector result. Use this method to transform points from...
SbMatrixd & multRight(const SbMatrixd &m)
Multiplies matrix by given matrix on right or left.
void multMatrixVec(const SbVec3d &src, SbVec3d &dst) const
Multiplies matrix by given column vector, giving vector result.
Oriented plane in 3D with double values.
const SbVec3d & getNormal() const
Returns normal vector to plane.
bool intersect(const SbLined &l, SbVec3d &intersection) const
Intersect line and plane, returning TRUE if there is an intersection, FALSE if line is parallel to pl...
SbPlaned()
Default constructor.
void transform(const SbMatrixd &matrix)
Transforms the plane by the given matrix.
void offset(double d)
Offset a plane by a given distance.
SbPlaned(const SbVec3d &p0, const SbVec3d &p1, const SbVec3d &p2)
Construct a plane given three points.
SbPlaned(const SbVec3d &n, double d)
Construct a plane given normal and distance from origin along normal.
bool isInHalfSpace(const SbVec3d &point) const
Returns TRUE if the given point is within the half-space defined by the plane.
SbPlaned(const SbVec3d &n, const SbVec3d &p)
Construct a plane given normal and a point to pass through Orientation is given by the normal vector ...
double getDistanceFromOrigin() const
Returns distance from origin to plane.
double getDistance(const SbVec3d &point) const
Returns the distance of the point to the plane.
Class for representing a rotation with double values.
SbVec3d transformPoint(const SbVec3d &src) const
Multiplies the given vector by the matrix of this rotation.
SbRotationd(const SbVec3d &axis, double radians)
SbRotationd()
Default constructor, initialized to identity.
bool equals(const SbRotationd &r, double tolerance) const
Equality comparison within given tolerance em the square of the length of the maximum distance betwee...
void multVec(const SbVec3d &src, SbVec3d &dst) const
Multiplies the given vector by the matrix of this rotation.
static SbRotationd slerp(const SbRotationd &rot0, const SbRotationd &rot1, double t)
Spherical linear interpolation: as t goes from 0 to 1, returned value goes from rot0 to rot1.
SbRotationd(double q0, double q1, double q2, double q3)
SbRotationd & setValue(const SbVec3d &rotateFrom, const SbVec3d &rotateTo)
Sets rotation to rotate one direction vector to another.
SbRotationd(const SbVec3d &rotateFrom, const SbVec3d &rotateTo)
Constructors for rotation.
void scaleAngle(double scaleFactor)
Keep the axis the same.
SbRotationd(const double v[4])
SbRotationd & setValue(const SbVec3d &axis, double radians)
Sets value of vector from 3D rotation axis vector and angle in radians.
SbMatrixd getMatrix() const
Returns corresponding 4x4 rotation matrix.
SbRotationd & setValue(const SbMatrixd &m)
Sets value of rotation from a rotation matrix.
SbRotationd & setValue(double q0, double q1, double q2, double q3)
Sets value of rotation from 4 individual components of a quaternion.
SbRotationd(const SbMatrixd &m)
void getValue(double &q0, double &q1, double &q2, double &q3) const
Returns 4 individual components of rotation quaternion.
static SbRotationd identity()
Returns a null rotation.
SbVec3d getAxis() const
Returns corresponding 3D rotation axis vector.
void getValue(SbMatrixd &matrix) const
Returns corresponding 4x4 rotation matrix.
void getValue(SbVec3d &axis, double &radians) const
Returns corresponding 3D rotation axis vector and angle in radians.
SbRotationd inverse() const
Returns the inverse of a rotation.
double getAngle() const
Returns corresponding angle in radians.
SbRotationd & invert()
Changes a rotation to be its inverse.
const double * getValue() const
Returns pointer to array of 4 components defining quaternion.
SbRotationd & setValue(const double q[4])
Sets value of rotation from array of 4 components of a quaternion.
Class for representing a sphere with double values.
bool intersect(const SbLined &l, SbVec3d &enter, SbVec3d &exit) const
void circumscribe(const SbBox3d &box)
Return a sphere containing a given box.
void setValue(const SbVec3d &c, double r)
Change the center and radius.
void setRadius(double r)
Set just the center or radius.
SbSphered(const SbVec3d &c, double r)
Construct a sphere given center and radius.
const SbVec3d & getCenter() const
Return the center and radius.
double getRadius() const
Return the center and radius.
bool intersect(const SbLined &l, SbVec3d &intersection) const
Intersect line and sphere, returning TRUE if there is an intersection.
void setCenter(const SbVec3d &c)
Set just the center or radius.
2D vector class with double members.
double dot(const SbVec2d &v) const
Returns dot (inner) product of vector and another vector.
double length() const
Returns geometric length of vector.
SbVec2d & setValue(const double v[2])
Sets the vector components.
SbVec2d(double x, double y)
Constructor given vector components.
double normalize()
Changes vector to be unit length.
void negate()
Negates each component of vector in place.
SbVec2d(const double v[2])
Constructor given vector components.
bool equals(const SbVec2d v, double tolerance) const
Equality comparison within given tolerance em the square of the length of the maximum distance betwee...
const double * getValue() const
Returns vector components.
SbVec2d()
Default constructor.
SbVec2d & setValue(double x, double y)
Sets the vector components.
void getValue(double &x, double &y) const
Returns vector components.
3D vector class with double values.
double dot(const SbVec3d &v) const
Returns dot (inner) product of vector and another vector.
SbVec3d & setValue(const double v[3])
Sets the vector components.
SbVec3d(double x, double y, double z)
Constructor given vector components.
double length() const
Returns geometric length of vector.
bool equals(const SbVec3d v, double tolerance) const
Equality comparison within given tolerance em the square of the length of the maximum distance betwee...
SbVec3d(const double v[3])
Constructor given vector components.
SbVec3d cross(const SbVec3d &v) const
Returns right-handed cross product of vector and another vector.
SbVec3d getClosestAxis() const
Returns principal axis that is closest (based on maximum dot product) to this vector.
void negate()
Negates each component of vector in place.
void getValue(double &x, double &y, double &z) const
Returns vector components.
SbVec3d(SbPlaned &p0, SbPlaned &p1, SbPlaned &p2)
Constructor given 3 planes.
const double * getValue() const
Returns vector components.
SbVec3d()
Default constructor.
double normalize()
Changes vector to be unit length, returning the length before normalization.
SbVec3d & setValue(double x, double y, double z)
Sets the vector components.
SbVec3d & setValue(const SbVec3d &barycentic, const SbVec3d &v0, const SbVec3d &v1, const SbVec3d &v2)
Sets value of vector to be convex combination of 3 other vectors, using barycentic coordinates.
4D vector class with double values.
bool equals(const SbVec4d v, double tolerance) const
Equality comparison within given tolerance em the square of the length of the maximum distance betwee...
void getValue(double &x, double &y, double &z, double &w) const
Returns vector components.
SbVec4d(double x, double y, double z, double w)
Constructor given vector components.
void getReal(SbVec3d &v) const
Returns the real portion of the vector by dividing by the fourth value.
SbVec4d & setValue(const double v[4])
Sets the vector components.
double length() const
Returns geometric length of vector.
SbVec4d(const double v[4])
Constructor given vector components.
void negate()
Negates each component of vector in place.
double normalize()
Changes vector to be unit length.
double dot(const SbVec4d &v) const
Returns dot (inner) product of vector and another vector.
const double * getValue() const
Returns vector components.
SbVec4d & setValue(double x, double y, double z, double w)
Sets the vector components.
SbVec3d getReal() const
Returns the real portion of the vector by dividing by the fourth value.
SbVec4d()
Default constructor.