mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
More bullet + windows + cmake fun.
This commit is contained in:
parent
1423b91871
commit
ae0849764e
@ -4,7 +4,7 @@ project (ACE)
|
||||
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
|
||||
|
||||
if(WIN32)
|
||||
add_definitions(/DWINVER=0x0600)
|
||||
add_definitions(/DWINVER=0x0600 /D_WIN32_WINNT=0x0600)
|
||||
endif()
|
||||
|
||||
if (NOT CMAKE_BUILD_TYPE AND CMAKE_COMPILER_IS_GNUCXX)
|
||||
@ -34,7 +34,23 @@ include_directories("common")
|
||||
|
||||
if(USE_BULLET)
|
||||
# Dependencies
|
||||
add_subdirectory(lib/bullet3)
|
||||
#
|
||||
add_definitions(-DUSE_DIRECTX)
|
||||
add_definitions(-DBUILD_BULLET2_DEMOS=false -DBUILD_UNIT_TESTS=false -DBUILD_BULLET3_DEMOS=false -DBUILD_CPU_DEMOS=false -DBUILD_EXTRAS=false)
|
||||
add_subdirectory(lib/bullet3 EXCLUDE_FROM_ALL)
|
||||
#set(depname bullet3)
|
||||
#set(${depname}_PREFIX "lib/${depname}")
|
||||
#set(${depname}_INSTALL_DIR "${CMAKE_CURRENT_SOURCE_DIR}/binaries/${CMAKE_SYSTEM_NAME}${CMAKE_CXX_COMPILER_ID}${KINEVOX_ARCHITECTURE}/usr/local/")
|
||||
#set(${depname}_CMAKE_ARGS -DBUILD_SHARED_LIBS=true -DCMAKE_INSTALL_PREFIX=${${depname}_INSTALL_DIR} -DBUILD_BULLET2_DEMOS=false -DBUILD_UNIT_TESTS=false -DBUILD_BULLET3_DEMOS=false -DBUILD_CPU_DEMOS=false -DBUILD_EXTRAS=false -DINSTALL_LIBS=true ${EXTRA_ARGS})
|
||||
#ExternalProject_Add(
|
||||
# ${depname}
|
||||
# PREFIX ${${depname}_PREFIX}
|
||||
# GIT_REPOSITORY https://github.com/bulletphysics/bullet3.git lib/${depname}
|
||||
# SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/${depname}
|
||||
# INSTALL_DIR ${${depname}_INSTALL_DIR}
|
||||
# CMAKE_ARGS ${${depname}_CMAKE_ARGS}
|
||||
#)
|
||||
|
||||
set_target_properties(App_BasicExample PROPERTIES FOLDER Bullet3)
|
||||
set_target_properties(App_HelloWorld PROPERTIES FOLDER Bullet3)
|
||||
set_target_properties(App_ExampleBrowser PROPERTIES FOLDER Bullet3)
|
||||
@ -67,6 +83,7 @@ else()
|
||||
set(BULLET_LIBS "")
|
||||
endif()
|
||||
if(USE_DIRECTX)
|
||||
add_definitions(-DUSE_DIRECTX)
|
||||
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake ${CMAKE_MODULE_PATH})
|
||||
find_package (DirectX)
|
||||
link_directories (BEFORE ${DirectX_D3DX11_LIBRARY})
|
||||
|
@ -1,7 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
#ifdef _WIN32
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
// #define WIN32_LEAN_AND_MEAN
|
||||
#include <windows.h>
|
||||
#else
|
||||
|
||||
|
@ -15,15 +15,10 @@ if(USE_DIRECTX)
|
||||
add_dependencies(ace_vd_ext_test ace_common ace_vd_static)
|
||||
target_link_libraries(ace_vd_ext_test ace_common directxtk
|
||||
ace_vd_static
|
||||
${DirectX_D3DX11_LIBRARY} ${DirectX_D3D11_LIBRARY} ${DirectX_D3D11_1_LIBRARY} ${DirectX_D3D11_2_LIBRARY}
|
||||
${BULLET_LIBS_DEBUG}
|
||||
)
|
||||
${DirectX_D3DX11_LIBRARY} ${DirectX_D3D11_LIBRARY} ${DirectX_D3D11_1_LIBRARY} ${DirectX_D3D11_2_LIBRARY} BulletDynamics BulletCollision LinaerMath)
|
||||
else()
|
||||
add_dependencies(ace_vd_ext_test ace_common ace_vd_static)
|
||||
target_link_libraries(ace_vd_ext_test ace_common
|
||||
${BULLET_LIBS_DEBUG}
|
||||
ace_vd_static
|
||||
)
|
||||
target_link_libraries(ace_vd_ext_test ace_common BulletDynamics BulletCollision LinaerMath ace_vd_static)
|
||||
endif()
|
||||
set_target_properties(ace_vd_ext_test PROPERTIES PREFIX "")
|
||||
set_target_properties(ace_vd_ext_test PROPERTIES FOLDER Tests)
|
||||
@ -38,14 +33,10 @@ if(USE_DIRECTX)
|
||||
add_dependencies(ace_longrod_dxtk_test ace_common ace_vd_static)
|
||||
target_link_libraries(ace_longrod_dxtk_test ace_common directxtk
|
||||
ace_vd_static
|
||||
${DirectX_D3DX11_LIBRARY} ${DirectX_D3D11_LIBRARY} ${DirectX_D3D11_1_LIBRARY} ${DirectX_D3D11_2_LIBRARY}
|
||||
${BULLET_LIBS_DEBUG}
|
||||
)
|
||||
${DirectX_D3DX11_LIBRARY} ${DirectX_D3D11_LIBRARY} ${DirectX_D3D11_1_LIBRARY} ${DirectX_D3D11_2_LIBRARY} BulletDynamics BulletCollision LinaerMath)
|
||||
else()
|
||||
add_dependencies(ace_longrod_dxtk_test ace_common ace_vd_static)
|
||||
target_link_libraries(ace_longrod_dxtk_test ace_common
|
||||
${BULLET_LIBS_DEBUG}
|
||||
ace_vd_static
|
||||
target_link_libraries(ace_longrod_dxtk_test ace_common BulletDynamics BulletCollision LinaerMath ace_vd_static
|
||||
)
|
||||
endif()
|
||||
set_target_properties(ace_longrod_dxtk_test PROPERTIES PREFIX "")
|
||||
@ -58,18 +49,14 @@ set_target_properties(ace_longrod_dxtk_test PROPERTIES FOLDER Tests)
|
||||
if(USE_DIRECTX)
|
||||
add_executable( ace_test_render test_render.cpp test_render.hpp)
|
||||
target_link_libraries(ace_test_render ace_common
|
||||
${DirectX_D3DX11_LIBRARY} ${DirectX_D3D11_LIBRARY} ${DirectX_D3D11_1_LIBRARY} ${DirectX_D3D11_2_LIBRARY}
|
||||
${BULLET_LIBS_DEBUG}
|
||||
)
|
||||
${DirectX_D3DX11_LIBRARY} ${DirectX_D3D11_LIBRARY} ${DirectX_D3D11_1_LIBRARY} ${DirectX_D3D11_2_LIBRARY} BulletDynamics BulletCollision LinaerMath )
|
||||
add_dependencies(ace_test_render ace_common)
|
||||
SET_TARGET_PROPERTIES(ace_test_render PROPERTIES PREFIX "")
|
||||
set_target_properties(ace_test_render PROPERTIES FOLDER Tests)
|
||||
|
||||
add_executable( ace_dxtk_test dxtk_test.cpp)
|
||||
target_link_libraries(ace_dxtk_test ace_common directxtk
|
||||
${DirectX_D3DX11_LIBRARY} ${DirectX_D3D11_LIBRARY} ${DirectX_D3D11_1_LIBRARY} ${DirectX_D3D11_2_LIBRARY}
|
||||
${BULLET_LIBS_DEBUG}
|
||||
)
|
||||
${DirectX_D3DX11_LIBRARY} ${DirectX_D3D11_LIBRARY} ${DirectX_D3D11_1_LIBRARY} ${DirectX_D3D11_2_LIBRARY} BulletDynamics BulletCollision LinaerMath)
|
||||
add_dependencies(ace_dxtk_test ace_common directxtk)
|
||||
|
||||
SET_TARGET_PROPERTIES(ace_dxtk_test PROPERTIES PREFIX "")
|
||||
|
@ -17,16 +17,14 @@ add_library( ${ACE_EXTENSION_NAME} SHARED ${DEBUG_SOURCES} ${SOURCES} ${DAMAGE_S
|
||||
add_library( ${ACE_EXTENSION_NAME}_static STATIC ${DEBUG_SOURCES} ${SOURCES} ${DAMAGE_SOURCES} ${PENETRATION_SOURCES} ${GLOBAL_SOURCES})
|
||||
include_directories(${CMAKE_CURRENT_SOURCE_DIR})
|
||||
|
||||
if(USE_BULLET)
|
||||
set(BULLET_LIBS ${BULLET_LIBS_DEBUG})
|
||||
else()
|
||||
if(NOT USE_BULLET)
|
||||
message(FATAL_ERROR "Bullet is required for vehicle damage!\nYou need to build out the bullet3 folder and define -DUSE_BULLET=On")
|
||||
endif()
|
||||
|
||||
if(DEVEL AND USE_DIRECTX)
|
||||
set(LINK_LIBS directxtk ${BULLET_LIBS_DEBUG} ${DirectX_D3DX11_LIBRARY} ${DirectX_D3D11_LIBRARY} ${DirectX_D3D11_1_LIBRARY} ${DirectX_D3D11_2_LIBRARY})
|
||||
set(LINK_LIBS directxtk BulletDynamics BulletCollision LinaerMath ${DirectX_D3DX11_LIBRARY} ${DirectX_D3D11_LIBRARY} ${DirectX_D3D11_1_LIBRARY} ${DirectX_D3D11_2_LIBRARY})
|
||||
else()
|
||||
set(LINK_LIBS ${BULLET_LIBS_DEBUG})
|
||||
set(LINK_LIBS BulletDynamics BulletCollision LinaerMath)
|
||||
endif()
|
||||
|
||||
target_link_libraries(${ACE_EXTENSION_NAME} ace_common ${LINK_LIBS})
|
||||
|
@ -21,7 +21,7 @@ namespace ace {
|
||||
}
|
||||
if (fire_lod == -1) // @TODO: fallback on geo LOD
|
||||
fire_lod = 0;
|
||||
//fire_lod = 0;
|
||||
fire_lod = 0;
|
||||
assert(fire_lod != -1);
|
||||
|
||||
// Build the mesh from object faces
|
||||
|
Loading…
Reference in New Issue
Block a user