Bullet Collision Detection & Physics Library
|
btVector3 can be used to represent 3D points and vectors. More...
#include <btVector3.h>
Public Member Functions | |
BT_DECLARE_ALIGNED_ALLOCATOR () | |
btVector3 () | |
No initialization constructor. More... | |
btVector3 (const btScalar &_x, const btScalar &_y, const btScalar &_z) | |
Constructor from scalars. More... | |
btVector3 & | operator+= (const btVector3 &v) |
Add a vector to this one. More... | |
btVector3 & | operator-= (const btVector3 &v) |
Subtract a vector from this one. More... | |
btVector3 & | operator*= (const btScalar &s) |
Scale the vector. More... | |
btVector3 & | operator/= (const btScalar &s) |
Inversely scale the vector. More... | |
btScalar | dot (const btVector3 &v) const |
Return the dot product. More... | |
btScalar | length2 () const |
Return the length of the vector squared. More... | |
btScalar | length () const |
Return the length of the vector. More... | |
btScalar | norm () const |
Return the norm (length) of the vector. More... | |
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. More... | |
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. More... | |
btVector3 & | safeNormalize () |
btVector3 & | normalize () |
Normalize this vector x^2 + y^2 + z^2 = 1. More... | |
btVector3 | normalized () const |
Return a normalized version of this vector. More... | |
btVector3 | rotate (const btVector3 &wAxis, const btScalar angle) const |
Return a rotated version of this vector. More... | |
btScalar | angle (const btVector3 &v) const |
Return the angle between this and another vector. More... | |
btVector3 | absolute () const |
Return a vector will the absolute values of each element. More... | |
btVector3 | cross (const btVector3 &v) const |
Return the cross product between this and another vector. More... | |
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. More... | |
int | maxAxis () const |
Return the axis with the largest value Note return values are 0,1,2 for x, y, or z. More... | |
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. More... | |
btVector3 & | operator*= (const btVector3 &v) |
Elementwise multiply this vector by the other. More... | |
const btScalar & | getX () const |
Return the x value. More... | |
const btScalar & | getY () const |
Return the y value. More... | |
const btScalar & | getZ () const |
Return the z value. More... | |
void | setX (btScalar _x) |
Set the x value. More... | |
void | setY (btScalar _y) |
Set the y value. More... | |
void | setZ (btScalar _z) |
Set the z value. More... | |
void | setW (btScalar _w) |
Set the w value. More... | |
const btScalar & | x () const |
Return the x value. More... | |
const btScalar & | y () const |
Return the y value. More... | |
const btScalar & | z () const |
Return the z value. More... | |
const btScalar & | w () const |
Return the w value. More... | |
operator btScalar * () | |
operator btScalar*() replaces operator[], using implicit conversion. We added operator != and operator == to avoid pointer comparisons. More... | |
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. More... | |
void | setMin (const btVector3 &other) |
Set each element to the min of the current values and the values of another btVector3. More... | |
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 btVector3Data &dataOut) const |
void | deSerialize (const struct btVector3Data &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) |
long | maxDot (const btVector3 *array, long array_count, btScalar &dotOut) const |
returns index of maximum dot product between this and vectors in array[] More... | |
long | minDot (const btVector3 *array, long array_count, btScalar &dotOut) const |
returns index of minimum dot product between this and vectors in array[] More... | |
btVector3 | dot3 (const btVector3 &v0, const btVector3 &v1, const btVector3 &v2) const |
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 83 of file btVector3.h.
|
inline |
No initialization constructor.
Definition at line 119 of file btVector3.h.
Constructor from scalars.
x | X value |
y | Y value |
z | Z value |
Definition at line 131 of file btVector3.h.
|
inline |
Return a vector will the absolute values of each element.
Definition at line 360 of file btVector3.h.
Return the angle between this and another vector.
v | The other vector |
Definition at line 352 of file btVector3.h.
btVector3::BT_DECLARE_ALIGNED_ALLOCATOR | ( | ) |
|
inline |
Definition at line 485 of file btVector3.h.
Return the cross product between this and another vector.
v | The other vector |
Definition at line 377 of file btVector3.h.
|
inline |
Definition at line 1346 of file btVector3.h.
|
inline |
Definition at line 1332 of file btVector3.h.
|
inline |
Definition at line 1318 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 946 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 941 of file btVector3.h.
Return the dot product.
v | The other vector in the dot product |
Definition at line 235 of file btVector3.h.
|
inline |
Definition at line 718 of file btVector3.h.
|
inline |
Definition at line 480 of file btVector3.h.
|
inline |
Definition at line 688 of file btVector3.h.
|
inline |
Definition at line 648 of file btVector3.h.
|
inline |
Return the x value.
Definition at line 561 of file btVector3.h.
|
inline |
Return the y value.
Definition at line 563 of file btVector3.h.
|
inline |
Return the z value.
Definition at line 565 of file btVector3.h.
|
inline |
Definition at line 683 of file btVector3.h.
|
inline |
Return the length of the vector.
Definition at line 263 of file btVector3.h.
|
inline |
Return the length of the vector squared.
Definition at line 257 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 520 of file btVector3.h.
|
inline |
Return the axis with the largest value Note return values are 0,1,2 for x, y, or z.
Definition at line 475 of file btVector3.h.
|
inline |
returns index of maximum dot product between this and vectors in array[]
array | The other vectors |
array_count | The number of other vectors |
dotOut | The maximum dot product |
Definition at line 1000 of file btVector3.h.
|
inline |
Return the axis with the smallest value Note return values are 0,1,2 for x, y, or z.
Definition at line 468 of file btVector3.h.
|
inline |
returns index of minimum dot product between this and vectors in array[]
array | The other vectors |
array_count | The number of other vectors |
dotOut | The minimum dot product |
Definition at line 1035 of file btVector3.h.
|
inline |
Return the norm (length) of the vector.
Definition at line 269 of file btVector3.h.
|
inline |
Normalize this vector x^2 + y^2 + z^2 = 1.
Definition at line 297 of file btVector3.h.
|
inline |
Return a normalized version of this vector.
Definition at line 951 of file btVector3.h.
|
inline |
operator btScalar*() replaces operator[], using implicit conversion. We added operator != and operator == to avoid pointer comparisons.
Definition at line 586 of file btVector3.h.
|
inline |
Definition at line 587 of file btVector3.h.
|
inline |
Definition at line 601 of file btVector3.h.
Elementwise multiply this vector by the other.
v | The other vector |
Definition at line 546 of file btVector3.h.
Add a vector to this one.
The | vector to add to this one |
Definition at line 164 of file btVector3.h.
Subtract a vector from this one.
The | vector to subtract |
Definition at line 181 of file btVector3.h.
Inversely scale the vector.
s | Scale factor to divide by |
Definition at line 215 of file btVector3.h.
|
inline |
Definition at line 589 of file btVector3.h.
Return a rotated version of this vector.
wAxis | The axis to rotate about |
angle | The angle to rotate by |
Definition at line 958 of file btVector3.h.
|
inline |
Definition at line 282 of file btVector3.h.
|
inline |
could also do a memcpy, check if it is worth it
Definition at line 1339 of file btVector3.h.
|
inline |
could also do a memcpy, check if it is worth it
Definition at line 1325 of file btVector3.h.
|
inline |
could also do a memcpy, check if it is worth it
Definition at line 1311 of file btVector3.h.
Definition at line 491 of file btVector3.h.
|
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 609 of file btVector3.h.
|
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 626 of file btVector3.h.
Definition at line 640 of file btVector3.h.
|
inline |
Set the w value.
Definition at line 573 of file btVector3.h.
|
inline |
Set the x value.
Definition at line 567 of file btVector3.h.
|
inline |
Set the y value.
Definition at line 569 of file btVector3.h.
|
inline |
Set the z value.
Definition at line 571 of file btVector3.h.
|
inline |
Definition at line 671 of file btVector3.h.
Definition at line 416 of file btVector3.h.
|
inline |
Return the w value.
Definition at line 581 of file btVector3.h.
|
inline |
Return the x value.
Definition at line 575 of file btVector3.h.
|
inline |
Return the y value.
Definition at line 577 of file btVector3.h.
|
inline |
Return the z value.
Definition at line 579 of file btVector3.h.
btScalar btVector3::m_floats[4] |
Definition at line 112 of file btVector3.h.