Skip to content

Commit

Permalink
#80 Init Collision Project
Browse files Browse the repository at this point in the history
  • Loading branch information
ducphamhong committed Sep 30, 2021
1 parent df1f47a commit fd2be2b
Show file tree
Hide file tree
Showing 27 changed files with 282 additions and 188 deletions.
14 changes: 2 additions & 12 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,6 @@ if (NOT BUILD_SHARED_LIBS)
endif()

# skylicht engine option
option(BUILD_SKYLICHT_NETWORK "Build Skylicht Network" ON)

option(BUILD_DEBUG_VLD "Build with debug visual leak detector" OFF)

option(BUILD_SDL "Build with Simple DirectMedia Layer is a cross-platform development library" OFF)
Expand All @@ -111,11 +109,6 @@ if (BUILD_FREETYPE)
add_definitions(-DFT2_BUILD_LIBRARY)
endif()

# skylicht network
if (BUILD_SKYLICHT_NETWORK)
add_definitions(-DUSE_SKYLICHT_NETWORK)
endif()

# skylicht debug leak memory
if (BUILD_DEBUG_VLD AND MSVC)
add_definitions(-DUSE_VISUAL_LEAK_DETECTOR)
Expand Down Expand Up @@ -289,14 +282,11 @@ endif()
subdirs (Projects/Skylicht/System)
subdirs (Projects/Skylicht/Engine)
subdirs (Projects/Skylicht/Components)
subdirs (Projects/Skylicht/Collision)
subdirs (Projects/Skylicht/Physics)
subdirs (Projects/Skylicht/Lightmapper)
subdirs (Projects/Skylicht/Audio)
subdirs (Projects/Skylicht/Crypto)
#subdirs (Projects/Skylicht/Physics)

#if (BUILD_SKYLICHT_NETWORK)
#subdirs (Projects/Skylicht/Network)
#endif()

subdirs (Projects/Skylicht/Client)

Expand Down
7 changes: 4 additions & 3 deletions Projects/Skylicht/Client/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@ include_directories(
${SKYLICHT_ENGINE_SOURCE_DIR}/Projects/Irrlicht/Include
${SKYLICHT_ENGINE_SOURCE_DIR}/Projects/Skylicht/Engine/Source
${SKYLICHT_ENGINE_SOURCE_DIR}/Projects/Skylicht/Components/Source
${SKYLICHT_ENGINE_SOURCE_DIR}/Projects/Skylicht/Collision/Source
${SKYLICHT_ENGINE_SOURCE_DIR}/Projects/Skylicht/Physics/Source
${SKYLICHT_ENGINE_SOURCE_DIR}/Projects/Skylicht/Lightmapper/Source
${SKYLICHT_ENGINE_SOURCE_DIR}/Projects/Skylicht/Audio/Source
#${SKYLICHT_ENGINE_SOURCE_DIR}/Projects/Skylicht/Physics/Source
${SKYLICHT_ENGINE_SOURCE_DIR}/Projects/Skylicht/Audio/Source
)

if (BUILD_DEBUG_VLD)
Expand Down Expand Up @@ -35,7 +36,7 @@ target_precompiled_header(Client ./Source/pch.cpp ${skylicht_client_source})

set_target_properties(Client PROPERTIES VERSION ${SKYLICHT_VERSION})

target_link_libraries(Client Engine Components Lightmapper)
target_link_libraries(Client Engine Components Collision Physics Lightmapper)

if (BUILD_DEBUG_VLD)
target_link_libraries(Client vld)
Expand Down
32 changes: 32 additions & 0 deletions Projects/Skylicht/Collision/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
include_directories(
${SKYLICHT_ENGINE_SOURCE_DIR}/Projects/Skylicht/Collision/Source
${SKYLICHT_ENGINE_SOURCE_DIR}/Projects/Irrlicht/Include
${SKYLICHT_ENGINE_SOURCE_DIR}/Projects/Irrlicht/Source
${SKYLICHT_ENGINE_SOURCE_DIR}/Projects/ThirdParty/source/curl/include
${SKYLICHT_ENGINE_SOURCE_DIR}/Projects/Skylicht/System/Source
${SKYLICHT_ENGINE_SOURCE_DIR}/Projects/Skylicht/Audio/Source
${SKYLICHT_ENGINE_SOURCE_DIR}/Projects/Skylicht/Engine/Source
)

