Add World:rayCast

--HG--
branch : box2d-update
This commit is contained in:
Bill Meltsner
2011-09-24 16:26:41 -04:00
parent e2b832015b
commit f852c9bac2
4 changed files with 72 additions and 0 deletions
+15
View File
@@ -95,6 +95,15 @@ namespace box2d
~QueryCallback();
virtual bool ReportFixture(b2Fixture * fixture);
};
class RayCastCallback : public b2RayCastCallback
{
public:
Reference * ref;
RayCastCallback();
~RayCastCallback();
virtual float32 ReportFixture(b2Fixture * fixture, const b2Vec2& point, const b2Vec2& normal, float32 fraction);
};
private:
@@ -108,6 +117,7 @@ namespace box2d
ContactCallback begin, end, presolve, postsolve;
ContactFilter filter;
QueryCallback query;
RayCastCallback raycast;
public:
@@ -215,6 +225,11 @@ namespace box2d
* Gets all fixtures that overlap a given bounding box.
**/
int queryBoundingBox(lua_State * L);
/**
* Raycasts the World for all Fixtures in the path of the ray.
**/
int rayCast(lua_State * L);
};