Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions Box2D-updates.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
Box 2.4.1:
* b2_common.h: `b2_maxTranslation` changed same as in 2.3.1.
* b2PolygonShape: Same changes as in 2.3.1

Box 2.3.1:
* CMake: Unrelevant changes.
* b2PrismaticJoint.cpp: commented out s1test in `b2PrismaticJoint::InitVelocityConstraints`
* b2Settings.h: `b2_maxTranslation` bumped from `2.f` to `20.f`
* b2Math.h: non-functional change in `b2IsValid()` (one extra intermediate variable)
* b2GrowableStack.h: added `<string.h>` include, allegedly to fix an Android build.
* b2PolygonShape.h: Changed `Set(const b2Vec2* points, int32 count);`, returns a boolean.
* " .cpp:
- `b2Vec2 ComputeCentroid()`: commented out `b2Assert(area > b2_epsilon);`
- `b2PolygonShape::Set()`: asserts have been commented out, and converted to return values.
if() adapted where necessary.
- `b2PolygonShape::ComputeMass()`: commented out `b2Assert(area > b2_epsilon);`
3 changes: 1 addition & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ target_compile_definitions(seriousproton
include(ExternalProject)

add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/src/Box2D)
add_dependencies(seriousproton box2d)

add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/src/lua)
add_dependencies(seriousproton lua)
Expand All @@ -97,7 +96,7 @@ if(NOT ${SFML_FOUND})
add_dependencies(seriousproton SFML)
endif()
include_directories(${SFML_INCLUDE_DIR})
target_link_libraries(seriousproton ${SFML_LIBRARIES})
target_link_libraries(seriousproton box2d ${SFML_LIBRARIES})

#--------------------------------Installation----------------------------------
install(
Expand Down
68 changes: 0 additions & 68 deletions src/Box2D/Box2D.h

This file was deleted.

141 changes: 61 additions & 80 deletions src/Box2D/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,84 +1,65 @@
cmake_minimum_required(VERSION 2.8.12)
project(Box2D)

#---------------------------------File lists-----------------------------------
set(source_files_relative
Collision/b2BroadPhase.cpp
Collision/b2CollideEdge.cpp
Collision/b2CollideCircle.cpp
Collision/b2CollidePolygon.cpp
Collision/b2Collision.cpp
Collision/b2Distance.cpp
Collision/b2DynamicTree.cpp
Collision/b2TimeOfImpact.cpp
Collision/Shapes/b2ChainShape.cpp
Collision/Shapes/b2CircleShape.cpp
Collision/Shapes/b2EdgeShape.cpp
Collision/Shapes/b2PolygonShape.cpp

Common/b2BlockAllocator.cpp
Common/b2Draw.cpp
Common/b2Math.cpp
Common/b2Settings.cpp
Common/b2StackAllocator.cpp
Common/b2Timer.cpp

Dynamics/b2Body.cpp
Dynamics/b2ContactManager.cpp
Dynamics/b2Fixture.cpp
Dynamics/b2Island.cpp
Dynamics/b2World.cpp
Dynamics/b2WorldCallbacks.cpp
Dynamics/Contacts/b2ChainAndCircleContact.cpp
Dynamics/Contacts/b2ChainAndPolygonContact.cpp
Dynamics/Contacts/b2CircleContact.cpp
Dynamics/Contacts/b2Contact.cpp
Dynamics/Contacts/b2ContactSolver.cpp
Dynamics/Contacts/b2EdgeAndCircleContact.cpp
Dynamics/Contacts/b2EdgeAndPolygonContact.cpp
Dynamics/Contacts/b2PolygonAndCircleContact.cpp
Dynamics/Contacts/b2PolygonContact.cpp
Dynamics/Joints/b2DistanceJoint.cpp
Dynamics/Joints/b2FrictionJoint.cpp
Dynamics/Joints/b2GearJoint.cpp
Dynamics/Joints/b2Joint.cpp
Dynamics/Joints/b2MotorJoint.cpp
Dynamics/Joints/b2MouseJoint.cpp
Dynamics/Joints/b2PrismaticJoint.cpp
Dynamics/Joints/b2PulleyJoint.cpp
Dynamics/Joints/b2RevoluteJoint.cpp
Dynamics/Joints/b2RopeJoint.cpp
Dynamics/Joints/b2WeldJoint.cpp
Dynamics/Joints/b2WheelJoint.cpp

Rope/b2Rope.cpp
)
set(source_files "")
foreach(source_file_relative ${source_files_relative})
list(APPEND source_files ${CMAKE_CURRENT_SOURCE_DIR}/${source_file_relative})
endforeach()

include_directories(
${CMAKE_CURRENT_BINARY_DIR}
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/.. #Because the header files are requested starting from "Box2D/..."
)
cmake_minimum_required(VERSION 3.7)

#----------------------------------Compiling-----------------------------------
add_library(box2d STATIC ${source_files})
# https://cmake.org/cmake/help/latest/command/project.html
project(box2d VERSION 2.4.1)

# set(CMAKE_CONFIGURATION_TYPES "Debug;RelWithDebInfo" CACHE STRING "" FORCE)

set(CMAKE_CXX_VISIBILITY_PRESET hidden)
set(CMAKE_VISIBILITY_INLINES_HIDDEN ON)

option(BOX2D_BUILD_UNIT_TESTS "Build the Box2D unit tests" OFF)
option(BOX2D_BUILD_TESTBED "Build the Box2D testbed" OFF)
option(BOX2D_BUILD_DOCS "Build the Box2D documentation" OFF)
option(BOX2D_USER_SETTINGS "Override Box2D settings with b2UserSettings.h" OFF)

option(BUILD_SHARED_LIBS "Build Box2D as a shared library" OFF)

set(CMAKE_CXX_VISIBILITY_PRESET hidden)
set(CMAKE_VISIBILITY_INLINES_HIDDEN ON)

set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/bin")
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/bin")
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/bin")

include(GNUInstallDirs)

set_property(GLOBAL PROPERTY USE_FOLDERS ON)

if (BOX2D_USER_SETTINGS)
add_compile_definitions(B2_USER_SETTINGS)
endif()

add_subdirectory(src)

if (BOX2D_BUILD_DOCS)
set(DOXYGEN_SKIP_DOT TRUE)
find_package(Doxygen)
endif()

if (DOXYGEN_FOUND AND BOX2D_BUILD_DOCS)
add_subdirectory(docs)
endif()

if (BOX2D_BUILD_UNIT_TESTS)
add_subdirectory(unit-test)
endif()

if (BOX2D_BUILD_TESTBED)
add_subdirectory(extern/glad)
add_subdirectory(extern/glfw)
add_subdirectory(extern/imgui)
add_subdirectory(extern/sajson)
add_subdirectory(testbed)

# default startup project for Visual Studio
if (MSVC)
set_property(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT testbed)
set_property(TARGET testbed PROPERTY VS_DEBUGGER_WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}/testbed")
endif()
endif()

#--------------------------------Installation----------------------------------
install(
TARGETS box2d
EXPORT box2d
DESTINATION lib
)
install(
DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
DESTINATION include
FILES_MATCHING PATTERN "*.h"
)
install(
EXPORT box2d
DESTINATION share/box2d
DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/include/box2d"
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
)
105 changes: 0 additions & 105 deletions src/Box2D/Collision/Shapes/b2ChainShape.h

This file was deleted.

Loading