From 6259aebdabf66de8220d32cbe54f8fe98d91a335 Mon Sep 17 00:00:00 2001 From: samuele3hu Date: Sun, 17 Aug 2014 23:45:56 +0800 Subject: [PATCH] =?UTF-8?q?Split=20cocos3d=20from=20cocos2d=20on=20the=20a?= =?UTF-8?q?ndroid=E3=80=81win32=20and=20linux=20platform=20and=20adjust=20?= =?UTF-8?q?the=20related=20test=20project?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CMakeLists.txt | 3 + build/cocos2d-win32.vc2012.sln | 6 + build/cocos2d_libs.xcodeproj/project.pbxproj | 6 + cocos/2d/libcocos2d.vcxproj | 35 ------ cocos/2d/libcocos2d.vcxproj.filters | 110 +----------------- cocos/3d/CCAABB.h | 3 +- cocos/3d/CCAnimate3D.h | 3 +- cocos/3d/CCAnimation3D.h | 3 +- cocos/3d/CCAttachNode.h | 3 +- cocos/3d/CCBundle3D.h | 3 +- cocos/3d/CCMesh.h | 5 +- cocos/3d/CCMeshSkin.h | 3 +- cocos/3d/CCOBB.h | 3 +- cocos/3d/CCRay.h | 3 +- cocos/3d/CCSkeleton3D.h | 5 +- cocos/3d/CCSprite3D.h | 5 +- cocos/3d/CCSubMesh.h | 3 +- cocos/3d/CCSubMeshState.h | 3 +- cocos/3d/CMakeLists.txt | 51 +++++--- cocos/3d/cocos3d.h | 41 +++++++ cocos/Android.mk | 16 --- cocos/CMakeLists.txt | 2 - cocos/cocos2d.h | 13 --- tests/cpp-tests/Android.mk | 2 + tests/cpp-tests/CMakeLists.txt | 1 + .../Classes/Camera3DTest/Camera3DTest.cpp | 1 + .../Classes/Sprite3DTest/Sprite3DTest.cpp | 1 + tests/cpp-tests/Classes/testBasic.h | 1 + tests/cpp-tests/proj.win32/cpp-tests.vcxproj | 3 + 29 files changed, 130 insertions(+), 207 deletions(-) mode change 100755 => 100644 cocos/3d/CCAABB.h mode change 100755 => 100644 cocos/3d/CCOBB.h mode change 100755 => 100644 cocos/3d/CCRay.h create mode 100755 cocos/3d/cocos3d.h diff --git a/CMakeLists.txt b/CMakeLists.txt index 2f1e9da541..bd59e4b987 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -204,6 +204,9 @@ add_subdirectory(cocos/audio) # cocos2d library add_subdirectory(cocos) +# cocos3d library +add_subdirectory(cocos/3d) + # network library add_subdirectory(cocos/network) diff --git a/build/cocos2d-win32.vc2012.sln b/build/cocos2d-win32.vc2012.sln index 44afe74dca..869f2360d8 100644 --- a/build/cocos2d-win32.vc2012.sln +++ b/build/cocos2d-win32.vc2012.sln @@ -45,6 +45,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libluaextension", "..\cocos EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libluaspine", "..\cocos\scripting\lua-bindings\proj.win32\libluaspine.vcxproj", "{31EF6AB1-0D9A-4BC6-99B8-2C482EA373C4}" EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libcocos3d", "..\cocos\3d\proj.win32\libcocos3d.vcxproj", "{E24950FA-5BC1-4AEE-A900-4F0259354BF0}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Win32 = Debug|Win32 @@ -139,6 +141,10 @@ Global {31EF6AB1-0D9A-4BC6-99B8-2C482EA373C4}.Debug|Win32.Build.0 = Debug|Win32 {31EF6AB1-0D9A-4BC6-99B8-2C482EA373C4}.Release|Win32.ActiveCfg = Release|Win32 {31EF6AB1-0D9A-4BC6-99B8-2C482EA373C4}.Release|Win32.Build.0 = Release|Win32 + {E24950FA-5BC1-4AEE-A900-4F0259354BF0}.Debug|Win32.ActiveCfg = Debug|Win32 + {E24950FA-5BC1-4AEE-A900-4F0259354BF0}.Debug|Win32.Build.0 = Debug|Win32 + {E24950FA-5BC1-4AEE-A900-4F0259354BF0}.Release|Win32.ActiveCfg = Release|Win32 + {E24950FA-5BC1-4AEE-A900-4F0259354BF0}.Release|Win32.Build.0 = Release|Win32 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/build/cocos2d_libs.xcodeproj/project.pbxproj b/build/cocos2d_libs.xcodeproj/project.pbxproj index 8e715c2905..cb3e53540c 100644 --- a/build/cocos2d_libs.xcodeproj/project.pbxproj +++ b/build/cocos2d_libs.xcodeproj/project.pbxproj @@ -120,6 +120,8 @@ 15162221199E7A32006099B8 /* CCSprite3D.h in Headers */ = {isa = PBXBuildFile; fileRef = B29594BE1926D61F003EEF37 /* CCSprite3D.h */; }; 15162222199E7A32006099B8 /* CCSprite3DMaterial.h in Headers */ = {isa = PBXBuildFile; fileRef = B29594C01926D61F003EEF37 /* CCSprite3DMaterial.h */; }; 15162223199E7A32006099B8 /* CCBundle3DData.h in Headers */ = {isa = PBXBuildFile; fileRef = B2D3D3B81948613300BA4831 /* CCBundle3DData.h */; }; + 15162237199F9EEA006099B8 /* cocos3d.h in Headers */ = {isa = PBXBuildFile; fileRef = 15162236199F9EEA006099B8 /* cocos3d.h */; }; + 15162238199F9EEA006099B8 /* cocos3d.h in Headers */ = {isa = PBXBuildFile; fileRef = 15162236199F9EEA006099B8 /* cocos3d.h */; }; 15EFA211198A2BB5000C57D3 /* CCProtectedNode.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 15EFA20F198A2BB5000C57D3 /* CCProtectedNode.cpp */; }; 15EFA212198A2BB5000C57D3 /* CCProtectedNode.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 15EFA20F198A2BB5000C57D3 /* CCProtectedNode.cpp */; }; 15EFA213198A2BB5000C57D3 /* CCProtectedNode.h in Headers */ = {isa = PBXBuildFile; fileRef = 15EFA210198A2BB5000C57D3 /* CCProtectedNode.h */; }; @@ -2106,6 +2108,7 @@ 06CAAAC1186AD63B0012A414 /* TriggerObj.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TriggerObj.h; sourceTree = ""; }; 1516200B199E7363006099B8 /* libcocos3d Mac.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libcocos3d Mac.a"; sourceTree = BUILT_PRODUCTS_DIR; }; 15162201199E7810006099B8 /* libcocos3d iOS.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libcocos3d iOS.a"; sourceTree = BUILT_PRODUCTS_DIR; }; + 15162236199F9EEA006099B8 /* cocos3d.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = cocos3d.h; sourceTree = ""; }; 1551A33F158F2AB200E66CFE /* libcocos2d Mac.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libcocos2d Mac.a"; sourceTree = BUILT_PRODUCTS_DIR; }; 1551A342158F2AB200E66CFE /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; 15EFA20F198A2BB5000C57D3 /* CCProtectedNode.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCProtectedNode.cpp; sourceTree = ""; }; @@ -5289,6 +5292,7 @@ B29594B81926D61F003EEF37 /* 3d */ = { isa = PBXGroup; children = ( + 15162236199F9EEA006099B8 /* cocos3d.h */, B6105175199CB1A600DC41CE /* CCAABB.cpp */, B6105176199CB1A600DC41CE /* CCAABB.h */, B6105177199CB1A600DC41CE /* CCOBB.cpp */, @@ -5346,6 +5350,7 @@ 15162023199E75FF006099B8 /* CCBundleReader.h in Headers */, 15162024199E75FF006099B8 /* CCBundle3D.h in Headers */, 15162025199E75FF006099B8 /* CCAnimate3D.h in Headers */, + 15162237199F9EEA006099B8 /* cocos3d.h in Headers */, 15162026199E75FF006099B8 /* CCMeshSkin.h in Headers */, 15162027199E75FF006099B8 /* CCAnimation3D.h in Headers */, 15162028199E75FF006099B8 /* CCAnimationCurve.h in Headers */, @@ -5371,6 +5376,7 @@ 15162219199E7A32006099B8 /* CCBundleReader.h in Headers */, 1516221A199E7A32006099B8 /* CCBundle3D.h in Headers */, 1516221B199E7A32006099B8 /* CCAnimate3D.h in Headers */, + 15162238199F9EEA006099B8 /* cocos3d.h in Headers */, 1516221C199E7A32006099B8 /* CCMeshSkin.h in Headers */, 1516221D199E7A32006099B8 /* CCAnimation3D.h in Headers */, 1516221E199E7A32006099B8 /* CCAnimationCurve.h in Headers */, diff --git a/cocos/2d/libcocos2d.vcxproj b/cocos/2d/libcocos2d.vcxproj index 331e1c58cc..91e74ad18a 100644 --- a/cocos/2d/libcocos2d.vcxproj +++ b/cocos/2d/libcocos2d.vcxproj @@ -183,22 +183,6 @@ xcopy /Y /Q "$(ProjectDir)..\..\external\win32-specific\gles\prebuilt\*.*" "$(Ou - - - - - - - - - - - - - - - - @@ -377,24 +361,6 @@ xcopy /Y /Q "$(ProjectDir)..\..\external\win32-specific\gles\prebuilt\*.*" "$(Ou - - - - - - - - - - - - - - - - - - @@ -592,7 +558,6 @@ xcopy /Y /Q "$(ProjectDir)..\..\external\win32-specific\gles\prebuilt\*.*" "$(Ou - diff --git a/cocos/2d/libcocos2d.vcxproj.filters b/cocos/2d/libcocos2d.vcxproj.filters index b1c46820b0..eb482baa59 100644 --- a/cocos/2d/libcocos2d.vcxproj.filters +++ b/cocos/2d/libcocos2d.vcxproj.filters @@ -1,4 +1,4 @@ - + @@ -52,9 +52,6 @@ {b4e2b1e5-2d79-44a3-af45-728d47b7bdb2} - - {a20c4bdc-bd4c-40c1-a78a-fe31cd3ec76a} - {44bdf58f-4af2-433c-b4af-58dc05ef96b5} @@ -550,36 +547,9 @@ renderer - - 3d - - - 3d - - - 3d - base - - 3d - - - 3d - - - 3d - - - 3d - - - 3d - - - 3d - 2d @@ -589,18 +559,6 @@ storage - - 3d - - - 3d - - - 3d - - - 3d - platform\desktop @@ -613,15 +571,6 @@ base - - 3d - - - 3d - - - 3d - renderer @@ -1201,42 +1150,9 @@ renderer - - 3d - - - 3d - - - 3d - base - - 3d - - - 3d - - - 3d - - - 3d - - - 3d - - - 3d - - - 3d - - - 3d - 2d @@ -1246,18 +1162,6 @@ storage - - 3d - - - 3d - - - 3d - - - 3d - platform\desktop @@ -1270,15 +1174,6 @@ base - - 3d - - - 3d - - - 3d - renderer @@ -1317,9 +1212,6 @@ math - - 3d - \ No newline at end of file diff --git a/cocos/3d/CCAABB.h b/cocos/3d/CCAABB.h old mode 100755 new mode 100644 index 8894aa0098..20d1650e70 --- a/cocos/3d/CCAABB.h +++ b/cocos/3d/CCAABB.h @@ -27,10 +27,11 @@ #include "base/ccMacros.h" #include "math/CCMath.h" +#include "3d/3dExport.h" NS_CC_BEGIN -class CC_DLL AABB +class CC_3D_DLL AABB { public: diff --git a/cocos/3d/CCAnimate3D.h b/cocos/3d/CCAnimate3D.h index 823221d74d..d6d8152bb2 100644 --- a/cocos/3d/CCAnimate3D.h +++ b/cocos/3d/CCAnimate3D.h @@ -34,6 +34,7 @@ #include "base/ccTypes.h" #include "base/CCPlatformMacros.h" #include "2d/CCActionInterval.h" +#include "3d/3dExport.h" NS_CC_BEGIN @@ -42,7 +43,7 @@ class Bone3D; /** * Animate3D, Animates a Sprite3D given with an Animation3D */ -class CC_DLL Animate3D: public ActionInterval +class CC_3D_DLL Animate3D: public ActionInterval { public: diff --git a/cocos/3d/CCAnimation3D.h b/cocos/3d/CCAnimation3D.h index 27713d9b20..006506d018 100644 --- a/cocos/3d/CCAnimation3D.h +++ b/cocos/3d/CCAnimation3D.h @@ -33,13 +33,14 @@ #include "base/CCRef.h" #include "base/ccTypes.h" #include "CCBundle3DData.h" +#include "3d/3dExport.h" NS_CC_BEGIN /** * static animation data, shared */ -class CC_DLL Animation3D: public Ref +class CC_3D_DLL Animation3D: public Ref { friend class Bundle3D; public: diff --git a/cocos/3d/CCAttachNode.h b/cocos/3d/CCAttachNode.h index bb142e1434..ed67bca143 100644 --- a/cocos/3d/CCAttachNode.h +++ b/cocos/3d/CCAttachNode.h @@ -33,6 +33,7 @@ #include "math/CCMath.h" #include "2d/CCNode.h" #include "renderer/CCMeshCommand.h" +#include "3d/3dExport.h" NS_CC_BEGIN @@ -45,7 +46,7 @@ class Bone3D; * auto attachNode = sprite->getAttachNode("left hand"); * attachNode->addChild(weapon); */ -class CC_DLL AttachNode : public Node +class CC_3D_DLL AttachNode : public Node { public: /** diff --git a/cocos/3d/CCBundle3D.h b/cocos/3d/CCBundle3D.h index 58749abab0..b2b40aaf86 100644 --- a/cocos/3d/CCBundle3D.h +++ b/cocos/3d/CCBundle3D.h @@ -35,6 +35,7 @@ #include "json/document.h" #include "CCBundleReader.h" +#include "3d/3dExport.h" NS_CC_BEGIN class Animation3D; @@ -46,7 +47,7 @@ class Data; * c3t text file * c3b binary file */ -class CC_DLL Bundle3D +class CC_3D_DLL Bundle3D { public: /**you can define yourself bundle and set it, use default bundle otherwise*/ diff --git a/cocos/3d/CCMesh.h b/cocos/3d/CCMesh.h index 304a09f207..fa16d6c703 100644 --- a/cocos/3d/CCMesh.h +++ b/cocos/3d/CCMesh.h @@ -38,6 +38,7 @@ #include "renderer/CCGLProgram.h" #include "CCAABB.h" +#include "3d/3dExport.h" NS_CC_BEGIN @@ -45,7 +46,7 @@ NS_CC_BEGIN class EventListenerCustom; class EventCustom; -class CC_DLL RenderMeshData +class CC_3D_DLL RenderMeshData { typedef std::vector IndexArray; friend class Mesh; @@ -72,7 +73,7 @@ protected: * Mesh: Geometry with a collection of vertex. * Supporting various vertex formats. */ -class CC_DLL Mesh : public Ref +class CC_3D_DLL Mesh : public Ref { typedef std::vector IndexArray; public: diff --git a/cocos/3d/CCMeshSkin.h b/cocos/3d/CCMeshSkin.h index bd5ff24245..20910ece02 100644 --- a/cocos/3d/CCMeshSkin.h +++ b/cocos/3d/CCMeshSkin.h @@ -35,6 +35,7 @@ #include "base/CCVector.h" #include "base/ccTypes.h" #include "math/CCMath.h" +#include "3d/3dExport.h" NS_CC_BEGIN @@ -45,7 +46,7 @@ class Skeleton3D; * MeshSkin, A class maintain a collection of bones that affect Mesh vertex. * And it is responsible for computing matrix palletes that used by skin mesh rendering. */ -class CC_DLL MeshSkin: public Ref +class CC_3D_DLL MeshSkin: public Ref { public: diff --git a/cocos/3d/CCOBB.h b/cocos/3d/CCOBB.h old mode 100755 new mode 100644 index 0fd8c1eea1..917472f224 --- a/cocos/3d/CCOBB.h +++ b/cocos/3d/CCOBB.h @@ -26,10 +26,11 @@ #define __CC_OBB_H__ #include "CCAABB.h" +#include "3d/3dExport.h" NS_CC_BEGIN -class CC_DLL OBB +class CC_3D_DLL OBB { public: OBB(); diff --git a/cocos/3d/CCRay.h b/cocos/3d/CCRay.h old mode 100755 new mode 100644 index 0deab2a68a..d92d0ac06c --- a/cocos/3d/CCRay.h +++ b/cocos/3d/CCRay.h @@ -29,10 +29,11 @@ #include "math/CCMath.h" #include "CCAABB.h" #include "CCOBB.h" +#include "3d/3dExport.h" NS_CC_BEGIN -class CC_DLL Ray +class CC_3D_DLL Ray { public: /** diff --git a/cocos/3d/CCSkeleton3D.h b/cocos/3d/CCSkeleton3D.h index 2b8af4bebe..d6c431c22f 100644 --- a/cocos/3d/CCSkeleton3D.h +++ b/cocos/3d/CCSkeleton3D.h @@ -34,13 +34,14 @@ #include "base/CCVector.h" #include "base/ccTypes.h" #include "math/CCMath.h" +#include "3d/3dExport.h" NS_CC_BEGIN /** * Defines a basic hierachial structure of transformation spaces. */ -class CC_DLL Bone3D : public Ref +class CC_3D_DLL Bone3D : public Ref { friend class Skeleton3D; friend class MeshSkin; @@ -183,7 +184,7 @@ protected: * Skeleton * */ -class CC_DLL Skeleton3D: public Ref +class CC_3D_DLL Skeleton3D: public Ref { public: diff --git a/cocos/3d/CCSprite3D.h b/cocos/3d/CCSprite3D.h index 4a594d5483..36de7ac3cf 100644 --- a/cocos/3d/CCSprite3D.h +++ b/cocos/3d/CCSprite3D.h @@ -34,6 +34,7 @@ #include "2d/CCNode.h" #include "renderer/CCMeshCommand.h" #include "CCAABB.h" +#include "3d/3dExport.h" NS_CC_BEGIN @@ -46,7 +47,7 @@ class SubMeshState; class Skeleton3D; /** Sprite3D: A sprite can be loaded from 3D model files, .obj, .c3t, .c3b, then can be drawed as sprite */ -class CC_DLL Sprite3D : public Node, public BlendProtocol +class CC_3D_DLL Sprite3D : public Node, public BlendProtocol { public: /** creates a Sprite3D*/ @@ -144,7 +145,7 @@ protected: mutable Mat4 _nodeToWorldTransform; // cache the matrix }; -extern std::string CC_DLL s_attributeNames[];//attribute names array +extern std::string CC_3D_DLL s_attributeNames[];//attribute names array NS_CC_END #endif // __SPRITE3D_H_ diff --git a/cocos/3d/CCSubMesh.h b/cocos/3d/CCSubMesh.h index ff8dc0e026..d8f62e7e65 100644 --- a/cocos/3d/CCSubMesh.h +++ b/cocos/3d/CCSubMesh.h @@ -34,6 +34,7 @@ #include "base/ccTypes.h" #include "math/CCMath.h" #include "renderer/CCGLProgram.h" +#include "3d/3dExport.h" NS_CC_BEGIN @@ -57,7 +58,7 @@ enum class PrimitiveType /** * SubMesh: Defines the way the mesh's vertices how to be connected together. */ -class CC_DLL SubMesh : public Ref +class CC_3D_DLL SubMesh : public Ref { friend class Mesh; public: diff --git a/cocos/3d/CCSubMeshState.h b/cocos/3d/CCSubMeshState.h index 26bca6cb17..542b0ecd32 100644 --- a/cocos/3d/CCSubMeshState.h +++ b/cocos/3d/CCSubMeshState.h @@ -34,6 +34,7 @@ #include "base/ccTypes.h" #include "math/CCMath.h" #include "renderer/CCGLProgram.h" +#include "3d/3dExport.h" NS_CC_BEGIN @@ -42,7 +43,7 @@ class MeshSkin; /** * SubMeshState: visibility and apperence of submesh */ -class CC_DLL SubMeshState : public Ref +class CC_3D_DLL SubMeshState : public Ref { public: diff --git a/cocos/3d/CMakeLists.txt b/cocos/3d/CMakeLists.txt index a5d625b094..5d353f8874 100644 --- a/cocos/3d/CMakeLists.txt +++ b/cocos/3d/CMakeLists.txt @@ -1,18 +1,37 @@ set(COCOS_3D_SRC - 3d/CCAABB.cpp - 3d/CCOBB.cpp - 3d/CCRay.cpp - 3d/CCSkeleton3D.cpp - 3d/CCAttachNode.cpp - 3d/CCSubMesh.cpp - 3d/CCSubMeshState.cpp - 3d/CCMesh.cpp - 3d/CCObjLoader.cpp - 3d/CCSprite3D.cpp - 3d/CCSprite3DMaterial.cpp - 3d/CCAnimate3D.cpp - 3d/CCAnimation3D.cpp - 3d/CCBundle3D.cpp - 3d/CCMeshSkin.cpp - 3d/CCBundleReader.cpp +CCRay.cpp +CCAABB.cpp +CCOBB.cpp +CCAnimate3D.cpp +CCAnimation3D.cpp +CCAttachNode.cpp +CCBundle3D.cpp +CCBundleReader.cpp +CCMesh.cpp +CCMeshSkin.cpp +CCSprite3DMaterial.cpp +CCObjLoader.cpp +CCSkeleton3D.cpp +CCSprite3D.cpp +CCSubMesh.cpp +CCSubMeshState.cpp ) + + +include_directories( + 3d +) + +add_library(cocos3d STATIC + ${COCOS_3D_SRC} +) + +target_link_libraries(cocos3d + cocos2d +) + +set_target_properties(cocos3d + PROPERTIES + ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib" + LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib" +) \ No newline at end of file diff --git a/cocos/3d/cocos3d.h b/cocos/3d/cocos3d.h new file mode 100755 index 0000000000..58e88e969d --- /dev/null +++ b/cocos/3d/cocos3d.h @@ -0,0 +1,41 @@ +/**************************************************************************** + Copyright (c) 2014 Chukong Technologies Inc. + + http://www.cocos2d-x.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. + ****************************************************************************/ + +#ifndef __COCOS_3D_COCOS3D_H__ +#define __COCOS_3D_COCOS3D_H__ + +//3d +#include "3d/CCAABB.h" +#include "3d/CCOBB.h" +#include "3d/CCRay.h" +#include "3d/CCSprite3D.h" +#include "3d/CCMesh.h" +#include "3d/CCMeshSkin.h" +#include "3d/CCAnimate3D.h" +#include "3d/CCAnimation3D.h" +#include "3d/CCSprite3DMaterial.h" +#include "3d/CCSubMeshState.h" +#include "3d/CCAttachNode.h" + +#endif diff --git a/cocos/Android.mk b/cocos/Android.mk index 463fdd53c6..fc522d5810 100644 --- a/cocos/Android.mk +++ b/cocos/Android.mk @@ -74,22 +74,6 @@ cocos2d.cpp \ 2d/CCTransitionPageTurn.cpp \ 2d/CCTransitionProgress.cpp \ 2d/CCTweenFunction.cpp \ -3d/CCRay.cpp\ -3d/CCAABB.cpp \ -3d/CCOBB.cpp \ -3d/CCAnimate3D.cpp \ -3d/CCAnimation3D.cpp \ -3d/CCAttachNode.cpp \ -3d/CCBundle3D.cpp \ -3d/CCBundleReader.cpp \ -3d/CCMesh.cpp \ -3d/CCMeshSkin.cpp \ -3d/CCSprite3DMaterial.cpp \ -3d/CCObjLoader.cpp \ -3d/CCSkeleton3D.cpp \ -3d/CCSprite3D.cpp \ -3d/CCSubMesh.cpp \ -3d/CCSubMeshState.cpp \ platform/CCGLView.cpp \ platform/CCFileUtils.cpp \ platform/CCSAXParser.cpp \ diff --git a/cocos/CMakeLists.txt b/cocos/CMakeLists.txt index 7965b6d867..bb62406fe1 100644 --- a/cocos/CMakeLists.txt +++ b/cocos/CMakeLists.txt @@ -5,7 +5,6 @@ endif() set(COCOS_SRC cocos2d.cpp) include(2d/CMakeLists.txt) -include(3d/CMakeLists.txt) include(platform/CMakeLists.txt) include(physics/CMakeLists.txt) include(math/CMakeLists.txt) @@ -16,7 +15,6 @@ include(deprecated/CMakeLists.txt) add_library(cocos2d STATIC ${COCOS_SRC} ${COCOS_2D_SRC} - ${COCOS_3D_SRC} ${COCOS_PLATFORM_SRC} ${COCOS_BASE_SRC} ${COCOS_RENDERER_SRC} diff --git a/cocos/cocos2d.h b/cocos/cocos2d.h index 3e19d4a5c5..96158acfcf 100644 --- a/cocos/cocos2d.h +++ b/cocos/cocos2d.h @@ -261,19 +261,6 @@ THE SOFTWARE. #include "2d/CCComponent.h" #include "2d/CCComponentContainer.h" -//3d -#include "3d/CCAABB.h" -#include "3d/CCOBB.h" -#include "3d/CCRay.h" -#include "3d/CCSprite3D.h" -#include "3d/CCMesh.h" -#include "3d/CCMeshSkin.h" -#include "3d/CCAnimate3D.h" -#include "3d/CCAnimation3D.h" -#include "3d/CCSprite3DMaterial.h" -#include "3d/CCSubMeshState.h" -#include "3d/CCAttachNode.h" - // Deprecated include #include "deprecated/CCDictionary.h" #include "deprecated/CCArray.h" diff --git a/tests/cpp-tests/Android.mk b/tests/cpp-tests/Android.mk index 9b69186e42..c1fcaefe21 100644 --- a/tests/cpp-tests/Android.mk +++ b/tests/cpp-tests/Android.mk @@ -195,6 +195,7 @@ LOCAL_WHOLE_STATIC_LIBRARIES += cocostudio_static LOCAL_WHOLE_STATIC_LIBRARIES += cocos_network_static LOCAL_WHOLE_STATIC_LIBRARIES += cocos_extension_static LOCAL_WHOLE_STATIC_LIBRARIES += box2d_static +LOCAL_WHOLE_STATIC_LIBRARIES += cocos3d_static LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/Classes @@ -207,3 +208,4 @@ $(call import-module,editor-support/spine) $(call import-module,editor-support/cocostudio) $(call import-module,network) $(call import-module,Box2D) +$(call import-module,3d) diff --git a/tests/cpp-tests/CMakeLists.txt b/tests/cpp-tests/CMakeLists.txt index e457e435f2..5dcfe748c8 100644 --- a/tests/cpp-tests/CMakeLists.txt +++ b/tests/cpp-tests/CMakeLists.txt @@ -207,6 +207,7 @@ target_link_libraries(${APP_NAME} extensions audio cocos2d + cocos3d box2d ui network diff --git a/tests/cpp-tests/Classes/Camera3DTest/Camera3DTest.cpp b/tests/cpp-tests/Classes/Camera3DTest/Camera3DTest.cpp index 1f779c3d22..6f0eda505a 100644 --- a/tests/cpp-tests/Classes/Camera3DTest/Camera3DTest.cpp +++ b/tests/cpp-tests/Classes/Camera3DTest/Camera3DTest.cpp @@ -28,6 +28,7 @@ THE SOFTWARE. #include "../testResource.h" #include "3d/CCAttachNode.h" +#include "3d/cocos3d.h" ////////////DrawLine///////////////////// diff --git a/tests/cpp-tests/Classes/Sprite3DTest/Sprite3DTest.cpp b/tests/cpp-tests/Classes/Sprite3DTest/Sprite3DTest.cpp index 2410ffb068..9079785751 100644 --- a/tests/cpp-tests/Classes/Sprite3DTest/Sprite3DTest.cpp +++ b/tests/cpp-tests/Classes/Sprite3DTest/Sprite3DTest.cpp @@ -29,6 +29,7 @@ #include "3d/CCSubMesh.h" #include "3d/CCAttachNode.h" #include "3d/CCRay.h" +#include "3d/CCSprite3D.h" #include "DrawNode3D.h" #include diff --git a/tests/cpp-tests/Classes/testBasic.h b/tests/cpp-tests/Classes/testBasic.h index 5da3ba1a11..02fb9f32ad 100644 --- a/tests/cpp-tests/Classes/testBasic.h +++ b/tests/cpp-tests/Classes/testBasic.h @@ -2,6 +2,7 @@ #define _TEST_BASIC_H_ #include "cocos2d.h" +#include "3d/cocos3d.h" #include "audio/include/SimpleAudioEngine.h" #include "VisibleRect.h" diff --git a/tests/cpp-tests/proj.win32/cpp-tests.vcxproj b/tests/cpp-tests/proj.win32/cpp-tests.vcxproj index 27cc2c0735..cd2cbd3f0a 100644 --- a/tests/cpp-tests/proj.win32/cpp-tests.vcxproj +++ b/tests/cpp-tests/proj.win32/cpp-tests.vcxproj @@ -567,6 +567,9 @@ {98a51ba8-fc3a-415b-ac8f-8c7bd464e93e} + + {e24950fa-5bc1-4aee-a900-4f0259354bf0} + {f8edd7fa-9a51-4e80-baeb-860825d2eac6}