2013-09-10 17:41:06 +08:00
|
|
|
#ifndef _PHYSICS_TEST_H_
|
|
|
|
#define _PHYSICS_TEST_H_
|
|
|
|
|
|
|
|
#include "cocos2d.h"
|
|
|
|
#include "../testBasic.h"
|
|
|
|
|
|
|
|
class PhysicsTestLayer : public Layer
|
|
|
|
{
|
|
|
|
Texture2D* _spriteTexture; // weak ref
|
2013-09-16 22:16:50 +08:00
|
|
|
Scene* _scene;
|
2013-09-10 17:41:06 +08:00
|
|
|
|
|
|
|
public:
|
|
|
|
PhysicsTestLayer();
|
|
|
|
~PhysicsTestLayer();
|
2013-09-16 21:22:22 +08:00
|
|
|
|
2013-09-10 17:41:06 +08:00
|
|
|
void createResetButton();
|
|
|
|
|
2013-09-16 22:16:50 +08:00
|
|
|
inline void setScene(Scene* scene) { _scene = scene; }
|
2013-09-16 21:22:22 +08:00
|
|
|
void toggleDebugCallback(Object* sender);
|
2013-09-10 17:41:06 +08:00
|
|
|
void addNewSpriteAtPosition(Point p);
|
2013-09-16 22:16:50 +08:00
|
|
|
virtual void onTouchesEnded(const std::vector<Touch*>& touches, Event* event) override;
|
|
|
|
virtual void onAcceleration(Acceleration* acc, Event* event) override;
|
2013-09-10 17:41:06 +08:00
|
|
|
} ;
|
|
|
|
|
|
|
|
class PhysicsTestScene : public TestScene
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
virtual bool initTest() override;
|
|
|
|
virtual void runThisTest();
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|