mirror of https://github.com/axmolengine/axmol.git
issue #2771: fix some compile error in android and win32
This commit is contained in:
parent
24561860f0
commit
51801d9218
|
@ -103,15 +103,15 @@ void PhysicsJoint::setEnable(bool enable)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//PhysicsJointPin::PhysicsJointPin()
|
PhysicsJointPin::PhysicsJointPin()
|
||||||
//{
|
{
|
||||||
//
|
|
||||||
//}
|
}
|
||||||
//
|
|
||||||
//PhysicsJointPin::~PhysicsJointPin()
|
PhysicsJointPin::~PhysicsJointPin()
|
||||||
//{
|
{
|
||||||
//
|
|
||||||
//}
|
}
|
||||||
|
|
||||||
PhysicsJointFixed::PhysicsJointFixed()
|
PhysicsJointFixed::PhysicsJointFixed()
|
||||||
{
|
{
|
||||||
|
|
|
@ -561,6 +561,11 @@ void PhysicsWorld::rectQuery(PhysicsRectQueryCallback& callback, Rect rect, void
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Array* getShapesAtPoint(Point point)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
Array* PhysicsWorld::getAllBody() const
|
Array* PhysicsWorld::getAllBody() const
|
||||||
{
|
{
|
||||||
return _bodys;
|
return _bodys;
|
||||||
|
|
|
@ -97,6 +97,7 @@ public:
|
||||||
|
|
||||||
void rayCast(PhysicsRayCastCallback& callback, Point point1, Point point2, void* data);
|
void rayCast(PhysicsRayCastCallback& callback, Point point1, Point point2, void* data);
|
||||||
void rectQuery(PhysicsRectQueryCallback& callback, Rect rect, void* data);
|
void rectQuery(PhysicsRectQueryCallback& callback, Rect rect, void* data);
|
||||||
|
Array* getShapesAtPoint(Point point);
|
||||||
Array* getAllBody() const;
|
Array* getAllBody() const;
|
||||||
|
|
||||||
/** Register a listener to receive contact callbacks*/
|
/** Register a listener to receive contact callbacks*/
|
||||||
|
|
|
@ -24,8 +24,11 @@
|
||||||
|
|
||||||
#include "CCPhysicsJointInfo.h"
|
#include "CCPhysicsJointInfo.h"
|
||||||
#if (CC_PHYSICS_ENGINE == CC_PHYSICS_CHIPMUNK)
|
#if (CC_PHYSICS_ENGINE == CC_PHYSICS_CHIPMUNK)
|
||||||
|
#include <algorithm>
|
||||||
NS_CC_BEGIN
|
NS_CC_BEGIN
|
||||||
|
|
||||||
|
std::map<cpConstraint*, PhysicsJointInfo*> PhysicsJointInfo::map;
|
||||||
|
|
||||||
PhysicsJointInfo::PhysicsJointInfo(PhysicsJoint* joint)
|
PhysicsJointInfo::PhysicsJointInfo(PhysicsJoint* joint)
|
||||||
: joint(joint)
|
: joint(joint)
|
||||||
{
|
{
|
||||||
|
|
|
@ -673,4 +673,33 @@ void PhysicsDemoRayCast::onTouchesEnded(const std::vector<Touch*>& touches, Even
|
||||||
std::string PhysicsDemoRayCast::title()
|
std::string PhysicsDemoRayCast::title()
|
||||||
{
|
{
|
||||||
return "Ray Cast";
|
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";
|
||||||
}
|
}
|
|
@ -85,7 +85,6 @@ public:
|
||||||
void onEnter() override;
|
void onEnter() override;
|
||||||
std::string title() override;
|
std::string title() override;
|
||||||
void update(float delta) 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) override;
|
||||||
|
|
||||||
void changeModeCallback(Object* sender);
|
void changeModeCallback(Object* sender);
|
||||||
|
@ -98,4 +97,12 @@ private:
|
||||||
int _mode;
|
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
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue