mirror of https://github.com/axmolengine/axmol.git
Merge pull request #7916 from andyque/fixChipumnk
remove chipmunk.h include in header file
This commit is contained in:
commit
840f311f5c
|
@ -24,6 +24,7 @@
|
||||||
|
|
||||||
#include "CCPhysicsBodyInfo_chipmunk.h"
|
#include "CCPhysicsBodyInfo_chipmunk.h"
|
||||||
#if CC_USE_PHYSICS
|
#if CC_USE_PHYSICS
|
||||||
|
#include "chipmunk.h"
|
||||||
NS_CC_BEGIN
|
NS_CC_BEGIN
|
||||||
|
|
||||||
PhysicsBodyInfo::PhysicsBodyInfo()
|
PhysicsBodyInfo::PhysicsBodyInfo()
|
||||||
|
|
|
@ -28,10 +28,11 @@
|
||||||
#include "base/ccConfig.h"
|
#include "base/ccConfig.h"
|
||||||
#if CC_USE_PHYSICS
|
#if CC_USE_PHYSICS
|
||||||
|
|
||||||
#include "chipmunk.h"
|
|
||||||
#include "base/CCPlatformMacros.h"
|
#include "base/CCPlatformMacros.h"
|
||||||
#include "base/CCRef.h"
|
#include "base/CCRef.h"
|
||||||
|
|
||||||
|
struct cpBody;
|
||||||
|
|
||||||
NS_CC_BEGIN
|
NS_CC_BEGIN
|
||||||
|
|
||||||
class PhysicsBodyInfo
|
class PhysicsBodyInfo
|
||||||
|
|
|
@ -24,6 +24,7 @@
|
||||||
|
|
||||||
#include "CCPhysicsContactInfo_chipmunk.h"
|
#include "CCPhysicsContactInfo_chipmunk.h"
|
||||||
#if CC_USE_PHYSICS
|
#if CC_USE_PHYSICS
|
||||||
|
#include "chipmunk.h"
|
||||||
NS_CC_BEGIN
|
NS_CC_BEGIN
|
||||||
|
|
||||||
PhysicsContactInfo::PhysicsContactInfo(PhysicsContact* contact)
|
PhysicsContactInfo::PhysicsContactInfo(PhysicsContact* contact)
|
||||||
|
|
|
@ -28,7 +28,6 @@
|
||||||
#include "base/ccConfig.h"
|
#include "base/ccConfig.h"
|
||||||
#if CC_USE_PHYSICS
|
#if CC_USE_PHYSICS
|
||||||
|
|
||||||
#include "chipmunk.h"
|
|
||||||
#include "base/CCPlatformMacros.h"
|
#include "base/CCPlatformMacros.h"
|
||||||
NS_CC_BEGIN
|
NS_CC_BEGIN
|
||||||
|
|
||||||
|
|
|
@ -26,6 +26,7 @@
|
||||||
#if CC_USE_PHYSICS
|
#if CC_USE_PHYSICS
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <unordered_map>
|
#include <unordered_map>
|
||||||
|
#include "chipmunk.h"
|
||||||
|
|
||||||
NS_CC_BEGIN
|
NS_CC_BEGIN
|
||||||
|
|
||||||
|
|
|
@ -28,10 +28,11 @@
|
||||||
#include "base/ccConfig.h"
|
#include "base/ccConfig.h"
|
||||||
#if CC_USE_PHYSICS
|
#if CC_USE_PHYSICS
|
||||||
|
|
||||||
#include "chipmunk.h"
|
|
||||||
#include "base/CCPlatformMacros.h"
|
#include "base/CCPlatformMacros.h"
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <unordered_map>
|
#include <unordered_map>
|
||||||
|
|
||||||
|
struct cpConstraint;
|
||||||
NS_CC_BEGIN
|
NS_CC_BEGIN
|
||||||
|
|
||||||
class PhysicsJoint;
|
class PhysicsJoint;
|
||||||
|
|
|
@ -26,6 +26,7 @@
|
||||||
#if CC_USE_PHYSICS
|
#if CC_USE_PHYSICS
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <unordered_map>
|
#include <unordered_map>
|
||||||
|
#include "chipmunk.h"
|
||||||
|
|
||||||
NS_CC_BEGIN
|
NS_CC_BEGIN
|
||||||
|
|
||||||
|
|
|
@ -30,9 +30,12 @@
|
||||||
|
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <unordered_map>
|
#include <unordered_map>
|
||||||
#include "chipmunk.h"
|
|
||||||
#include "base/CCPlatformMacros.h"
|
#include "base/CCPlatformMacros.h"
|
||||||
|
|
||||||
|
typedef uintptr_t cpGroup;
|
||||||
|
struct cpShape;
|
||||||
|
struct cpBody;
|
||||||
|
|
||||||
NS_CC_BEGIN
|
NS_CC_BEGIN
|
||||||
|
|
||||||
class PhysicsShape;
|
class PhysicsShape;
|
||||||
|
|
|
@ -28,6 +28,8 @@
|
||||||
#include "CCPhysicsBodyInfo_chipmunk.h"
|
#include "CCPhysicsBodyInfo_chipmunk.h"
|
||||||
#include "CCPhysicsShapeInfo_chipmunk.h"
|
#include "CCPhysicsShapeInfo_chipmunk.h"
|
||||||
#include "CCPhysicsJointInfo_chipmunk.h"
|
#include "CCPhysicsJointInfo_chipmunk.h"
|
||||||
|
#include "chipmunk.h"
|
||||||
|
|
||||||
NS_CC_BEGIN
|
NS_CC_BEGIN
|
||||||
|
|
||||||
PhysicsWorldInfo::PhysicsWorldInfo()
|
PhysicsWorldInfo::PhysicsWorldInfo()
|
||||||
|
@ -96,5 +98,15 @@ void PhysicsWorldInfo::removeJoint(PhysicsJointInfo& joint)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool PhysicsWorldInfo::isLocked()
|
||||||
|
{
|
||||||
|
return 0 == _space->locked_private ? false : true;
|
||||||
|
}
|
||||||
|
|
||||||
|
void PhysicsWorldInfo::step(float delta)
|
||||||
|
{
|
||||||
|
cpSpaceStep(_space, delta);
|
||||||
|
}
|
||||||
|
|
||||||
NS_CC_END
|
NS_CC_END
|
||||||
#endif // CC_USE_PHYSICS
|
#endif // CC_USE_PHYSICS
|
||||||
|
|
|
@ -29,9 +29,12 @@
|
||||||
#if CC_USE_PHYSICS
|
#if CC_USE_PHYSICS
|
||||||
|
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include "chipmunk.h"
|
|
||||||
#include "base/CCPlatformMacros.h"
|
#include "base/CCPlatformMacros.h"
|
||||||
#include "math/CCGeometry.h"
|
#include "math/CCGeometry.h"
|
||||||
|
|
||||||
|
struct cpSpace;
|
||||||
|
|
||||||
|
|
||||||
NS_CC_BEGIN
|
NS_CC_BEGIN
|
||||||
typedef Vec2 Vect;
|
typedef Vec2 Vect;
|
||||||
class PhysicsBodyInfo;
|
class PhysicsBodyInfo;
|
||||||
|
@ -49,8 +52,8 @@ public:
|
||||||
void addJoint(PhysicsJointInfo& joint);
|
void addJoint(PhysicsJointInfo& joint);
|
||||||
void removeJoint(PhysicsJointInfo& joint);
|
void removeJoint(PhysicsJointInfo& joint);
|
||||||
void setGravity(const Vect& gravity);
|
void setGravity(const Vect& gravity);
|
||||||
inline bool isLocked() { return 0 == _space->locked_private ? false : true; }
|
bool isLocked();
|
||||||
inline void step(float delta) { cpSpaceStep(_space, delta); }
|
void step(float delta);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
PhysicsWorldInfo();
|
PhysicsWorldInfo();
|
||||||
|
|
Loading…
Reference in New Issue