Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2)

Unified Diff: nacltoons/src/physics_layer.h

Issue 12387095: [nacltoons] Use box2d sensors to detect collisions. (Closed) Base URL: https://nativeclient-sdk.googlecode.com/svn/trunk/src
Patch Set: Created 7 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « nacltoons/data/res/sample_game/level1.lua ('k') | nacltoons/src/physics_layer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: nacltoons/src/physics_layer.h
diff --git a/nacltoons/src/physics_layer.h b/nacltoons/src/physics_layer.h
index feca478876c47b70a3107c2123e06f7c4892bbea..e34678bb05a89416372c65bfa24d8b9a6e3dc951 100644
--- a/nacltoons/src/physics_layer.h
+++ b/nacltoons/src/physics_layer.h
@@ -18,7 +18,7 @@ typedef std::vector<cocos2d::CCPoint> PointList;
/**
* Physics layer that the user interacts with.
*/
-class PhysicsLayer : public CCLayerColor {
+class PhysicsLayer : public CCLayerColor, public b2ContactListener {
public:
PhysicsLayer();
~PhysicsLayer();
@@ -45,6 +45,8 @@ class PhysicsLayer : public CCLayerColor {
void ToggleDebug();
#endif
+ // Called by box2d when contact occurs
+ void BeginContact(b2Contact* contact);
private:
// Called by ccTouchesMoved to draw between two points
void DrawLine(CCPoint& start, CCPoint& end);
« no previous file with comments | « nacltoons/data/res/sample_game/level1.lua ('k') | nacltoons/src/physics_layer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698