mirror of https://github.com/axmolengine/axmol.git
issue #2771: edit android.mk, CMakeLists.txt, change PHYSICS_CONTACT_POINT_MAX to PhysicsContactData:POINT_MAX
This commit is contained in:
parent
0100c05a93
commit
8346fe4b4d
|
@ -39,13 +39,13 @@ CCEventAcceleration.cpp \
|
||||||
CCEventCustom.cpp \
|
CCEventCustom.cpp \
|
||||||
CCEventDispatcher.cpp \
|
CCEventDispatcher.cpp \
|
||||||
CCEventKeyboard.cpp \
|
CCEventKeyboard.cpp \
|
||||||
CCEventMouse.cpp \
|
|
||||||
CCEventListenerMouse.cpp \
|
|
||||||
CCEventListener.cpp \
|
CCEventListener.cpp \
|
||||||
CCEventListenerAcceleration.cpp \
|
CCEventListenerAcceleration.cpp \
|
||||||
CCEventListenerCustom.cpp \
|
CCEventListenerCustom.cpp \
|
||||||
CCEventListenerKeyboard.cpp \
|
CCEventListenerKeyboard.cpp \
|
||||||
|
CCEventListenerMouse.cpp \
|
||||||
CCEventListenerTouch.cpp \
|
CCEventListenerTouch.cpp \
|
||||||
|
CCEventMouse.cpp \
|
||||||
CCEventTouch.cpp \
|
CCEventTouch.cpp \
|
||||||
CCFont.cpp \
|
CCFont.cpp \
|
||||||
CCFontAtlas.cpp \
|
CCFontAtlas.cpp \
|
||||||
|
@ -149,11 +149,6 @@ platform/CCThread.cpp \
|
||||||
../physics/CCPhysicsJoint.cpp \
|
../physics/CCPhysicsJoint.cpp \
|
||||||
../physics/CCPhysicsShape.cpp \
|
../physics/CCPhysicsShape.cpp \
|
||||||
../physics/CCPhysicsWorld.cpp \
|
../physics/CCPhysicsWorld.cpp \
|
||||||
../physics/box2d/CCPhysicsBodyInfo_box2d.cpp \
|
|
||||||
../physics/box2d/CCPhysicsContactInfo_box2d.cpp \
|
|
||||||
../physics/box2d/CCPhysicsJointInfo_box2d.cpp \
|
|
||||||
../physics/box2d/CCPhysicsShapeInfo_box2d.cpp \
|
|
||||||
../physics/box2d/CCPhysicsWorldInfo_box2d.cpp \
|
|
||||||
../physics/chipmunk/CCPhysicsBodyInfo_chipmunk.cpp \
|
../physics/chipmunk/CCPhysicsBodyInfo_chipmunk.cpp \
|
||||||
../physics/chipmunk/CCPhysicsContactInfo_chipmunk.cpp \
|
../physics/chipmunk/CCPhysicsContactInfo_chipmunk.cpp \
|
||||||
../physics/chipmunk/CCPhysicsJointInfo_chipmunk.cpp \
|
../physics/chipmunk/CCPhysicsJointInfo_chipmunk.cpp \
|
||||||
|
|
|
@ -266,8 +266,4 @@ To enable set it to a value different than 0. Disabled by default.
|
||||||
#define CC_LUA_ENGINE_DEBUG 0
|
#define CC_LUA_ENGINE_DEBUG 0
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef CC_USE_PHYSICS
|
|
||||||
#define PHYSICS_CONTACT_POINT_MAX 4
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif // __CCCONFIG_H__
|
#endif // __CCCONFIG_H__
|
||||||
|
|
|
@ -98,7 +98,7 @@ void PhysicsContact::generateContactData()
|
||||||
cpArbiter* arb = static_cast<cpArbiter*>(_contactInfo);
|
cpArbiter* arb = static_cast<cpArbiter*>(_contactInfo);
|
||||||
_contactData = new PhysicsContactData();
|
_contactData = new PhysicsContactData();
|
||||||
_contactData->count = cpArbiterGetCount(arb);
|
_contactData->count = cpArbiterGetCount(arb);
|
||||||
for (int i=0; i<_contactData->count; ++i)
|
for (int i=0; i<_contactData->count && i<PhysicsContactData::POINT_MAX; ++i)
|
||||||
{
|
{
|
||||||
_contactData->points[i] = PhysicsHelper::cpv2point(cpArbiterGetPoint(arb, i));
|
_contactData->points[i] = PhysicsHelper::cpv2point(cpArbiterGetPoint(arb, i));
|
||||||
}
|
}
|
||||||
|
|
|
@ -44,7 +44,8 @@ typedef Point Vect;
|
||||||
|
|
||||||
typedef struct PhysicsContactData
|
typedef struct PhysicsContactData
|
||||||
{
|
{
|
||||||
Point points[PHYSICS_CONTACT_POINT_MAX];
|
static const long POINT_MAX = 4;
|
||||||
|
Point points[POINT_MAX];
|
||||||
int count;
|
int count;
|
||||||
Point normal;
|
Point normal;
|
||||||
|
|
||||||
|
|
|
@ -1,9 +1,4 @@
|
||||||
set(COCOS_PHYSICS_SRC
|
set(COCOS_PHYSICS_SRC
|
||||||
${CMAKE_SOURCE_DIR}/cocos/physics/box2d/CCPhysicsContactInfo_box2d.cpp
|
|
||||||
${CMAKE_SOURCE_DIR}/cocos/physics/box2d/CCPhysicsJointInfo_box2d.cpp
|
|
||||||
${CMAKE_SOURCE_DIR}/cocos/physics/box2d/CCPhysicsShapeInfo_box2d.cpp
|
|
||||||
${CMAKE_SOURCE_DIR}/cocos/physics/box2d/CCPhysicsBodyInfo_box2d.cpp
|
|
||||||
${CMAKE_SOURCE_DIR}/cocos/physics/box2d/CCPhysicsWorldInfo_box2d.cpp
|
|
||||||
${CMAKE_SOURCE_DIR}/cocos/physics/chipmunk/CCPhysicsContactInfo_chipmunk.cpp
|
${CMAKE_SOURCE_DIR}/cocos/physics/chipmunk/CCPhysicsContactInfo_chipmunk.cpp
|
||||||
${CMAKE_SOURCE_DIR}/cocos/physics/chipmunk/CCPhysicsJointInfo_chipmunk.cpp
|
${CMAKE_SOURCE_DIR}/cocos/physics/chipmunk/CCPhysicsJointInfo_chipmunk.cpp
|
||||||
${CMAKE_SOURCE_DIR}/cocos/physics/chipmunk/CCPhysicsShapeInfo_chipmunk.cpp
|
${CMAKE_SOURCE_DIR}/cocos/physics/chipmunk/CCPhysicsShapeInfo_chipmunk.cpp
|
||||||
|
|
Loading…
Reference in New Issue