Skip to content

Commit f209537

Browse files
Merge pull request #371 from louis-langholtz/updates-20201102
Updates for release 0.12.0
2 parents f416c3f + f23c709 commit f209537

38 files changed

Lines changed: 432 additions & 475 deletions

Benchmark/BenchmarkMain.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
#include <atomic>
4545
#include <ctime>
4646
#include <map>
47+
#include <optional>
4748
#include <type_traits>
4849
#include <functional>
4950

@@ -54,7 +55,6 @@
5455

5556
#include <PlayRho/Common/Math.hpp>
5657
#include <PlayRho/Common/Intervals.hpp>
57-
#include <PlayRho/Common/OptionalValue.hpp> // for Optional
5858

5959
#include <PlayRho/Dynamics/World.hpp>
6060
#include <PlayRho/Dynamics/WorldBody.hpp> // for GetAwakeCount
@@ -693,7 +693,7 @@ class Concurrent
693693
}
694694

695695
private:
696-
playrho::Optional<T> m_element;
696+
std::optional<T> m_element;
697697
std::mutex m_mutex;
698698
std::condition_variable m_cond;
699699
};

Build/xcode5/PlayRho.xcodeproj/project.pbxproj

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,6 @@
6363
4731DE641DEF841600E7F931 /* SeparationScenario.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4731DE631DEF841600E7F931 /* SeparationScenario.cpp */; };
6464
4731DE671DF0A73000E7F931 /* Manifold.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4731DE661DF0A73000E7F931 /* Manifold.cpp */; };
6565
473273211F44AB9B00E22AE2 /* ContactImpulsesList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 473273201F44AB9B00E22AE2 /* ContactImpulsesList.cpp */; };
66-
473273251F476C1D00E22AE2 /* OptionalValue.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 473273231F476C1D00E22AE2 /* OptionalValue.hpp */; };
67-
473273271F47760D00E22AE2 /* OptionalValue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 473273261F47760D00E22AE2 /* OptionalValue.cpp */; };
6866
47327E751E9F1E2A0048FCD8 /* TargetJoint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 47327E741E9F1E2A0048FCD8 /* TargetJoint.cpp */; };
6967
47327E801EA585790048FCD8 /* Defines.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 47327E7D1EA585790048FCD8 /* Defines.hpp */; };
7068
4734B2191DC00AFD00F15E29 /* ArrayList.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 4734B2161DC00AFD00F15E29 /* ArrayList.hpp */; };
@@ -455,8 +453,6 @@
455453
4731DE631DEF841600E7F931 /* SeparationScenario.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SeparationScenario.cpp; sourceTree = "<group>"; };
456454
4731DE661DF0A73000E7F931 /* Manifold.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Manifold.cpp; sourceTree = "<group>"; };
457455
473273201F44AB9B00E22AE2 /* ContactImpulsesList.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ContactImpulsesList.cpp; sourceTree = "<group>"; };
458-
473273231F476C1D00E22AE2 /* OptionalValue.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = OptionalValue.hpp; sourceTree = "<group>"; };
459-
473273261F47760D00E22AE2 /* OptionalValue.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = OptionalValue.cpp; sourceTree = "<group>"; };
460456
47327E741E9F1E2A0048FCD8 /* TargetJoint.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TargetJoint.cpp; sourceTree = "<group>"; };
461457
47327E7D1EA585790048FCD8 /* Defines.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = Defines.hpp; sourceTree = "<group>"; };
462458
4734B2161DC00AFD00F15E29 /* ArrayList.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = ArrayList.hpp; sourceTree = "<group>"; };
@@ -878,7 +874,6 @@
878874
473971A71D9D9B4C00F7137F /* Math.cpp */,
879875
470F9B531EF9666B007EF7B6 /* MotorJoint.cpp */,
880876
47D61F7B1F21112000E702BD /* MultiShape.cpp */,
881-
473273261F47760D00E22AE2 /* OptionalValue.cpp */,
882877
474BC3FF1D41278800447DCD /* PolygonShape.cpp */,
883878
47FFD0FC1DAC6235000D6D0E /* PositionConstraint.cpp */,
884879
47AFC3041DAEBC120023E9D1 /* PositionSolverManifold.cpp */,
@@ -1042,7 +1037,6 @@
10421037
4764085025042BD00090F711 /* NonNegative.hpp */,
10431038
4764085825047FA10090F711 /* NonPositive.hpp */,
10441039
47640854250475860090F711 /* NonZero.hpp */,
1045-
473273231F476C1D00E22AE2 /* OptionalValue.hpp */,
10461040
470F9B0F1EDF2890007EF7B6 /* Position.hpp */,
10471041
4764085A2504822F0090F711 /* Positive.hpp */,
10481042
4764085E2507FBFF0090F711 /* propagate_const.hpp */,
@@ -1410,7 +1404,6 @@
14101404
47E36F501FE8477000C10B79 /* FixedLimits.hpp in Headers */,
14111405
47E36F541FE8534500C10B79 /* FixedMath.hpp in Headers */,
14121406
470F9B301EDF5165007EF7B6 /* Velocity.hpp in Headers */,
1413-
473273251F476C1D00E22AE2 /* OptionalValue.hpp in Headers */,
14141407
4764086D250E9E2B0090F711 /* FixtureID.hpp in Headers */,
14151408
80BB89A6141C3E5900F1753A /* Settings.hpp in Headers */,
14161409
4764085D250484830090F711 /* Negative.hpp in Headers */,
@@ -1656,7 +1649,6 @@
16561649
475A94541D930503000CA9A8 /* BlockAllocator.cpp in Sources */,
16571650
47B58F601F5B791500354C34 /* FlagGuard.cpp in Sources */,
16581651
4731DDFC1DC8FBEE00E7F931 /* Island.cpp in Sources */,
1659-
473273271F47760D00E22AE2 /* OptionalValue.cpp in Sources */,
16601652
474BC4341D413DC200447DCD /* Manifold.cpp in Sources */,
16611653
475A945B1D9593A4000CA9A8 /* Shape.cpp in Sources */,
16621654
474BC4351D413DC200447DCD /* Mat33.cpp in Sources */,

