issue #2771: fix some compile error in android and win32

This commit is contained in:
boyu0 2013-10-23 10:11:08 +08:00
parent 24561860f0
commit 51801d9218
6 changed files with 55 additions and 10 deletions

View File

@ -103,15 +103,15 @@ void PhysicsJoint::setEnable(bool enable)
}
}
//PhysicsJointPin::PhysicsJointPin()
//{
//
//}
//
//PhysicsJointPin::~PhysicsJointPin()
//{
//
//}
PhysicsJointPin::PhysicsJointPin()
{
}
PhysicsJointPin::~PhysicsJointPin()
{
}
PhysicsJointFixed::PhysicsJointFixed()
{

View File

@ -561,6 +561,11 @@ void PhysicsWorld::rectQuery(PhysicsRectQueryCallback& callback, Rect rect, void
}
}
Array* getShapesAtPoint(Point point)
{
}
Array* PhysicsWorld::getAllBody() const
{
return _bodys;

View File

@ -97,6 +97,7 @@ public:
void rayCast(PhysicsRayCastCallback& callback, Point point1, Point point2, void* data);
void rectQuery(PhysicsRectQueryCallback& callback, Rect rect, void* data);
Array* getShapesAtPoint(Point point);
Array* getAllBody() const;
/** Register a listener to receive contact callbacks*/

View File

@ -24,8 +24,11 @@
#include "CCPhysicsJointInfo.h"
#if (CC_PHYSICS_ENGINE == CC_PHYSICS_CHIPMUNK)
#include <algorithm>
NS_CC_BEGIN
std::map<cpConstraint*, PhysicsJointInfo*> PhysicsJointInfo::map;
PhysicsJointInfo::PhysicsJointInfo(PhysicsJoint* joint)
: joint(joint)
{

View File

@ -673,4 +673,33 @@ void PhysicsDemoRayCast::onTouchesEnded(const std::vector<Touch*>& touches, Even
std::string PhysicsDemoRayCast::title()
{
return "Ray Cast";
}
void PhysicsDemoJoints::onEnter()
{
PhysicsDemo::onEnter();
setTouchEnabled(true);
_scene->getPhysicsWorld()->setGravity(Point::ZERO);
}
void PhysicsDemoJoints::onTouchesEnded(const std::vector<Touch*>& touches, Event* event)
{
//Add a new body/atlas sprite at the touched location
for( auto &touch: touches)
{
auto location = touch->getLocation();
}
}
std::string PhysicsDemoJoints::title()
{
return "Joints";
}

View File

@ -85,7 +85,6 @@ public:
void onEnter() override;
std::string title() override;
void update(float delta) override;
void onTouchesEnded(const std::vector<Touch*>& touches, Event* event) override;
void changeModeCallback(Object* sender);
@ -98,4 +97,12 @@ private:
int _mode;
};
class PhysicsDemoJoints : public PhysicsDemo
{
public:
void onEnter() override;
std::string title() override;
void onTouchesEnded(const std::vector<Touch*>& touches, Event* event) override;
};
#endif