From dcbd59300102cbb3b09ee71f51298232a859ec11 Mon Sep 17 00:00:00 2001 From: "jiaxin.lai" Date: Thu, 20 Jun 2019 16:19:59 +0800 Subject: [PATCH] add physics macro to global in publish, set cannon to default (#4660) --- cocos/3d/physics/impl-selector.ts | 4 ++-- predefine.js | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/cocos/3d/physics/impl-selector.ts b/cocos/3d/physics/impl-selector.ts index b2c7ac12dc..c746239883 100644 --- a/cocos/3d/physics/impl-selector.ts +++ b/cocos/3d/physics/impl-selector.ts @@ -4,7 +4,7 @@ const _global = typeof window === 'undefined' ? global : window; // tslint:disable: no-string-literal; if (typeof _global.CC_PHYSICS_CANNON === 'undefined') { - _global.CC_PHYSICS_CANNON = false; + _global.CC_PHYSICS_CANNON = true; } if (typeof _global.CC_PHYSICS_AMMO === 'undefined') { @@ -12,7 +12,7 @@ if (typeof _global.CC_PHYSICS_AMMO === 'undefined') { } if (typeof _global.CC_PHYSICS_BUILT_IN === 'undefined') { - _global.CC_PHYSICS_BUILT_IN = true; + _global.CC_PHYSICS_BUILT_IN = false; } // Cannon diff --git a/predefine.js b/predefine.js index 963c63ff30..338a0f2623 100644 --- a/predefine.js +++ b/predefine.js @@ -164,6 +164,9 @@ if (CC_BUILD) { _global.CC_QQPLAY = CC_QQPLAY; _global.CC_RUNTIME = CC_RUNTIME; _global.CC_SUPPORT_JIT = CC_SUPPORT_JIT; + _global.CC_PHYSICS_BUILT_IN = CC_PHYSICS_BUILT_IN; + _global.CC_PHYSICS_CANNON = CC_PHYSICS_CANNON; + _global.CC_PHYSICS_AMMO = CC_PHYSICS_AMMO; } else { defineMacro('CC_TEST', defined('tap') || defined('QUnit'));