CMakeLists.txt

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,11 @@
22
# Top level docs for 3.1.3 at: https://cmake.org/cmake/help/v3.1/
33
# Commands herein described at: https://cmake.org/cmake/help/v3.1/manual/cmake-commands.7.html
44

5-
# Minimally require CMake version 3.1...
6-
cmake_minimum_required(VERSION 3.1)
5+
# Minimally require a CMake version that can handle what's necessary...
6+
# According to the following link, support for cxx_std_17 first became available in CMake 3.8.
7+
# https://github.com/Kitware/CMake/blob/07cfb18f9d29cfc0588ede928846a03ec5599c48/Help/release/3.8.rst
8+
# It's not clear that CMake 3.8 is enough though. So 3.10 is picked in hopes that dust settled then.
9+
cmake_minimum_required(VERSION 3.10)
710

811
# Require C++17...
912
set(CMAKE_CXX_STANDARD 17)
@@ -46,7 +49,7 @@ option(PLAYRHO_BUILD_BENCHMARK "Build PlayRho Benchmark console application." OF
4649
option(PLAYRHO_BUILD_TESTBED "Build PlayRho Testbed GUI application." OFF)
4750
option(PLAYRHO_ENABLE_COVERAGE "Enable code coverage generation." OFF)
4851

49-
set(PLAYRHO_VERSION 0.9.0)
52+
set(PLAYRHO_VERSION 0.12.0)
5053
set(LIB_INSTALL_DIR lib${LIB_SUFFIX})
5154

5255
# Tell Microsoft Visual C (MSVC) to enable unwind semantics since it doesn't by default.

Documentation/Doxyfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ PROJECT_NAME = PlayRho
3838
# could be handy for archiving the generated documentation or if some version
3939
# control system is used.
4040

41-
PROJECT_NUMBER = 0.11.1
41+
PROJECT_NUMBER = 0.12.0
4242

4343
# Using the PROJECT_BRIEF tag one can provide an optional one line description
4444
# for a project that appears at the top of each page and should give viewer a

INSTALL.md

Lines changed: 17 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Additionally, PlayRho provides some demo/test applications which may provide ext
1313
## Prerequisite Tasks
1414

1515
1. Make sure you have the tools that will be needed.
16-
- **CMake**: If you don't already have CMake installed on your system, it can be obtained from https://cmake.org/.
16+
- **CMake**: If you don't have version 3.16 or higher of CMake installed on your system, the latest releases of CMake can be obtained from https://cmake.org/.
1717
- **A C++17 compiler suite**: That could be Microsoft's Visual C++, GNU's GCC, or LLVM's Clang. On Microsoft Windows platforms, you can get a complete C++17 compiler suite by getting Microsoft's Visual Studio 2017 from https://www.visualstudio.com/downloads/.
1818
- **git**: Needed only if you want to do development work. If you don't already have Git installed but you want to install it, you can get it from: https://git-scm.com/downloads.
1919
2. Decide where you want to put the source code.
@@ -42,29 +42,32 @@ From a command prompt like a Bash Shell, enter code such as the following where
4242

4343
This should download the sources into the `${YOUR_CHOSEN_PATH}` directory under the sub-directory of `PlayRho`.
4444

45-
## Building On Linux Systems
46-
47-
### Using CMake
45+
## Building From A Bash Shell Using CMake and Make
4846

4947
This folder contains a CMake configuration file `CMakeLists.txt`. It can be used by `cmake` to build the library and all of the application targets on Linux platforms with either GCC C++ or Clang C++. This is the currently suggested way to build things for Linux. Simply run `cmake . && make`. To install the built targets, then run `make install`. This may require a tool like `sudo` to escalate your privileges in order to be able to install into the established folders. The CMake configuration file has a few options that can be modified to build different targets.
5048

5149
Note: if you have trouble building with these instructions, you can also see how PlayRho gets built on the [Travis](https://travis-ci.org) Continuous Integration (CI) system, by looking at the [`.travis.yml`](.travis.yml) file's `script` definition.
5250

53-
## Building On Mac OS X
54-
55-
### Using Xcode
51+
## Building On Mac OS X Using Xcode
5652

5753
The [`Build/xcode5`](Build/xcode5) folder contains project files for Xcode. The Xcode project file can be used to build the library and all of the application targets on and for the Mac OS X platform.
5854

59-
### Using CMake
60-
61-
Instructions coming.
62-
63-
## Building On Windows
64-
65-
### Using CMake
55+
## Building On Windows Using CMake-GUI and Visual Studio
6656

6757
Start CMake up with the location of the source code identified for it. By default, only `PLAYRHO_BUILD_STATIC` has a defined value and that should be all that's necessary for simply building the library itself.
58+
Other `PLAYRHO_BUILD_*` CMake variables can be used to build additional things like the `UnitTest` or `Testbed` applications.
59+
Press *Configure* or *Generate*.
60+
If you haven't run CMake before for this project, CMake won't already have a cache of settings,
61+
and will ask you some additional information like which generator to use.
62+
Select Visual Studio 15 2017 or newer to generate the project and solution files for that version of Visual Studio and to invoke that version whenever you press the *Open Project* button.
63+
If you want 64-bit support, you'll need to choose the optional platform generator for your system - that would be `x64` to build for 64-bit Intel X64 platforms.
64+
Use the default native compilers.
65+
Then press the *Finish* button.
66+
CMake may create new variables or need your help especially if you want to also build an optional application like the `Testbed`.
67+
If you change any CMake variables, be sure to press the Generate button.
68+
Finally, press the *Open Project* button. This will open up Visual Studio.
69+
70+
From within Visual Studio, select "Release" and initiate a build.
6871

6972
Note: if you have trouble building with these instructions, you can also see how PlayRho gets built on the [AppVeyor](https://ci.appveyor.com/) Continuous Integration (CI) system, by looking at the [`appveyor.yml`](appveyor.yml) file's `build_script` definition.
7073

@@ -101,17 +104,3 @@ where this file is located):
101104

102105
You might want to add `-DCMAKE_INSTALL_PREFIX=/opt/PlayRho` or similar to the cmake call to change
103106
the installation location. make install might need sudo.
104-
105-
### No Longer Supported: premake
106-
107-
For other platforms you may be able to run `premake` in this directory.
108-
Premake can be obtained from:
109-
http://industriousone.com/premake
110-
111-
For example, on Linux, you would type:
112-
113-
premake4 gmake
114-
115-
This will create a gmake folder in the Build directory. From there you can run:
116-
117-
make config="debug"

PlayRho/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ if(PLAYRHO_BUILD_SHARED)
7171
${PLAYRHO_Rope_SRCS}
7272
${PLAYRHO_Rope_HDRS}
7373
)
74+
target_compile_features(PlayRho PUBLIC cxx_std_17)
7475
set_target_properties(PlayRho_shared PROPERTIES
7576
OUTPUT_NAME "PlayRho"
7677
CLEAN_DIRECT_OUTPUT 1
@@ -96,6 +97,7 @@ if(PLAYRHO_BUILD_STATIC)
9697
${PLAYRHO_Rope_SRCS}
9798
${PLAYRHO_Rope_HDRS}
9899
)
100+
target_compile_features(PlayRho PUBLIC cxx_std_17)
99101
set_target_properties(PlayRho PROPERTIES
100102
CLEAN_DIRECT_OUTPUT 1
101103
VERSION ${PLAYRHO_VERSION}

PlayRho/Collision/RayCastOutput.hpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,13 @@
2626
/// Declaration of the RayCastOutput structure and related free functions.
2727

2828
#include <PlayRho/Common/UnitInterval.hpp>
29-
#include <PlayRho/Common/OptionalValue.hpp>
3029
#include <PlayRho/Collision/RayCastInput.hpp>
3130

3231
#include <PlayRho/Dynamics/BodyID.hpp>
3332
#include <PlayRho/Dynamics/FixtureID.hpp>
3433

34+
#include <optional>
35+
3536
namespace playrho {
3637
namespace detail {
3738

@@ -85,8 +86,8 @@ struct RayCastHit
8586

8687
/// @brief Ray cast output.
8788
/// @details This is a type alias for an optional <code>RayCastHit</code> instance.
88-
/// @see RayCast, Optional, RayCastHit
89-
using RayCastOutput = Optional<RayCastHit>;
89+
/// @see RayCast, RayCastHit
90+
using RayCastOutput = std::optional<RayCastHit>;
9091

9192
/// @brief Ray cast callback function.
9293
/// @note Return 0 to terminate ray casting, or > 0 to update the segment bounding box.

0 commit comments

Comments
 (0)