file(GLOB_RECURSE skylicht_collision
./Source/*.cpp
./Source/*.hpp
./Source/*.c
./Source/*.h)
setup_project_group("${skylicht_collision}" ${CMAKE_CURRENT_SOURCE_DIR})

add_library(Collision STATIC
${skylicht_collision}
)

target_precompiled_header(Collision ./Source/pch.cpp ${skylicht_collision})

set_target_properties(Collision PROPERTIES VERSION ${SKYLICHT_VERSION})

if (BUILD_EMSCRIPTEN)
target_link_libraries(Collision Engine System)
elseif(MSVC)
target_link_libraries(Collision Engine System)
elseif(CYGWIN OR MINGW)
target_link_libraries(Collision Engine System)
endif()
6 changes: 6 additions & 0 deletions Projects/Skylicht/Collision/Source/pch.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
//
// pch.cpp
// Include the standard header and generate the precompiled header.
//

#include "pch.h"
79 changes: 79 additions & 0 deletions Projects/Skylicht/Collision/Source/pch.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
//
// pch.h
// Header for standard system include files.
//

#pragma once

#if defined(_WIN32)

#ifdef USE_SKYLICHT_NETWORK
#include <Ws2tcpip.h>
#include <Winsock2.h>
#endif

#include <memory.h>
#include <stdlib.h>

// Windows Header Files:
#include <windows.h>
#else
#include <memory.h>
#include <unistd.h>

#ifdef USE_SKYLICHT_NETWORK
#include <netinet/in.h>
#include <net/if.h>
#include <arpa/inet.h>
#include <fcntl.h>
#include <errno.h>
#include <sys/ioctl.h>
#include <sys/types.h>
#include <sys/select.h>
#include <sys/socket.h>
#include <netdb.h>
#endif

#define SOCKET int
#define INVALID_SOCKET -1
#define SOCKET_ERROR -1
#endif

// IRRLICHT 3D ENGINE
#include "irrlicht.h"
#include "IRandomizer.h"
#include "ILogger.h"
#include "irrOS.h"

using namespace irr;
using namespace irr::scene;
using namespace irr::video;

// SPARK ENGINE
// #include "SPK.h"
// #include "SPK_IRR.h"


// STL C++
#include <algorithm>
#include <vector>
#include <list>
#include <map>
#include <stack>
#include <queue>
#include <fstream>
#include <string>

namespace Skylicht
{

// getIrrlichtDevice
extern IrrlichtDevice* getIrrlichtDevice();

// getVideoDriver
extern IVideoDriver* getVideoDriver();

// getTimeStep
extern float getTimeStep();

}
32 changes: 32 additions & 0 deletions Projects/Skylicht/Physics/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
include_directories(
${SKYLICHT_ENGINE_SOURCE_DIR}/Projects/Skylicht/Physics/Source
${SKYLICHT_ENGINE_SOURCE_DIR}/Projects/Irrlicht/Include
${SKYLICHT_ENGINE_SOURCE_DIR}/Projects/Irrlicht/Source
${SKYLICHT_ENGINE_SOURCE_DIR}/Projects/ThirdParty/source/curl/include
${SKYLICHT_ENGINE_SOURCE_DIR}/Projects/Skylicht/System/Source
${SKYLICHT_ENGINE_SOURCE_DIR}/Projects/Skylicht/Audio/Source
${SKYLICHT_ENGINE_SOURCE_DIR}/Projects/Skylicht/Engine/Source
)

file(GLOB_RECURSE skylicht_physics
./Source/*.cpp
./Source/*.hpp
./Source/*.c
./Source/*.h)
setup_project_group("${skylicht_physics}" ${CMAKE_CURRENT_SOURCE_DIR})

add_library(Physics STATIC
${skylicht_physics}
)

target_precompiled_header(Physics ./Source/pch.cpp ${skylicht_physics})

set_target_properties(Physics PROPERTIES VERSION ${SKYLICHT_VERSION})

if (BUILD_EMSCRIPTEN)
target_link_libraries(Physics Engine System)
elseif(MSVC)
target_link_libraries(Physics Engine System)
elseif(CYGWIN OR MINGW)
target_link_libraries(Physics Engine System)
endif()
6 changes: 6 additions & 0 deletions Projects/Skylicht/Physics/Source/pch.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
//
// pch.cpp
// Include the standard header and generate the precompiled header.
//

#include "pch.h"
79 changes: 79 additions & 0 deletions Projects/Skylicht/Physics/Source/pch.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
//
// pch.h
// Header for standard system include files.
//

#pragma once

#if defined(_WIN32)

#ifdef USE_SKYLICHT_NETWORK
#include <Ws2tcpip.h>
#include <Winsock2.h>
#endif

#include <memory.h>
#include <stdlib.h>

// Windows Header Files:
#include <windows.h>
#else
#include <memory.h>
#include <unistd.h>

#ifdef USE_SKYLICHT_NETWORK
#include <netinet/in.h>
#include <net/if.h>
#include <arpa/inet.h>
#include <fcntl.h>
#include <errno.h>
#include <sys/ioctl.h>
#include <sys/types.h>
#include <sys/select.h>
#include <sys/socket.h>
#include <netdb.h>
#endif

#define SOCKET int
#define INVALID_SOCKET -1
#define SOCKET_ERROR -1
#endif

// IRRLICHT 3D ENGINE
#include "irrlicht.h"
#include "IRandomizer.h"
#include "ILogger.h"
#include "irrOS.h"

using namespace irr;
using namespace irr::scene;
using namespace irr::video;

// SPARK ENGINE
// #include "SPK.h"
// #include "SPK_IRR.h"


// STL C++
#include <algorithm>
#include <vector>
#include <list>
#include <map>
#include <stack>
#include <queue>
#include <fstream>
#include <string>

namespace Skylicht
{

// getIrrlichtDevice
extern IrrlichtDevice* getIrrlichtDevice();

// getVideoDriver
extern IVideoDriver* getVideoDriver();

// getTimeStep
extern float getTimeStep();

}
13 changes: 3 additions & 10 deletions Samples/Audio/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@ include_directories(
${SKYLICHT_ENGINE_SOURCE_DIR}/Projects/Skylicht/System/Source
${SKYLICHT_ENGINE_SOURCE_DIR}/Projects/Skylicht/Engine/Source
${SKYLICHT_ENGINE_SOURCE_DIR}/Projects/Skylicht/Components/Source
${SKYLICHT_ENGINE_SOURCE_DIR}/Projects/Skylicht/Collision/Source
${SKYLICHT_ENGINE_SOURCE_DIR}/Projects/Skylicht/Physics/Source
${SKYLICHT_ENGINE_SOURCE_DIR}/Projects/Skylicht/Client/Source
${SKYLICHT_ENGINE_SOURCE_DIR}/Projects/Skylicht/Lightmapper/Source
${SKYLICHT_ENGINE_SOURCE_DIR}/Projects/Skylicht/Audio/Source
#${SKYLICHT_ENGINE_SOURCE_DIR}/Projects/Skylicht/Physics/Source
${SKYLICHT_ENGINE_SOURCE_DIR}/Projects/Skylicht/Audio/Source
)

if (BUILD_FREETYPE)
Expand Down Expand Up @@ -106,14 +107,6 @@ if (BUILD_MACOS)

setup_project_group("${platform_mac_source}" ${CMAKE_CURRENT_SOURCE_DIR})
endif()

#if (BUILD_SKYLICHT_NETWORK)
#include_directories(${SKYLICHT_ENGINE_SOURCE_DIR}/Projects/SkylichtNetwork/Source)
#endif()

#if(BUILD_RECAST_NAVIGATION_LIB)
#include_directories(${SKYLICHT_ENGINE_SOURCE_DIR}/Projects/RecastNavigation/Source)
#endif()

if (BUILD_DEBUG_VLD)
if (CMAKE_CL_64)
Expand Down
11 changes: 2 additions & 9 deletions Samples/DrawPrimitives/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@ include_directories(
${SKYLICHT_ENGINE_SOURCE_DIR}/Projects/Skylicht/System/Source
${SKYLICHT_ENGINE_SOURCE_DIR}/Projects/Skylicht/Engine/Source
${SKYLICHT_ENGINE_SOURCE_DIR}/Projects/Skylicht/Components/Source
${SKYLICHT_ENGINE_SOURCE_DIR}/Projects/Skylicht/Collision/Source
${SKYLICHT_ENGINE_SOURCE_DIR}/Projects/Skylicht/Physics/Source
${SKYLICHT_ENGINE_SOURCE_DIR}/Projects/Skylicht/Client/Source
${SKYLICHT_ENGINE_SOURCE_DIR}/Projects/Skylicht/Lightmapper/Source
${SKYLICHT_ENGINE_SOURCE_DIR}/Projects/Skylicht/Audio/Source
#${SKYLICHT_ENGINE_SOURCE_DIR}/Projects/Skylicht/Physics/Source
)

if (BUILD_FREETYPE)
Expand Down Expand Up @@ -104,14 +105,6 @@ if (BUILD_MACOS)

setup_project_group("${platform_mac_source}" ${CMAKE_CURRENT_SOURCE_DIR})
endif()

#if (BUILD_SKYLICHT_NETWORK)
#include_directories(${SKYLICHT_ENGINE_SOURCE_DIR}/Projects/SkylichtNetwork/Source)
#endif()

#if(BUILD_RECAST_NAVIGATION_LIB)
#include_directories(${SKYLICHT_ENGINE_SOURCE_DIR}/Projects/RecastNavigation/Source)
#endif()

if (BUILD_DEBUG_VLD)
if (CMAKE_CL_64)
Expand Down
11 changes: 2 additions & 9 deletions Samples/HelloWorld/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@ include_directories(
${SKYLICHT_ENGINE_SOURCE_DIR}/Projects/Skylicht/System/Source
${SKYLICHT_ENGINE_SOURCE_DIR}/Projects/Skylicht/Engine/Source
${SKYLICHT_ENGINE_SOURCE_DIR}/Projects/Skylicht/Components/Source
${SKYLICHT_ENGINE_SOURCE_DIR}/Projects/Skylicht/Collision/Source
${SKYLICHT_ENGINE_SOURCE_DIR}/Projects/Skylicht/Physics/Source
${SKYLICHT_ENGINE_SOURCE_DIR}/Projects/Skylicht/Client/Source
${SKYLICHT_ENGINE_SOURCE_DIR}/Projects/Skylicht/Lightmapper/Source
${SKYLICHT_ENGINE_SOURCE_DIR}/Projects/Skylicht/Audio/Source
#${SKYLICHT_ENGINE_SOURCE_DIR}/Projects/Skylicht/Physics/Source
)

if (BUILD_FREETYPE)
Expand Down Expand Up @@ -104,14 +105,6 @@ if (BUILD_MACOS)

setup_project_group("${platform_mac_source}" ${CMAKE_CURRENT_SOURCE_DIR})
endif()

#if (BUILD_SKYLICHT_NETWORK)
#include_directories(${SKYLICHT_ENGINE_SOURCE_DIR}/Projects/SkylichtNetwork/Source)
#endif()

#if(BUILD_RECAST_NAVIGATION_LIB)
#include_directories(${SKYLICHT_ENGINE_SOURCE_DIR}/Projects/RecastNavigation/Source)
#endif()

if (BUILD_DEBUG_VLD)
if (CMAKE_CL_64)
Expand Down
Loading

0 comments on commit fd2be2b

Please sign in to comment.