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

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
Index: nacltoons/src/physics_layer.h
diff --git a/nacltoons/src/physics_layer.h b/nacltoons/src/physics_layer.h
index feca478876c47b70a3107c2123e06f7c4892bbea..fdde3e500a63cf7c9dd9da8fae289f71811d6c5f 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, b2ContactListener {
binji 2013/03/04 19:31:13 public b2ContactListener
Sam Clegg 2013/03/04 20:08:18 Done.
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);

Powered by Google App Engine
This is Rietveld 408576698