mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-15 08:34:40 +00:00
update bullet so it actually works
Moved the addSourceDirectory for physics/Bullet into the Engine/Source/CMakeLists.txt file that way it can actually appear where we expect it to in the solution explorer.
This commit is contained in:
parent
c7be48130a
commit
13fa178cf6
5986 changed files with 1811270 additions and 453803 deletions
25
Engine/lib/bullet/test/BulletDynamics/CMakeLists.txt
Normal file
25
Engine/lib/bullet/test/BulletDynamics/CMakeLists.txt
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
SUBDIRS(pendulum )
|
||||
|
||||
INCLUDE_DIRECTORIES(
|
||||
"${PROJECT_SOURCE_DIR}/src"
|
||||
"${PROJECT_SOURCE_DIR}/test/gtest-1.7.0/include")
|
||||
|
||||
ADD_DEFINITIONS(-DUSE_GTEST)
|
||||
ADD_DEFINITIONS(-D_VARIADIC_MAX=10)
|
||||
|
||||
LINK_LIBRARIES(BulletDynamics BulletCollision LinearMath gtest)
|
||||
|
||||
IF (NOT WIN32)
|
||||
FIND_PACKAGE(Threads)
|
||||
LINK_LIBRARIES( ${CMAKE_THREAD_LIBS_INIT} )
|
||||
ENDIF()
|
||||
|
||||
ADD_EXECUTABLE(Test_btKinematicCharacterController test_btKinematicCharacterController.cpp)
|
||||
|
||||
ADD_TEST(Test_btKinematicCharacterController_PASS Test_btKinematicCharacterController)
|
||||
|
||||
IF (INTERNAL_ADD_POSTFIX_EXECUTABLE_NAMES)
|
||||
SET_TARGET_PROPERTIES(Test_btKinematicCharacterController PROPERTIES DEBUG_POSTFIX "_Debug")
|
||||
SET_TARGET_PROPERTIES(Test_btKinematicCharacterController PROPERTIES MINSIZEREL_POSTFIX "_MinsizeRel")
|
||||
SET_TARGET_PROPERTIES(Test_btKinematicCharacterController PROPERTIES RELWITHDEBINFO_POSTFIX "_RelWithDebugInfo")
|
||||
ENDIF(INTERNAL_ADD_POSTFIX_EXECUTABLE_NAMES)
|
||||
|
|
@ -14,7 +14,8 @@ LINK_LIBRARIES(
|
|||
)
|
||||
|
||||
IF (NOT WIN32)
|
||||
LINK_LIBRARIES( pthread )
|
||||
FIND_PACKAGE(Threads)
|
||||
LINK_LIBRARIES( ${CMAKE_THREAD_LIBS_INIT} )
|
||||
ENDIF()
|
||||
|
||||
ADD_EXECUTABLE(Test_BulletDynamics
|
||||
|
|
|
|||
|
|
@ -0,0 +1,26 @@
|
|||
|
||||
|
||||
#include <btBulletDynamicsCommon.h>
|
||||
#include <BulletDynamics/Character/btKinematicCharacterController.h>
|
||||
#include <gtest/gtest.h>
|
||||
#include <BulletCollision/CollisionDispatch/btGhostObject.h>
|
||||
|
||||
GTEST_TEST(BulletDynamics, KinematicCharacterController)
|
||||
{
|
||||
btPairCachingGhostObject* ghostObject = new btPairCachingGhostObject();
|
||||
btBoxShape* convexShape = new btBoxShape(btVector3(1, 1, 1));
|
||||
|
||||
//For now only a simple test that it initializes correctly.
|
||||
btKinematicCharacterController* tested = new btKinematicCharacterController(ghostObject, convexShape, 1);
|
||||
EXPECT_TRUE(tested);
|
||||
|
||||
EXPECT_FLOAT_EQ(-9.8 * 3.0, tested->getGravity().x());
|
||||
EXPECT_FLOAT_EQ(0, tested->getGravity().y());
|
||||
EXPECT_FLOAT_EQ(0, tested->getGravity().z());
|
||||
}
|
||||
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
::testing::InitGoogleTest(&argc, argv);
|
||||
return RUN_ALL_TESTS();
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue