btVector3 can be used to represent 3D points and vectors. More...
#include <btVector3.h>

Public Member Functions | |
| btVector3 () | |
| No initialization constructor. | |
| btVector3 (const btScalar &x, const btScalar &y, const btScalar &z) | |
| Constructor from scalars. | |
| btVector3 & | operator+= (const btVector3 &v) |
| Add a vector to this one. | |
| btVector3 & | operator-= (const btVector3 &v) |
| Subtract a vector from this one. | |
| btVector3 & | operator*= (const btScalar &s) |
| Scale the vector. | |
| btVector3 & | operator/= (const btScalar &s) |
| Inversely scale the vector. | |
| btScalar | dot (const btVector3 &v) const |
| Return the dot product. | |
| btScalar | length2 () const |
| Return the length of the vector squared. | |
| btScalar | length () const |
| Return the length of the vector. | |
| btScalar | distance2 (const btVector3 &v) const |
| Return the distance squared between the ends of this and another vector This is symantically treating the vector like a point. | |
| btScalar | distance (const btVector3 &v) const |
| Return the distance between the ends of this and another vector This is symantically treating the vector like a point. | |
| btVector3 & | normalize () |
| Normalize this vector x^2 + y^2 + z^2 = 1. | |
| btVector3 | normalized () const |
| Return a normalized version of this vector. | |
| btVector3 | rotate (const btVector3 &wAxis, const btScalar angle) |
| Rotate this vector. | |
| btScalar | angle (const btVector3 &v) const |
| Return the angle between this and another vector. | |
| btVector3 | absolute () const |
| Return a vector will the absolute values of each element. | |
| btVector3 | cross (const btVector3 &v) const |
| Return the cross product between this and another vector. | |
| btScalar | triple (const btVector3 &v1, const btVector3 &v2) const |
| int | minAxis () const |
| Return the axis with the smallest value Note return values are 0,1,2 for x, y, or z. | |
| int | maxAxis () const |
| Return the axis with the largest value Note return values are 0,1,2 for x, y, or z. | |
| int | furthestAxis () const |
| int | closestAxis () const |
| void | setInterpolate3 (const btVector3 &v0, const btVector3 &v1, btScalar rt) |
| btVector3 | lerp (const btVector3 &v, const btScalar &t) const |
| Return the linear interpolation between this and another vector. | |
| btVector3 & | operator*= (const btVector3 &v) |
| Elementwise multiply this vector by the other. | |
| const btScalar & | getX () const |
| Return the x value. | |
| const btScalar & | getY () const |
| Return the y value. | |
| const btScalar & | getZ () const |
| Return the z value. | |
| void | setX (btScalar x) |
| Set the x value. | |
| void | setY (btScalar y) |
| Set the y value. | |
| void | setZ (btScalar z) |
| Set the z value. | |
| void | setW (btScalar w) |
| Set the w value. | |
| const btScalar & | x () const |
| Return the x value. | |
| const btScalar & | y () const |
| Return the y value. | |
| const btScalar & | z () const |
| Return the z value. | |
| const btScalar & | w () const |
| Return the w value. | |
| operator btScalar * () | |
| operator btScalar*() replaces operator[], using implicit conversion. We added operator != and operator == to avoid pointer comparisons. | |
| operator const btScalar * () const | |
| bool | operator== (const btVector3 &other) const |
| bool | operator!= (const btVector3 &other) const |
| void | setMax (const btVector3 &other) |
| Set each element to the max of the current values and the values of another btVector3. | |
| void | setMin (const btVector3 &other) |
| Set each element to the min of the current values and the values of another btVector3. | |
| void | setValue (const btScalar &x, const btScalar &y, const btScalar &z) |
| void | getSkewSymmetricMatrix (btVector3 *v0, btVector3 *v1, btVector3 *v2) const |
| void | setZero () |
| bool | isZero () const |
| bool | fuzzyZero () const |
| void | serialize (struct btVector3FloatData &dataOut) const |
| void | deSerialize (const struct btVector3FloatData &dataIn) |
| void | serializeFloat (struct btVector3FloatData &dataOut) const |
| void | deSerializeFloat (const struct btVector3FloatData &dataIn) |
| void | serializeDouble (struct btVector3DoubleData &dataOut) const |
| void | deSerializeDouble (const struct btVector3DoubleData &dataIn) |
Public Attributes | |
| btScalar | m_floats [4] |
btVector3 can be used to represent 3D points and vectors.
It has an un-used w component to suit 16-byte alignment when btVector3 is stored in containers. This extra component can be used by derived classes (Quaternion?) or by user Ideally, this class should be replaced by a platform optimized SIMD version that keeps the data in registers
Definition at line 39 of file btVector3.h.
| btVector3::btVector3 | ( | ) | [inline] |
No initialization constructor.
Definition at line 73 of file btVector3.h.
Constructor from scalars.
| x | X value | |
| y | Y value | |
| z | Z value |
Definition at line 82 of file btVector3.h.
| btVector3 btVector3::absolute | ( | ) | const [inline] |
Return a vector will the absolute values of each element.
Definition at line 175 of file btVector3.h.
Return the angle between this and another vector.
| v | The other vector |
Definition at line 168 of file btVector3.h.
| int btVector3::closestAxis | ( | ) | const [inline] |
Definition at line 218 of file btVector3.h.
Return the cross product between this and another vector.
| v | The other vector |
Definition at line 184 of file btVector3.h.
| void btVector3::deSerialize | ( | const struct btVector3FloatData & | dataIn | ) | [inline] |
Definition at line 737 of file btVector3.h.
| void btVector3::deSerializeDouble | ( | const struct btVector3DoubleData & | dataIn | ) | [inline] |
Definition at line 723 of file btVector3.h.
| void btVector3::deSerializeFloat | ( | const struct btVector3FloatData & | dataIn | ) | [inline] |
Definition at line 709 of file btVector3.h.
Return the distance between the ends of this and another vector This is symantically treating the vector like a point.
Definition at line 471 of file btVector3.h.
Return the distance squared between the ends of this and another vector This is symantically treating the vector like a point.
Definition at line 466 of file btVector3.h.
Return the dot product.
| v | The other vector in the dot product |
Definition at line 126 of file btVector3.h.
| int btVector3::furthestAxis | ( | ) | const [inline] |
Definition at line 213 of file btVector3.h.
| bool btVector3::fuzzyZero | ( | ) | const [inline] |
Definition at line 336 of file btVector3.h.
| void btVector3::getSkewSymmetricMatrix | ( | btVector3 * | v0, | |
| btVector3 * | v1, | |||
| btVector3 * | v2 | |||
| ) | const [inline] |
Definition at line 319 of file btVector3.h.
| const btScalar& btVector3::getX | ( | ) | const [inline] |
Return the x value.
Definition at line 252 of file btVector3.h.
| const btScalar& btVector3::getY | ( | ) | const [inline] |
Return the y value.
Definition at line 254 of file btVector3.h.
| const btScalar& btVector3::getZ | ( | ) | const [inline] |
Return the z value.
Definition at line 256 of file btVector3.h.
| bool btVector3::isZero | ( | ) | const [inline] |
Definition at line 331 of file btVector3.h.
| btScalar btVector3::length | ( | ) | const [inline] |
Return the length of the vector.
Definition at line 138 of file btVector3.h.
| btScalar btVector3::length2 | ( | ) | const [inline] |
Return the length of the vector squared.
Definition at line 132 of file btVector3.h.
Return the linear interpolation between this and another vector.
| v | The other vector | |
| t | The ration of this to v (t = 0 => return this, t=1 => return other) |
Definition at line 236 of file btVector3.h.
| int btVector3::maxAxis | ( | ) | const [inline] |
Return the axis with the largest value Note return values are 0,1,2 for x, y, or z.
Definition at line 208 of file btVector3.h.
| int btVector3::minAxis | ( | ) | const [inline] |
Return the axis with the smallest value Note return values are 0,1,2 for x, y, or z.
Definition at line 201 of file btVector3.h.
| btVector3& btVector3::normalize | ( | ) | [inline] |
Normalize this vector x^2 + y^2 + z^2 = 1.
Definition at line 153 of file btVector3.h.
| btVector3 btVector3::normalized | ( | ) | const [inline] |
Return a normalized version of this vector.
Definition at line 476 of file btVector3.h.
| btVector3::operator btScalar * | ( | ) | [inline] |
operator btScalar*() replaces operator[], using implicit conversion. We added operator != and operator == to avoid pointer comparisons.
Definition at line 277 of file btVector3.h.
| btVector3::operator const btScalar * | ( | ) | const [inline] |
Definition at line 278 of file btVector3.h.
| bool btVector3::operator!= | ( | const btVector3 & | other | ) | const [inline] |
Definition at line 285 of file btVector3.h.
Elementwise multiply this vector by the other.
| v | The other vector |
Definition at line 245 of file btVector3.h.
Add a vector to this one.
| The | vector to add to this one |
Definition at line 93 of file btVector3.h.
Subtract a vector from this one.
| The | vector to subtract |
Definition at line 103 of file btVector3.h.
Inversely scale the vector.
| s | Scale factor to divide by |
Definition at line 118 of file btVector3.h.
| bool btVector3::operator== | ( | const btVector3 & | other | ) | const [inline] |
Definition at line 280 of file btVector3.h.
Rotate this vector.
| wAxis | The axis to rotate about | |
| angle | The angle to rotate by |
Definition at line 481 of file btVector3.h.
| void btVector3::serialize | ( | struct btVector3FloatData & | dataOut | ) | const [inline] |
could also do a memcpy, check if it is worth it
Definition at line 730 of file btVector3.h.
| void btVector3::serializeDouble | ( | struct btVector3DoubleData & | dataOut | ) | const [inline] |
could also do a memcpy, check if it is worth it
Definition at line 716 of file btVector3.h.
| void btVector3::serializeFloat | ( | struct btVector3FloatData & | dataOut | ) | const [inline] |
could also do a memcpy, check if it is worth it
Definition at line 702 of file btVector3.h.
| void btVector3::setInterpolate3 | ( | const btVector3 & | v0, | |
| const btVector3 & | v1, | |||
| btScalar | rt | |||
| ) | [inline] |
Definition at line 223 of file btVector3.h.
| void btVector3::setMax | ( | const btVector3 & | other | ) | [inline] |
Set each element to the max of the current values and the values of another btVector3.
| other | The other btVector3 to compare with |
Definition at line 293 of file btVector3.h.
| void btVector3::setMin | ( | const btVector3 & | other | ) | [inline] |
Set each element to the min of the current values and the values of another btVector3.
| other | The other btVector3 to compare with |
Definition at line 303 of file btVector3.h.
Definition at line 311 of file btVector3.h.
| void btVector3::setW | ( | btScalar | w | ) | [inline] |
Set the w value.
Definition at line 264 of file btVector3.h.
| void btVector3::setX | ( | btScalar | x | ) | [inline] |
Set the x value.
Definition at line 258 of file btVector3.h.
| void btVector3::setY | ( | btScalar | y | ) | [inline] |
Set the y value.
Definition at line 260 of file btVector3.h.
| void btVector3::setZ | ( | btScalar | z | ) | [inline] |
Set the z value.
Definition at line 262 of file btVector3.h.
| void btVector3::setZero | ( | ) | [inline] |
Definition at line 326 of file btVector3.h.
Definition at line 192 of file btVector3.h.
| const btScalar& btVector3::w | ( | ) | const [inline] |
Return the w value.
Definition at line 272 of file btVector3.h.
| const btScalar& btVector3::x | ( | ) | const [inline] |
Return the x value.
Definition at line 266 of file btVector3.h.
| const btScalar& btVector3::y | ( | ) | const [inline] |
Return the y value.
Definition at line 268 of file btVector3.h.
| const btScalar& btVector3::z | ( | ) | const [inline] |
Return the z value.
Definition at line 270 of file btVector3.h.
Definition at line 66 of file btVector3.h.
1.6.1