diff --git a/CMakeLists.txt b/CMakeLists.txt index 65ce371a..f538a201 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -4,8 +4,14 @@ CMAKE_MINIMUM_REQUIRED(VERSION 2.6) # Project configuration PROJECT(REACTPHYSICS3D) +# Default build type +SET(CMAKE_BUILD_TYPE "Debug") + # Where to build the library -SET(LIBRARY_OUTPUT_PATH lib/) +SET(LIBRARY_OUTPUT_PATH "lib") + +# Where to build the executables +SET(OUR_EXECUTABLE_OUTPUT_PATH "${PROJECT_BINARY_DIR}/bin") # Options OPTION(COMPILE_EXAMPLES "Select this if you want to build the examples" OFF) diff --git a/VERSION b/VERSION index 9325c3cc..60a2d3e9 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.3.0 \ No newline at end of file +0.4.0 \ No newline at end of file diff --git a/examples/collisionshapes/CMakeLists.txt b/examples/collisionshapes/CMakeLists.txt index ffbdebbe..2bd5a930 100644 --- a/examples/collisionshapes/CMakeLists.txt +++ b/examples/collisionshapes/CMakeLists.txt @@ -4,8 +4,11 @@ cmake_minimum_required(VERSION 2.6) # Project configuration PROJECT(CollisionShapes) -# Where to build the executable -SET(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin/collisionshapes/) +# Where to build the executables +SET(EXECUTABLE_OUTPUT_PATH "${OUR_EXECUTABLE_OUTPUT_PATH}/collisionshapes") +SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${EXECUTABLE_OUTPUT_PATH}) +SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE ${EXECUTABLE_OUTPUT_PATH}) +SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG ${EXECUTABLE_OUTPUT_PATH}) # Copy the shaders used for the demo into the build directory FILE(COPY "${OPENGLFRAMEWORK_DIR}/src/shaders/" DESTINATION "${EXECUTABLE_OUTPUT_PATH}/shaders/") diff --git a/examples/cubes/CMakeLists.txt b/examples/cubes/CMakeLists.txt index f6b44f3a..efdcf263 100644 --- a/examples/cubes/CMakeLists.txt +++ b/examples/cubes/CMakeLists.txt @@ -4,8 +4,11 @@ cmake_minimum_required(VERSION 2.6) # Project configuration PROJECT(Cubes) -# Where to build the executable -SET(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin/cubes/) +# Where to build the executables +SET(EXECUTABLE_OUTPUT_PATH "${OUR_EXECUTABLE_OUTPUT_PATH}/cubes") +SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${EXECUTABLE_OUTPUT_PATH}) +SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE ${EXECUTABLE_OUTPUT_PATH}) +SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG ${EXECUTABLE_OUTPUT_PATH}) # Copy the shaders used for the demo into the build directory FILE(COPY "${OPENGLFRAMEWORK_DIR}/src/shaders/" DESTINATION "${EXECUTABLE_OUTPUT_PATH}/shaders/") diff --git a/examples/joints/CMakeLists.txt b/examples/joints/CMakeLists.txt index 9b4f71e6..343f5c7d 100644 --- a/examples/joints/CMakeLists.txt +++ b/examples/joints/CMakeLists.txt @@ -4,8 +4,11 @@ cmake_minimum_required(VERSION 2.6) # Project configuration PROJECT(Joints) -# Where to build the executable -SET(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin/joints/) +# Where to build the executables +SET(EXECUTABLE_OUTPUT_PATH "${OUR_EXECUTABLE_OUTPUT_PATH}/joints") +SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${EXECUTABLE_OUTPUT_PATH}) +SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE ${EXECUTABLE_OUTPUT_PATH}) +SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG ${EXECUTABLE_OUTPUT_PATH}) # Copy the shaders used for the demo into the build directory FILE(COPY "${OPENGLFRAMEWORK_DIR}/src/shaders/" DESTINATION "${EXECUTABLE_OUTPUT_PATH}/shaders/") diff --git a/src/body/RigidBody.h b/src/body/RigidBody.h index 4b7980e8..cbd123e1 100644 --- a/src/body/RigidBody.h +++ b/src/body/RigidBody.h @@ -188,7 +188,7 @@ class RigidBody : public CollisionBody { /// Apply an external force to the body at its gravity center. void applyForceToCenter(const Vector3& force); - /// Apply an external force to the body at a given point (in world-coordinates). + /// Apply an external force to the body at a given point (in world-space coordinates). void applyForce(const Vector3& force, const Vector3& point); /// Apply an external torque to the body. @@ -361,7 +361,7 @@ inline void RigidBody::applyForceToCenter(const Vector3& force) { mExternalForce += force; } -// Apply an external force to the body at a given point (in world-coordinates). +// Apply an external force to the body at a given point (in world-space coordinates). /// If the point is not at the center of gravity of the body, it will also /// generate some torque and therefore, change the angular velocity of the body. /// If the body is sleeping, calling this method will wake it up. Note that the diff --git a/src/engine/Material.h b/src/engine/Material.h index 4ab4a9c7..4d06f1a9 100644 --- a/src/engine/Material.h +++ b/src/engine/Material.h @@ -66,13 +66,13 @@ class Material { /// Return the bounciness decimal getBounciness() const; - /// Set the bounciness + /// Set the bounciness. void setBounciness(decimal bounciness); /// Return the friction coefficient decimal getFrictionCoefficient() const; - /// Set the friction coefficient + /// Set the friction coefficient. void setFrictionCoefficient(decimal frictionCoefficient); /// Overloaded assignment operator @@ -84,7 +84,9 @@ inline decimal Material::getBounciness() const { return mBounciness; } -// Set the bounciness +// Set the bounciness. +/// The bounciness should be a value between 0 and 1. The value 1 is used for a +/// very bouncy body and zero is used for a body that is not bouncy at all. inline void Material::setBounciness(decimal bounciness) { assert(bounciness >= decimal(0.0) && bounciness <= decimal(1.0)); mBounciness = bounciness; @@ -95,7 +97,9 @@ inline decimal Material::getFrictionCoefficient() const { return mFrictionCoefficient; } -// Set the friction coefficient +// Set the friction coefficient. +/// The friction coefficient has to be a positive value. The value zero is used for no +/// friction at all. inline void Material::setFrictionCoefficient(decimal frictionCoefficient) { assert(frictionCoefficient >= decimal(0.0)); mFrictionCoefficient = frictionCoefficient;