28 return std::isfinite(x);
44 x = x * (1.5f - xhalf * x * x);
48 #define b2Sqrt(x) sqrtf(x) 49 #define b2Atan2(y, x) atan2f(y, x) 109 return x *
x +
y *
y;
120 float32 invLength = 1.0f / length;
163 x += v.
x;
y += v.
y;
z += v.
z;
169 x -= v.
x;
y -= v.
y;
z -= v.
z;
175 x *= s;
y *= s;
z *= s;
197 ex.x = a11; ex.y = a21;
198 ey.x = a12; ey.y = a22;
211 ex.x = 1.0f; ey.x = 0.0f;
212 ex.y = 0.0f; ey.y = 1.0f;
218 ex.x = 0.0f; ey.x = 0.0f;
219 ex.y = 0.0f; ey.y = 0.0f;
231 B.
ex.
x = det *
d; B.
ey.
x = -det *
b;
232 B.
ex.
y = -det * c; B.
ey.
y = det * a;
240 float32 a11 = ex.
x, a12 = ey.x, a21 = ex.y, a22 = ey.y;
247 x.
x = det * (a22 * b.
x - a12 * b.
y);
248 x.
y = det * (a11 * b.
y - a21 * b.
x);
288 void GetInverse22(
b2Mat33* M)
const;
292 void GetSymInverse33(
b2Mat33* M)
const;
407 return a.
x * b.
x + a.
y * b.
y;
413 return a.
x * b.
y - a.
y * b.
x;
463 return a.
x == b.
x && a.
y == b.
y;
480 return b2Vec3(s * a.
x, s * a.
y, s * a.
z);
498 return a.
x * b.
x + a.
y * b.
y + a.
z * b.
z;
529 return v.
x * A.
ex + v.
y * A.
ey + v.
z * A.
ez;
546 qr.
s = q.
s * r.
c + q.
c * r.
s;
547 qr.
c = q.
c * r.
c - q.
s * r.
s;
559 qr.
s = q.
c * r.
s - q.
s * r.
c;
560 qr.
c = q.
c * r.
c + q.
s * r.
s;
614 template <
typename T>
617 return a > T(0) ? a : -a;
630 template <
typename T>
633 return a < b ? a : b;
641 template <
typename T>
644 return a > b ? a : b;
652 template <
typename T>
663 template<
typename T>
inline void b2Swap(T&
a, T&
b)
687 bool result = x > 0 && (x & (x - 1)) == 0;
693 xf->
p = (1.0f - beta) * c0 + beta *
c;
698 xf->
p -=
b2Mul(xf->
q, localCenter);
704 float32 beta = (alpha - alpha0) / (1.0
f - alpha0);
705 c0 += beta * (
c - c0);
706 a0 += beta * (
a - a0);
GLboolean GLboolean GLboolean GLboolean a
GLuint GLsizei GLsizei * length
float32 b2Dot(const b2Vec2 &a, const b2Vec2 &b)
Perform the dot product on two vectors.
GLint GLint GLint GLint GLint GLint y
b2Vec2 b2Mul(const b2Mat22 &A, const b2Vec2 &v)
void Advance(float32 alpha)
void SetIdentity()
Set this to the identity matrix.
b2Mat33(const b2Vec3 &c1, const b2Vec3 &c2, const b2Vec3 &c3)
Construct this matrix using columns.
GLclampf GLclampf GLclampf alpha
void SetIdentity()
Set to the identity rotation.
b2Vec2(float32 x, float32 y)
Construct using coordinates.
void SetZero()
Set this matrix to all zeros.
void GetTransform(b2Transform *xfb, float32 beta) const
b2Mat33()
The default constructor does nothing (for performance).
float32 LengthSquared() const
void operator*=(float32 a)
Multiply this vector by a scalar.
float32 b2InvSqrt(float32 x)
This is a approximate yet fast inverse square-root.
void operator-=(const b2Vec2 &v)
Subtract a vector from this vector.
b2Vec2()
Default constructor does nothing (for performance).
float32 operator()(int32 i) const
Read from and indexed element.
void SetZero()
Set this vector to all zeros.
b2Vec2 b2Mul22(const b2Mat33 &A, const b2Vec2 &v)
Multiply a matrix times a vector.
b2Mat22()
The default constructor does nothing (for performance).
b2Mat22(const b2Vec2 &c1, const b2Vec2 &c2)
Construct this matrix using columns.
bool IsValid() const
Does this vector contain finite coordinates?
b2Vec2 localCenter
local center of mass position
float32 b2Cross(const b2Vec2 &a, const b2Vec2 &b)
Perform the cross product on two vectors. In 2D this produces a scalar.
A 2D column vector with 3 elements.
void SetZero()
Set this vector to all zeros.
b2Vec3()
Default constructor does nothing (for performance).
float32 b2DistanceSquared(const b2Vec2 &a, const b2Vec2 &b)
bool b2IsValid(float32 x)
This function is used to ensure that a floating point number is not a NaN or infinity.
b2Mat22(float32 a11, float32 a12, float32 a21, float32 a22)
Construct this matrix using scalars.
b2Vec2 operator*(float32 s, const b2Vec2 &a)
GLint GLint GLint GLint GLint x
bool convert(const mrpt_msgs::ObservationRangeBeacon &_msg, const mrpt::poses::CPose3D &_pose, mrpt::obs::CObservationBeaconRanges &_obj)
void operator+=(const b2Vec2 &v)
Add a vector to this vector.
b2Vec2 operator-() const
Negate this vector.
bool operator==(const b2Vec2 &a, const b2Vec2 &b)
b2Vec2 Solve(const b2Vec2 &b) const
b2Vec2 b2MulT(const b2Mat22 &A, const b2Vec2 &v)
A 3-by-3 matrix. Stored in column-major order.
b2Vec2 operator+(const b2Vec2 &a, const b2Vec2 &b)
Add two vectors component-wise.
uint32 b2NextPowerOfTwo(uint32 x)
b2Vec3(float32 x, float32 y, float32 z)
Construct using coordinates.
const b2Vec2 b2Vec2_zero
Useful constant.
float32 GetAngle() const
Get the angle in radians.
void Normalize()
Normalize the angles.
void SetZero()
Set this matrix to all zeros.
bool b2IsPowerOfTwo(uint32 x)
b2Vec2 GetYAxis() const
Get the u-axis.
void Set(float32 angle)
Set using an angle in radians.
T b2Clamp(T a, T low, T high)
GLdouble GLdouble GLdouble r
b2Vec2 Skew() const
Get the skew vector such that dot(skew_vec, other) == cross(vec, other)
A 2-by-2 matrix. Stored in column-major order.
b2Vec2 GetXAxis() const
Get the x-axis.
void Set(float32 x_, float32 y_, float32 z_)
Set this vector to some specified coordinates.
void Set(const b2Vec2 &c1, const b2Vec2 &c2)
Initialize this matrix using columns.
GLdouble GLdouble GLdouble b
float32 s
Sine and cosine.
GLdouble GLdouble GLdouble GLdouble q
float32 Normalize()
Convert this vector into a unit vector. Returns the length.
EIGEN_STRONG_INLINE Scalar det() const
void Set(float32 x_, float32 y_)
Set this vector to some specified coordinates.
b2Rot(float32 angle)
Initialize from an angle in radians.
float32 b2Distance(const b2Vec2 &a, const b2Vec2 &b)
b2Mat22 GetInverse() const
float32 Length() const
Get the length of this vector (the norm).
GLdouble GLdouble GLdouble GLdouble GLdouble GLdouble f