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