1 #ifndef BT_GIMPACT_QUANTIZATION_H_INCLUDED
2 #define BT_GIMPACT_QUANTIZATION_H_INCLUDED
43 btVector3 clampValue(quantizationMargin,quantizationMargin,quantizationMargin);
44 outMinBound = srcMinBound - clampValue;
45 outMaxBound = srcMaxBound + clampValue;
46 btVector3 aabbSize = outMaxBound - outMinBound;
62 clampedPoint.
setMax(min_bound);
63 clampedPoint.
setMin(max_bound);
65 btVector3 v = (clampedPoint - min_bound) * bvhQuantization;
66 out[0] = (
unsigned short)(v.
getX()+0.5f);
67 out[1] = (
unsigned short)(v.
getY()+0.5f);
68 out[2] = (
unsigned short)(v.
getZ()+0.5f);
73 const unsigned short* vecIn,
88 #endif // BT_GIMPACT_QUANTIZATION_H_INCLUDED
void setValue(const btScalar &_x, const btScalar &_y, const btScalar &_z)
#define SIMD_FORCE_INLINE
btVector3 bt_unquantize(const unsigned short *vecIn, const btVector3 &offset, const btVector3 &bvhQuantization)
const btScalar & getZ() const
Return the z value.
void bt_quantize_clamp(unsigned short *out, const btVector3 &point, const btVector3 &min_bound, const btVector3 &max_bound, const btVector3 &bvhQuantization)
const btScalar & getY() const
Return the y value.
const btScalar & getX() const
Return the x value.
btVector3 can be used to represent 3D points and vectors.
void bt_calc_quantization_parameters(btVector3 &outMinBound, btVector3 &outMaxBound, btVector3 &bvhQuantization, const btVector3 &srcMinBound, const btVector3 &srcMaxBound, btScalar quantizationMargin)
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.
float btScalar
The btScalar type abstracts floating point numbers, to easily switch between double and single floati...