261 output->
t = input->
tMax;
282 const int32 k_maxIterations = 20;
306 b2Distance(&distanceOutput, &cache, &distanceInput);
309 if (distanceOutput.
distance <= 0.0f)
317 if (distanceOutput.
distance < target + tolerance)
327 fcn.
Initialize(&cache, proxyA, sweepA, proxyB, sweepB, t1);
338 for (
int32 i = 0; i <= N; ++i)
358 int32 pushBackIter = 0;
362 int32 indexA, indexB;
366 if (s2 > target + tolerance)
376 if (s2 > target - tolerance)
388 if (s1 < target - tolerance)
397 if (s1 <= target + tolerance)
407 int32 rootIterCount = 0;
413 if (rootIterCount & 1)
416 t = a1 + (target - s1) * (a2 - a1) / (s2 - s1);
421 t = 0.5f * (a1 + a2);
429 if (
b2Abs(s - target) < tolerance)
448 if (rootIterCount == 50)
472 if (iter == k_maxIterations)
float32 b2Dot(const b2Vec2 &a, const b2Vec2 &b)
Perform the dot product on two vectors.
b2Vec2 b2Mul(const b2Mat22 &A, const b2Vec2 &v)
const b2DistanceProxy * m_proxyA
void b2TimeOfImpact(b2TOIOutput *output, const b2TOIInput *input)
uint8 indexA[3]
vertices on shape A
GLenum GLenum GLenum input
float32 GetMilliseconds() const
Get the time since construction or the last reset.
void GetTransform(b2Transform *xfb, float32 beta) const
const b2Vec2 & GetVertex(int32 index) const
Get a vertex by index. Used by b2Distance.
float32 b2Cross(const b2Vec2 &a, const b2Vec2 &b)
Perform the cross product on two vectors. In 2D this produces a scalar.
GLint GLint GLint GLint GLint x
int32 GetSupport(const b2Vec2 &d) const
Get the supporting vertex index in the given direction.
float32 Initialize(const b2SimplexCache *cache, const b2DistanceProxy *proxyA, const b2Sweep &sweepA, const b2DistanceProxy *proxyB, const b2Sweep &sweepB, float32 t1)
#define b2_maxPolygonVertices
b2Vec2 b2MulT(const b2Mat22 &A, const b2Vec2 &v)
float32 Evaluate(int32 indexA, int32 indexB, float32 t) const
uint8 indexB[3]
vertices on shape B
void b2Distance(b2DistanceOutput *output, b2SimplexCache *cache, const b2DistanceInput *input)
const b2DistanceProxy * m_proxyB
void Normalize()
Normalize the angles.
GLuint GLuint GLsizei count
float32 FindMinSeparation(int32 *indexA, int32 *indexB, float32 t) const
float32 Normalize()
Convert this vector into a unit vector. Returns the length.
GLdouble GLdouble GLdouble GLdouble GLdouble GLdouble f