Hello everyone!
I'm a beginner in Box2d.
Through reading the document and source code of Box2d, I still can not get the meaning of the structure 'b2Transform'.
I've already known there is a rotation matrix and a position vector in the structure of b2Transform, but I can not understand the use of it, why we use it everywhere.
For example:
We use it when testing whether a point is in a shape
bool in_or_not = shape->TestPoint(transform, point);
It appears when cast a ray to a shape:
bool hit = shape->RayCast(&output, input, transform);
It also appears when calculating the position of a shape in the 'world'
const b2Transform& xf = fixture->GetBody()->GetTransform();
b2Vec2 vertices_in_world=b2Mul(xf, poly->m_vertices[i]);
Can any one tell me what the use of b2Transform is and why we use it in the statements above?
Thanks!
I'm a beginner in Box2d.
Through reading the document and source code of Box2d, I still can not get the meaning of the structure 'b2Transform'.
I've already known there is a rotation matrix and a position vector in the structure of b2Transform, but I can not understand the use of it, why we use it everywhere.
For example:
We use it when testing whether a point is in a shape
bool in_or_not = shape->TestPoint(transform, point);
It appears when cast a ray to a shape:
bool hit = shape->RayCast(&output, input, transform);
It also appears when calculating the position of a shape in the 'world'
const b2Transform& xf = fixture->GetBody()->GetTransform();
b2Vec2 vertices_in_world=b2Mul(xf, poly->m_vertices[i]);
Can any one tell me what the use of b2Transform is and why we use it in the statements above?
Thanks!