more cmake support for examples
This commit is contained in:
@@ -1 +1 @@
|
|||||||
SUBDIRS( HelloWorld BasicDemo )
|
SUBDIRS( ExampleBrowser HelloWorld BasicDemo ThirdPartyLibs/gwen OpenGLWindow)
|
||||||
@@ -1,103 +1,108 @@
|
|||||||
|
|
||||||
|
|
||||||
INCLUDE_DIRECTORIES(
|
INCLUDE_DIRECTORIES(
|
||||||
|
.
|
||||||
${BULLET_PHYSICS_SOURCE_DIR}/src
|
${BULLET_PHYSICS_SOURCE_DIR}/src
|
||||||
${BULLET_PHYSICS_SOURCE_DIR}/btgui
|
${BULLET_PHYSICS_SOURCE_DIR}/examples/ThirdPartyLibs
|
||||||
${BULLET_PHYSICS_SOURCE_DIR}/btgui/lua-5.2.3/src
|
|
||||||
${BULLET_PHYSICS_SOURCE_DIR}/Demos3/FiniteElementMethod
|
|
||||||
)
|
)
|
||||||
|
|
||||||
SET(App_AllBullet2Demos_SRCS
|
FILE(GLOB ExampleBrowser_SRCS "*" "GwenGUISupport/*" )
|
||||||
|
FILE(GLOB ExampleBrowser_HDRS "*" "GwenGUISupport/*" )
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
SET(App_ExampleBrowser_SRCS
|
||||||
main.cpp
|
main.cpp
|
||||||
BulletDemoEntries.h
|
ExampleEntries.cpp
|
||||||
../../Demos/BasicDemo/BasicDemoPhysicsSetup.cpp
|
ExampleEntries.h
|
||||||
../../Demos/BasicDemo/BasicDemoPhysicsSetup.h
|
../BasicDemo/BasicExample.cpp
|
||||||
../../Demos/CcdPhysicsDemo/CcdPhysicsSetup.cpp
|
../BasicDemo/BasicExample.h
|
||||||
../../Demos/CcdPhysicsDemo/CcdPhysicsSetup.h
|
../ForkLift/ForkLiftDemo.cpp
|
||||||
../../Demos/Raytracer/RaytracerSetup.cpp
|
../ForkLift/ForkLiftDemo.h
|
||||||
../../Demos/Raytracer/RaytracerSetup.h
|
../GyroscopicDemo/GyroscopicSetup.cpp
|
||||||
../../Demos/GyroscopicDemo/GyroscopicSetup.cpp
|
../GyroscopicDemo/GyroscopicSetup.h
|
||||||
../../Demos/GyroscopicDemo/GyroscopicSetup.h
|
../Planar2D/Planar2D.cpp
|
||||||
../../Demos/ForkLiftDemo/ForkLiftPhysicsSetup.cpp
|
../Planar2D/Planar2D.h
|
||||||
../../Demos/ForkLiftDemo/ForkLiftPhysicsSetup.h
|
../RenderingExamples/CoordinateSystemDemo.cpp
|
||||||
../../Demos/SerializeDemo/SerializeSetup.cpp
|
../RenderingExamples/CoordinateSystemDemo.h
|
||||||
../../Extras/Serialize/BulletFileLoader/bChunk.cpp
|
../RenderingExamples/RaytracerSetup.cpp
|
||||||
../../Extras/Serialize/BulletFileLoader/bDNA.cpp
|
../RenderingExamples/RaytracerSetup.h
|
||||||
../../Extras/Serialize/BulletFileLoader/bFile.cpp
|
../RenderingExamples/RenderInstancingDemo.cpp
|
||||||
../../Extras/Serialize/BulletFileLoader/btBulletFile.cpp
|
../RenderingExamples/RenderInstancingDemo.h
|
||||||
../../Extras/Serialize/BulletWorldImporter/btBulletWorldImporter.cpp
|
../Benchmarks/BenchmarkDemo.cpp
|
||||||
../../Extras/Serialize/BulletWorldImporter/btWorldImporter.cpp
|
../Benchmarks/BenchmarkDemo.h
|
||||||
../bullet2/MultiBodyDemo/TestJointTorqueSetup.cpp
|
../Benchmarks/landscapeData.h
|
||||||
../bullet2/MultiBodyDemo/MultiBodyVehicle.cpp
|
../Benchmarks/TaruData
|
||||||
../bullet2/ConstraintDemo/ConstraintPhysicsSetup.cpp
|
../Importers/ImportBsp/BspConverter.h
|
||||||
../bullet2/ConstraintDemo/ConstraintPhysicsSetup.h
|
../Importers/ImportBsp/BspLoader.h
|
||||||
../bullet2/ConstraintDemo/Dof6Spring2Setup.cpp
|
../Importers/ImportBsp/ImportBspExample.h
|
||||||
../bullet2/ConstraintDemo/Dof6Spring2Setup.h
|
../Importers/ImportColladaDemo/btMatrix4x4.h
|
||||||
../bullet2/CoordinateFrameDemo/CoordinateFrameDemoPhysicsSetup.cpp
|
../Importers/ImportColladaDemo/ColladaGraphicsInstance.h
|
||||||
../bullet2/CoordinateFrameDemo/CoordinateFrameDemoPhysicsSetup.h
|
../Importers/ImportColladaDemo/ImportColladaSetup.h
|
||||||
../bullet2/FeatherstoneMultiBodyDemo/BulletMultiBodyDemos.cpp
|
../Importers/ImportColladaDemo/LoadMeshFromCollada.h
|
||||||
../bullet2/FeatherstoneMultiBodyDemo/BulletMultiBodyDemos.h
|
../Importers/ImportObjDemo/ImportObjExample.h
|
||||||
../bullet2/FeatherstoneMultiBodyDemo/MultiDofDemo.cpp
|
../Importers/ImportObjDemo/LoadMeshFromObj.h
|
||||||
../bullet2/FeatherstoneMultiBodyDemo/MultiDofDemo.h
|
../Importers/ImportObjDemo/Wavefront2GLInstanceGraphicsShape.h
|
||||||
../bullet2/BasicDemo/BasicDemo.cpp
|
../Importers/ImportSTLDemo/ImportSTLSetup.h
|
||||||
../bullet2/BasicDemo/BasicDemo.h
|
../Importers/ImportSTLDemo/LoadMeshFromSTL.h
|
||||||
# ../bullet2/SoftDemo/SoftDemo.cpp
|
../Importers/ImportURDFDemo/ConvertRigidBodies2MultiBody.h
|
||||||
# the next few demos are not converted to 'newer' structure yet
|
../Importers/ImportURDFDemo/ImportURDFSetup.h
|
||||||
# target is to convert all Bullet 2 demos in new structure but need to settle down on features
|
../Importers/ImportURDFDemo/URDF2Bullet.h
|
||||||
# ../bullet2/BasicDemo/HingeDemo.cpp
|
../Importers/ImportURDFDemo/urdf_samples.h
|
||||||
# ../bullet2/BasicDemo/HingeDemo.h
|
../Importers/ImportBsp/BspConverter.cpp
|
||||||
# ../bullet2/ChainDemo/ChainDemo.cpp
|
../Importers/ImportBsp/BspLoader.cpp
|
||||||
# ../bullet2/ChainDemo/ChainDemo.h
|
../Importers/ImportBsp/ImportBspExample.cpp
|
||||||
# ../bullet2/RagdollDemo/RagdollDemo.cpp
|
../Importers/ImportColladaDemo/ImportColladaSetup.cpp
|
||||||
# ../bullet2/RagdollDemo/RagdollDemo.h
|
../Importers/ImportColladaDemo/LoadMeshFromCollada.cpp
|
||||||
../bullet2/LuaDemo/LuaPhysicsSetup.cpp
|
../Importers/ImportObjDemo/ImportObjExample.cpp
|
||||||
../bullet2/LuaDemo/LuaPhysicsSetup.h
|
../Importers/ImportObjDemo/LoadMeshFromObj.cpp
|
||||||
../ImportURDFDemo/URDF2Bullet.cpp
|
../Importers/ImportObjDemo/Wavefront2GLInstanceGraphicsShape.cpp
|
||||||
../ImportURDFDemo/ImportURDFSetup.cpp
|
../Importers/ImportSTLDemo/ImportSTLSetup.cpp
|
||||||
../ImportURDFDemo/ImportURDFSetup.h
|
../Importers/ImportURDFDemo/ImportURDFSetup.cpp
|
||||||
../ImportObjDemo/ImportObjSetup.cpp
|
../Importers/ImportURDFDemo/URDF2Bullet.cpp
|
||||||
../ImportObjDemo/LoadMeshFromObj.cpp
|
|
||||||
../ImportObjDemo/LoadMeshFromObj.h
|
../ThirdPartyLibs/Wavefront/tiny_obj_loader.cpp
|
||||||
../ImportObjDemo/Wavefront2GLInstanceGraphicsShape.cpp
|
../ThirdPartyLibs/tinyxml/tinystr.cpp
|
||||||
../ImportColladaDemo/ImportColladaSetup.cpp
|
../ThirdPartyLibs/tinyxml/tinyxml.cpp
|
||||||
../ImportColladaDemo/LoadMeshFromCollada.cpp
|
../ThirdPartyLibs/tinyxml/tinyxmlerror.cpp
|
||||||
../ImportSTLDemo/ImportSTLSetup.cpp
|
../ThirdPartyLibs/tinyxml/tinyxmlparser.cpp
|
||||||
../Wavefront/tiny_obj_loader.cpp
|
|
||||||
../Wavefront/tiny_obj_loader.h
|
|
||||||
../FiniteElementMethod/FiniteElementDemo.cpp
|
../ThirdPartyLibs/urdf/urdfdom/urdf_parser/src/pose.cpp
|
||||||
../../btgui/Bullet3AppSupport/b3Clock.cpp
|
../ThirdPartyLibs/urdf/urdfdom/urdf_parser/src/model.cpp
|
||||||
../../btgui/Bullet3AppSupport/b3Clock.h
|
../ThirdPartyLibs/urdf/urdfdom/urdf_parser/src/link.cpp
|
||||||
../../btgui/urdf/urdfdom/urdf_parser/src/pose.cpp
|
../ThirdPartyLibs/urdf/urdfdom/urdf_parser/src/joint.cpp
|
||||||
../../btgui/urdf/urdfdom/urdf_parser/src/model.cpp
|
../ThirdPartyLibs/urdf/urdfdom/urdf_parser/include/urdf_parser/urdf_parser.h
|
||||||
../../btgui/urdf/urdfdom/urdf_parser/src/link.cpp
|
../ThirdPartyLibs/urdf/urdfdom_headers/urdf_exception/include/urdf_exception/exception.h
|
||||||
../../btgui/urdf/urdfdom/urdf_parser/src/joint.cpp
|
../ThirdPartyLibs/urdf/urdfdom_headers/urdf_model/include/urdf_model/pose.h
|
||||||
../../btgui/urdf/urdfdom/urdf_parser/include/urdf_parser/urdf_parser.h
|
../ThirdPartyLibs/urdf/urdfdom_headers/urdf_model/include/urdf_model/model.h
|
||||||
../../btgui/urdf/urdfdom_headers/urdf_exception/include/urdf_exception/exception.h
|
../ThirdPartyLibs/urdf/urdfdom_headers/urdf_model/include/urdf_model/link.h
|
||||||
../../btgui/urdf/urdfdom_headers/urdf_model/include/urdf_model/pose.h
|
../ThirdPartyLibs/urdf/urdfdom_headers/urdf_model/include/urdf_model/joint.h
|
||||||
../../btgui/urdf/urdfdom_headers/urdf_model/include/urdf_model/model.h
|
../ThirdPartyLibs/tinyxml/tinystr.cpp
|
||||||
../../btgui/urdf/urdfdom_headers/urdf_model/include/urdf_model/link.h
|
../ThirdPartyLibs/tinyxml/tinyxml.cpp
|
||||||
../../btgui/urdf/urdfdom_headers/urdf_model/include/urdf_model/joint.h
|
../ThirdPartyLibs/tinyxml/tinyxmlerror.cpp
|
||||||
../../btgui/tinyxml/tinystr.cpp
|
../ThirdPartyLibs/tinyxml/tinyxmlparser.cpp
|
||||||
../../btgui/tinyxml/tinyxml.cpp
|
../ThirdPartyLibs/urdf/boost_replacement/lexical_cast.h
|
||||||
../../btgui/tinyxml/tinyxmlerror.cpp
|
../ThirdPartyLibs/urdf/boost_replacement/shared_ptr.h
|
||||||
../../btgui/tinyxml/tinyxmlparser.cpp
|
../ThirdPartyLibs/urdf/boost_replacement/printf_console.cpp
|
||||||
../../btgui/urdf/boost_replacement/lexical_cast.h
|
../ThirdPartyLibs/urdf/boost_replacement/printf_console.h
|
||||||
../../btgui/urdf/boost_replacement/shared_ptr.h
|
../ThirdPartyLibs/urdf/boost_replacement/string_split.cpp
|
||||||
../../btgui/urdf/boost_replacement/printf_console.cpp
|
../ThirdPartyLibs/urdf/boost_replacement/string_split.h
|
||||||
../../btgui/urdf/boost_replacement/printf_console.h
|
../Utils/b3Clock.cpp
|
||||||
../../btgui/urdf/boost_replacement/string_split.cpp
|
../Utils/b3Clock.h
|
||||||
../../btgui/urdf/boost_replacement/string_split.h
|
${ExampleBrowser_SRCS}
|
||||||
|
${ExampleBrowser_HDRS}
|
||||||
${BULLET_PHYSICS_SOURCE_DIR}/build3/bullet.rc
|
${BULLET_PHYSICS_SOURCE_DIR}/build3/bullet.rc
|
||||||
)
|
)
|
||||||
|
|
||||||
LINK_LIBRARIES(
|
LINK_LIBRARIES(
|
||||||
Bullet3AppSupport lua-5.2.3 Bullet3Common BulletSoftBody BulletDynamics BulletCollision LinearMath OpenGLWindow gwen ${OPENGL_gl_LIBRARY} ${OPENGL_glu_LIBRARY}
|
Bullet3Common BulletSoftBody BulletDynamics BulletCollision LinearMath OpenGLWindow gwen ${OPENGL_gl_LIBRARY} ${OPENGL_glu_LIBRARY}
|
||||||
)
|
)
|
||||||
|
|
||||||
IF (WIN32)
|
IF (WIN32)
|
||||||
SET(App_AllBullet2Demos_SRCS ${App_AllBullet2Demos_SRCS} ${App_AllBullet2Demos_Common_SRCS})
|
SET(App_ExampleBrowser_SRCS ${App_ExampleBrowser_SRCS} )
|
||||||
INCLUDE_DIRECTORIES(
|
INCLUDE_DIRECTORIES(
|
||||||
${BULLET_PHYSICS_SOURCE_DIR}/btgui/OpenGLWindow/GlewWindows
|
${BULLET_PHYSICS_SOURCE_DIR}/examples/ThirdPartyLibs/Glew
|
||||||
)
|
)
|
||||||
ADD_DEFINITIONS(-DGLEW_STATIC)
|
ADD_DEFINITIONS(-DGLEW_STATIC)
|
||||||
ELSE(WIN32)
|
ELSE(WIN32)
|
||||||
@@ -105,12 +110,12 @@ ELSE(WIN32)
|
|||||||
find_library(COCOA NAMES Cocoa)
|
find_library(COCOA NAMES Cocoa)
|
||||||
MESSAGE(${COCOA})
|
MESSAGE(${COCOA})
|
||||||
link_libraries(${COCOA})
|
link_libraries(${COCOA})
|
||||||
ELSE(APPLE)
|
ELSE(APPLE)
|
||||||
ADD_DEFINITIONS("-DGLEW_INIT_OPENGL11_FUNCTIONS=1")
|
ADD_DEFINITIONS("-DGLEW_INIT_OPENGL11_FUNCTIONS=1")
|
||||||
ADD_DEFINITIONS("-DGLEW_STATIC")
|
ADD_DEFINITIONS("-DGLEW_STATIC")
|
||||||
ADD_DEFINITIONS("-DGLEW_DYNAMIC_LOAD_ALL_GLX_FUNCTIONS=1")
|
ADD_DEFINITIONS("-DGLEW_DYNAMIC_LOAD_ALL_GLX_FUNCTIONS=1")
|
||||||
INCLUDE_DIRECTORIES(
|
INCLUDE_DIRECTORIES(
|
||||||
${BULLET_PHYSICS_SOURCE_DIR}/btgui/OpenGLWindow/GlewWindows
|
${BULLET_PHYSICS_SOURCE_DIR}/examples/ThirdPartyLibs/Glew
|
||||||
)
|
)
|
||||||
LINK_LIBRARIES( pthread dl)
|
LINK_LIBRARIES( pthread dl)
|
||||||
ENDIF(APPLE)
|
ENDIF(APPLE)
|
||||||
@@ -119,13 +124,13 @@ ENDIF(WIN32)
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
ADD_EXECUTABLE(App_AllBullet2Demos
|
ADD_EXECUTABLE(App_ExampleBrowser
|
||||||
${App_AllBullet2Demos_SRCS}
|
${App_ExampleBrowser_SRCS}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
IF (INTERNAL_ADD_POSTFIX_EXECUTABLE_NAMES)
|
IF (INTERNAL_ADD_POSTFIX_EXECUTABLE_NAMES)
|
||||||
SET_TARGET_PROPERTIES(App_AllBullet2Demos PROPERTIES DEBUG_POSTFIX "_Debug")
|
SET_TARGET_PROPERTIES(App_ExampleBrowser PROPERTIES DEBUG_POSTFIX "_Debug")
|
||||||
SET_TARGET_PROPERTIES(App_AllBullet2Demos PROPERTIES MINSIZEREL_POSTFIX "_MinsizeRel")
|
SET_TARGET_PROPERTIES(App_ExampleBrowser PROPERTIES MINSIZEREL_POSTFIX "_MinsizeRel")
|
||||||
SET_TARGET_PROPERTIES(App_AllBullet2Demos PROPERTIES RELWITHDEBINFO_POSTFIX "_RelWithDebugInfo")
|
SET_TARGET_PROPERTIES(App_ExampleBrowser PROPERTIES RELWITHDEBINFO_POSTFIX "_RelWithDebugInfo")
|
||||||
ENDIF(INTERNAL_ADD_POSTFIX_EXECUTABLE_NAMES)
|
ENDIF(INTERNAL_ADD_POSTFIX_EXECUTABLE_NAMES)
|
||||||
|
|||||||
@@ -34,16 +34,16 @@ struct ExampleEntry
|
|||||||
|
|
||||||
static ExampleEntry gDefaultExamples[]=
|
static ExampleEntry gDefaultExamples[]=
|
||||||
{
|
{
|
||||||
ExampleEntry(0,"Rendering",0),
|
|
||||||
ExampleEntry(1,"Instanced Rendering", RenderInstancingCreateFunc),
|
|
||||||
ExampleEntry(1,"CoordinateSystemDemo",CoordinateSystemCreateFunc),
|
|
||||||
ExampleEntry(1,"Raytracer",RayTracerCreateFunc),
|
|
||||||
|
|
||||||
ExampleEntry(0,"API",0),
|
ExampleEntry(0,"API",0),
|
||||||
ExampleEntry(1,"Basic Example",BasicExampleCreateFunc),
|
ExampleEntry(1,"Basic Example",BasicExampleCreateFunc),
|
||||||
|
|
||||||
ExampleEntry(1,"Gyroscopic", GyroscopicCreateFunc),
|
ExampleEntry(1,"Gyroscopic", GyroscopicCreateFunc),
|
||||||
|
|
||||||
ExampleEntry(1,"Planar 2D",Planar2DCreateFunc),
|
ExampleEntry(1,"Planar 2D",Planar2DCreateFunc),
|
||||||
|
|
||||||
|
//#ifndef _DEBUG
|
||||||
ExampleEntry(0,"Benchmarks", 0),
|
ExampleEntry(0,"Benchmarks", 0),
|
||||||
ExampleEntry(1,"3000 boxes", BenchmarkCreateFunc, 1),
|
ExampleEntry(1,"3000 boxes", BenchmarkCreateFunc, 1),
|
||||||
ExampleEntry(1,"1000 stack", BenchmarkCreateFunc, 2),
|
ExampleEntry(1,"1000 stack", BenchmarkCreateFunc, 2),
|
||||||
@@ -51,21 +51,27 @@ static ExampleEntry gDefaultExamples[]=
|
|||||||
ExampleEntry(1,"Convex stack", BenchmarkCreateFunc, 4),
|
ExampleEntry(1,"Convex stack", BenchmarkCreateFunc, 4),
|
||||||
ExampleEntry(1,"Prim vs Mesh", BenchmarkCreateFunc, 5),
|
ExampleEntry(1,"Prim vs Mesh", BenchmarkCreateFunc, 5),
|
||||||
ExampleEntry(1,"Convex vs Mesh", BenchmarkCreateFunc, 6),
|
ExampleEntry(1,"Convex vs Mesh", BenchmarkCreateFunc, 6),
|
||||||
ExampleEntry(1,"7", BenchmarkCreateFunc, 7),
|
ExampleEntry(1,"Raycast", BenchmarkCreateFunc, 7),
|
||||||
|
//#endif
|
||||||
|
|
||||||
|
|
||||||
ExampleEntry(0,"Importers", 0),
|
ExampleEntry(0,"Importers", 0),
|
||||||
ExampleEntry(1,"Wavefront Obj", ImportObjCreateFunc, 0),
|
ExampleEntry(1,"Wavefront Obj", ImportObjCreateFunc, 0),
|
||||||
|
|
||||||
ExampleEntry(1,"Quake BSP", ImportBspCreateFunc, 0),
|
ExampleEntry(1,"Quake BSP", ImportBspCreateFunc, 0),
|
||||||
ExampleEntry(1,"COLLADA dae", ImportColladaCreateFunc, 0),
|
ExampleEntry(1,"COLLADA dae", ImportColladaCreateFunc, 0),
|
||||||
ExampleEntry(1,"STL", ImportSTLCreateFunc, 0),
|
ExampleEntry(1,"STL", ImportSTLCreateFunc, 0),
|
||||||
ExampleEntry(1,"URDF (RigidBody)", ImportURDFCreateFunc, 0),
|
ExampleEntry(1,"URDF (RigidBody)", ImportURDFCreateFunc, 0),
|
||||||
ExampleEntry(1,"URDF (MultiBody)", ImportURDFCreateFunc, 1),
|
ExampleEntry(1,"URDF (MultiBody)", ImportURDFCreateFunc, 1),
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
ExampleEntry(0,"Vehicles",0),
|
ExampleEntry(0,"Vehicles",0),
|
||||||
|
|
||||||
ExampleEntry(1,"ForkLift",ForkLiftCreateFunc),
|
ExampleEntry(1,"ForkLift",ForkLiftCreateFunc),
|
||||||
|
|
||||||
|
ExampleEntry(0,"Rendering",0),
|
||||||
|
ExampleEntry(1,"Instanced Rendering", RenderInstancingCreateFunc),
|
||||||
|
ExampleEntry(1,"CoordinateSystemDemo",CoordinateSystemCreateFunc),
|
||||||
|
ExampleEntry(1,"Raytracer",RayTracerCreateFunc),
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -92,14 +98,8 @@ void ExampleEntries::initExampleEntries()
|
|||||||
{
|
{
|
||||||
m_data->m_allExamples.clear();
|
m_data->m_allExamples.clear();
|
||||||
|
|
||||||
{
|
|
||||||
ExampleEntry e(0,"Basic Concepts", 0);
|
|
||||||
m_data->m_allExamples.push_back(e);
|
|
||||||
}
|
|
||||||
{
|
|
||||||
ExampleEntry e(1,"Empty",EmptyExample::CreateFunc);
|
|
||||||
m_data->m_allExamples.push_back(e);
|
|
||||||
}
|
|
||||||
|
|
||||||
int numDefaultEntries = sizeof(gDefaultExamples)/sizeof(ExampleEntry);
|
int numDefaultEntries = sizeof(gDefaultExamples)/sizeof(ExampleEntry);
|
||||||
for (int i=0;i<numDefaultEntries;i++)
|
for (int i=0;i<numDefaultEntries;i++)
|
||||||
@@ -107,6 +107,20 @@ void ExampleEntries::initExampleEntries()
|
|||||||
m_data->m_allExamples.push_back(gDefaultExamples[i]);
|
m_data->m_allExamples.push_back(gDefaultExamples[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (m_data->m_allExamples.size()==0)
|
||||||
|
{
|
||||||
|
|
||||||
|
{
|
||||||
|
ExampleEntry e(0,"Empty", 0);
|
||||||
|
m_data->m_allExamples.push_back(e);
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
ExampleEntry e(1,"Empty",EmptyExample::CreateFunc);
|
||||||
|
m_data->m_allExamples.push_back(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void ExampleEntries::registerExampleEntry(int menuLevel, const char* name,ExampleInterface::CreateFunc* createFunc, int option)
|
void ExampleEntries::registerExampleEntry(int menuLevel, const char* name,ExampleInterface::CreateFunc* createFunc, int option)
|
||||||
|
|||||||
@@ -9,12 +9,12 @@ LINK_LIBRARIES(
|
|||||||
)
|
)
|
||||||
|
|
||||||
IF (WIN32)
|
IF (WIN32)
|
||||||
ADD_EXECUTABLE(AppHelloWorld
|
ADD_EXECUTABLE(App_HelloWorld
|
||||||
HelloWorld.cpp
|
HelloWorld.cpp
|
||||||
${BULLET_PHYSICS_SOURCE_DIR}/build3/bullet.rc
|
${BULLET_PHYSICS_SOURCE_DIR}/build3/bullet.rc
|
||||||
)
|
)
|
||||||
ELSE()
|
ELSE()
|
||||||
ADD_EXECUTABLE(AppHelloWorld
|
ADD_EXECUTABLE(App_HelloWorld
|
||||||
HelloWorld.cpp
|
HelloWorld.cpp
|
||||||
)
|
)
|
||||||
ENDIF()
|
ENDIF()
|
||||||
@@ -23,7 +23,7 @@ ENDIF()
|
|||||||
|
|
||||||
|
|
||||||
IF (INTERNAL_ADD_POSTFIX_EXECUTABLE_NAMES)
|
IF (INTERNAL_ADD_POSTFIX_EXECUTABLE_NAMES)
|
||||||
SET_TARGET_PROPERTIES(AppHelloWorld PROPERTIES DEBUG_POSTFIX "_Debug")
|
SET_TARGET_PROPERTIES(App_HelloWorld PROPERTIES DEBUG_POSTFIX "_Debug")
|
||||||
SET_TARGET_PROPERTIES(AppHelloWorld PROPERTIES MINSIZEREL_POSTFIX "_MinsizeRel")
|
SET_TARGET_PROPERTIES(App_HelloWorld PROPERTIES MINSIZEREL_POSTFIX "_MinsizeRel")
|
||||||
SET_TARGET_PROPERTIES(AppHelloWorld PROPERTIES RELWITHDEBINFO_POSTFIX "_RelWithDebugInfo")
|
SET_TARGET_PROPERTIES(App_HelloWorld PROPERTIES RELWITHDEBINFO_POSTFIX "_RelWithDebugInfo")
|
||||||
ENDIF(INTERNAL_ADD_POSTFIX_EXECUTABLE_NAMES)
|
ENDIF(INTERNAL_ADD_POSTFIX_EXECUTABLE_NAMES)
|
||||||
@@ -16,6 +16,7 @@ subject to the following restrictions:
|
|||||||
///-----includes_start-----
|
///-----includes_start-----
|
||||||
#include "btBulletDynamicsCommon.h"
|
#include "btBulletDynamicsCommon.h"
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
#include <conio.h>
|
||||||
|
|
||||||
/// This is a Hello World program for running a basic Bullet physics simulation
|
/// This is a Hello World program for running a basic Bullet physics simulation
|
||||||
|
|
||||||
@@ -122,12 +123,16 @@ int main(int argc, char** argv)
|
|||||||
{
|
{
|
||||||
btCollisionObject* obj = dynamicsWorld->getCollisionObjectArray()[j];
|
btCollisionObject* obj = dynamicsWorld->getCollisionObjectArray()[j];
|
||||||
btRigidBody* body = btRigidBody::upcast(obj);
|
btRigidBody* body = btRigidBody::upcast(obj);
|
||||||
|
btTransform trans;
|
||||||
if (body && body->getMotionState())
|
if (body && body->getMotionState())
|
||||||
{
|
{
|
||||||
btTransform trans;
|
|
||||||
body->getMotionState()->getWorldTransform(trans);
|
body->getMotionState()->getWorldTransform(trans);
|
||||||
printf("world pos = %f,%f,%f\n",float(trans.getOrigin().getX()),float(trans.getOrigin().getY()),float(trans.getOrigin().getZ()));
|
|
||||||
|
} else
|
||||||
|
{
|
||||||
|
trans = obj->getWorldTransform();
|
||||||
}
|
}
|
||||||
|
printf("world pos object %d = %f,%f,%f\n",j,float(trans.getOrigin().getX()),float(trans.getOrigin().getY()),float(trans.getOrigin().getZ()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -176,5 +181,7 @@ int main(int argc, char** argv)
|
|||||||
collisionShapes.clear();
|
collisionShapes.clear();
|
||||||
|
|
||||||
///-----cleanup_end-----
|
///-----cleanup_end-----
|
||||||
|
printf("Press a key to exit\n");
|
||||||
|
getch();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -19,9 +19,9 @@ LIST(REMOVE_ITEM OpenGLWindowCommon_CPP X11OpenGLWindow.cpp )
|
|||||||
#MESSAGE (${OpenGLWindowCommon_CPP})
|
#MESSAGE (${OpenGLWindowCommon_CPP})
|
||||||
|
|
||||||
IF (WIN32)
|
IF (WIN32)
|
||||||
SET(OpenGLWindow_SRCS GlewWindows/glew.c ${OpenGLWindowWin32_CPP} ${OpenGLWindowCommon_CPP})
|
SET(OpenGLWindow_SRCS ${BULLET_PHYSICS_SOURCE_DIR}/examples/ThirdPartyLibs/Glew/glew.c ${OpenGLWindowWin32_CPP} ${OpenGLWindowCommon_CPP})
|
||||||
INCLUDE_DIRECTORIES(
|
INCLUDE_DIRECTORIES(
|
||||||
GlewWindows
|
${BULLET_PHYSICS_SOURCE_DIR}/examples/ThirdPartyLibs/Glew
|
||||||
)
|
)
|
||||||
ADD_DEFINITIONS(-DGLEW_STATIC)
|
ADD_DEFINITIONS(-DGLEW_STATIC)
|
||||||
ENDIF(WIN32)
|
ENDIF(WIN32)
|
||||||
@@ -33,13 +33,13 @@ ENDIF(APPLE)
|
|||||||
#no Linux detection?
|
#no Linux detection?
|
||||||
IF(NOT WIN32 AND NOT APPLE)
|
IF(NOT WIN32 AND NOT APPLE)
|
||||||
INCLUDE_DIRECTORIES(
|
INCLUDE_DIRECTORIES(
|
||||||
GlewWindows
|
${BULLET_PHYSICS_SOURCE_DIR}/examples/ThirdPartyLibs/Glew
|
||||||
)
|
)
|
||||||
ADD_DEFINITIONS(-DGLEW_STATIC)
|
ADD_DEFINITIONS(-DGLEW_STATIC)
|
||||||
ADD_DEFINITIONS("-DGLEW_INIT_OPENGL11_FUNCTIONS=1")
|
ADD_DEFINITIONS("-DGLEW_INIT_OPENGL11_FUNCTIONS=1")
|
||||||
ADD_DEFINITIONS("-DGLEW_DYNAMIC_LOAD_ALL_GLX_FUNCTIONS=1")
|
ADD_DEFINITIONS("-DGLEW_DYNAMIC_LOAD_ALL_GLX_FUNCTIONS=1")
|
||||||
|
|
||||||
SET(OpenGLWindow_SRCS ${OpenGLWindowLinux_CPP} GlewWindows/glew.c ${OpenGLWindowCommon_CPP} )
|
SET(OpenGLWindow_SRCS ${OpenGLWindowLinux_CPP} ${BULLET_PHYSICS_SOURCE_DIR}/examples/ThirdPartyLibs/Glew/glew.c ${OpenGLWindowCommon_CPP} )
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -113,7 +113,7 @@ int getAsciiCodeFromVirtualKeycode(int virtualKeyCode)
|
|||||||
return keycode;
|
return keycode;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Win32Window::isModifiedKeyPressed(int key)
|
bool Win32Window::isModifierKeyPressed(int key)
|
||||||
{
|
{
|
||||||
bool isPressed = false;
|
bool isPressed = false;
|
||||||
|
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ struct InternalData2;
|
|||||||
|
|
||||||
#include "../CommonInterfaces/CommonWindowInterface.h"
|
#include "../CommonInterfaces/CommonWindowInterface.h"
|
||||||
|
|
||||||
class Win32Window : public b3gWindowInterface
|
class Win32Window : public CommonWindowInterface
|
||||||
{
|
{
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
@@ -80,7 +80,7 @@ public:
|
|||||||
|
|
||||||
virtual void setWindowTitle(const char* title);
|
virtual void setWindowTitle(const char* title);
|
||||||
|
|
||||||
virtual bool isModifiedKeyPressed(int key);
|
virtual bool isModifierKeyPressed(int key);
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif //_WIN32_WINDOW_H
|
#endif //_WIN32_WINDOW_H
|
||||||
@@ -1,10 +1,11 @@
|
|||||||
|
|
||||||
INCLUDE_DIRECTORIES(
|
INCLUDE_DIRECTORIES(
|
||||||
${BULLET_PHYSICS_SOURCE_DIR}/src
|
${BULLET_PHYSICS_SOURCE_DIR}/src
|
||||||
${BULLET_PHYSICS_SOURCE_DIR}/btgui
|
${BULLET_PHYSICS_SOURCE_DIR}/examples/ThirdPartyLibs
|
||||||
|
${BULLET_PHYSICS_SOURCE_DIR}/examples/ThirdPartyLibs/Glew
|
||||||
)
|
)
|
||||||
|
|
||||||
ADD_DEFINITIONS( -DGWEN_COMPILE_STATIC -D_HAS_EXCEPTIONS=0 -D_STATIC_CPPLIB )
|
ADD_DEFINITIONS( -DGLEW_STATIC -DGWEN_COMPILE_STATIC -D_HAS_EXCEPTIONS=0 -D_STATIC_CPPLIB )
|
||||||
|
|
||||||
FILE(GLOB gwen_SRCS "*.cpp" "Controls/*.cpp" "Controls/Dialog/*.cpp" "Controls/Dialogs/*.cpp" "Controls/Layout/*.cpp" "Controls/Property/*.cpp" "Input/*.cpp" "Platforms/*.cpp" "Renderers/*.cpp" "Skins/*.cpp")
|
FILE(GLOB gwen_SRCS "*.cpp" "Controls/*.cpp" "Controls/Dialog/*.cpp" "Controls/Dialogs/*.cpp" "Controls/Layout/*.cpp" "Controls/Property/*.cpp" "Input/*.cpp" "Platforms/*.cpp" "Renderers/*.cpp" "Skins/*.cpp")
|
||||||
FILE(GLOB gwen_HDRS "*.h" "Controls/*.h" "Controls/Dialog/*.h" "Controls/Dialogs/*.h" "Controls/Layout/*.h" "Controls/Property/*.h" "Input/*.h" "Platforms/*.h" "Renderers/*.h" "Skins/*.h")
|
FILE(GLOB gwen_HDRS "*.h" "Controls/*.h" "Controls/Dialog/*.h" "Controls/Dialogs/*.h" "Controls/Layout/*.h" "Controls/Property/*.h" "Input/*.h" "Platforms/*.h" "Renderers/*.h" "Skins/*.h")
|
||||||
|
|||||||
Reference in New Issue
Block a user