mirror of https://github.com/axmolengine/axmol.git
Update physicsTest.
This commit is contained in:
parent
7854a13278
commit
9c4bc9e8ed
|
@ -511,7 +511,10 @@ PhysicsDemoRayCast::PhysicsDemoRayCast()
|
|||
void PhysicsDemoRayCast::onEnter()
|
||||
{
|
||||
PhysicsDemo::onEnter();
|
||||
setTouchEnabled(true);
|
||||
|
||||
auto listener = EventListenerTouchAllAtOnce::create();
|
||||
listener->onTouchesEnded = CC_CALLBACK_2(PhysicsDemoRayCast::onTouchesEnded, this);
|
||||
EventDispatcher::getInstance()->addEventListenerWithSceneGraphPriority(listener, this);
|
||||
|
||||
_scene->getPhysicsWorld()->setGravity(Point::ZERO);
|
||||
|
||||
|
@ -712,7 +715,9 @@ void PhysicsDemoJoints::onEnter()
|
|||
{
|
||||
PhysicsDemo::onEnter();
|
||||
|
||||
setTouchEnabled(true);
|
||||
auto listener = EventListenerTouchAllAtOnce::create();
|
||||
listener->onTouchesEnded = CC_CALLBACK_2(PhysicsDemoJoints::onTouchesEnded, this);
|
||||
EventDispatcher::getInstance()->addEventListenerWithSceneGraphPriority(listener, this);
|
||||
|
||||
_scene->getPhysicsWorld()->setGravity(Point::ZERO);
|
||||
|
||||
|
|
|
@ -90,7 +90,7 @@ public:
|
|||
void onEnter() override;
|
||||
std::string title() override;
|
||||
void update(float delta) override;
|
||||
void onTouchesEnded(const std::vector<Touch*>& touches, Event* event) override;
|
||||
void onTouchesEnded(const std::vector<Touch*>& touches, Event* event);
|
||||
|
||||
void changeModeCallback(Object* sender);
|
||||
|
||||
|
@ -110,9 +110,7 @@ public:
|
|||
public:
|
||||
void onEnter() override;
|
||||
std::string title() override;
|
||||
|
||||
private:
|
||||
PhysicsShape* _touchesShape;
|
||||
void onTouchesEnded(const std::vector<Touch*>& touches, Event* event) override;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Reference in New Issue