Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updates 20240227 #574

Merged
merged 3 commits into from
Apr 14, 2024
Merged
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
8 changes: 0 additions & 8 deletions Build/xcode5/PlayRho.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -412,8 +412,6 @@
996B7B8D2A6DF25200A8207F /* PoolMemoryResource.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 996B7B8A2A6DF25200A8207F /* PoolMemoryResource.cpp */; };
996B7B8F2A6EED6200A8207F /* polymorphic_allocator.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 996B7B8E2A6EED6200A8207F /* polymorphic_allocator.cpp */; };
9980D10A29C8ACB700007B35 /* WorldConf.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9980D10929C8ACB700007B35 /* WorldConf.cpp */; };
998A7C012A801C1C00F29B01 /* ClipList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 998A7BFF2A801C1C00F29B01 /* ClipList.cpp */; };
998A7C022A801C1C00F29B01 /* ClipList.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 998A7C002A801C1C00F29B01 /* ClipList.hpp */; };
998A7C052A80404600F29B01 /* StatsResource.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 998A7C032A80404600F29B01 /* StatsResource.cpp */; };
998A7C062A80404600F29B01 /* StatsResource.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 998A7C042A80404600F29B01 /* StatsResource.hpp */; };
998A7C082A814F9300F29B01 /* StatsResource.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 998A7C072A814F9300F29B01 /* StatsResource.cpp */; };
Expand Down Expand Up @@ -920,8 +918,6 @@
996B7B8A2A6DF25200A8207F /* PoolMemoryResource.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PoolMemoryResource.cpp; sourceTree = "<group>"; };
996B7B8E2A6EED6200A8207F /* polymorphic_allocator.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = polymorphic_allocator.cpp; sourceTree = "<group>"; };
9980D10929C8ACB700007B35 /* WorldConf.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = WorldConf.cpp; sourceTree = "<group>"; };
998A7BFF2A801C1C00F29B01 /* ClipList.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = ClipList.cpp; sourceTree = "<group>"; };
998A7C002A801C1C00F29B01 /* ClipList.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = ClipList.hpp; sourceTree = "<group>"; };
998A7C032A80404600F29B01 /* StatsResource.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = StatsResource.cpp; sourceTree = "<group>"; };
998A7C042A80404600F29B01 /* StatsResource.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = StatsResource.hpp; sourceTree = "<group>"; };
998A7C072A814F9300F29B01 /* StatsResource.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = StatsResource.cpp; sourceTree = "<group>"; };
Expand Down Expand Up @@ -1298,7 +1294,6 @@
470F94A51EC4C79B00AA3C82 /* BodyConf.hpp */,
474BAB2C1E5D00960058E08A /* BodyConstraint.hpp */,
80BB8936141C3E5900F1753A /* ChainShapeConf.hpp */,
998A7C002A801C1C00F29B01 /* ClipList.hpp */,
476162C71E245C9D002C7FB0 /* CodeDumper.hpp */,
99D1BE242AEF1FFD001BA497 /* ContactImpulsesFunction.hpp */,
47363E8520027FE2005912B1 /* ContactImpulsesList.hpp */,
Expand Down Expand Up @@ -1384,7 +1379,6 @@
80BB894D141C3E5900F1753A /* Body.cpp */,
470F9B4B1EEF20B6007EF7B6 /* BodyConf.cpp */,
80BB8935141C3E5900F1753A /* ChainShapeConf.cpp */,
998A7BFF2A801C1C00F29B01 /* ClipList.cpp */,
476162C61E245C9D002C7FB0 /* CodeDumper.cpp */,
47363E8420027FE2005912B1 /* ContactImpulsesList.cpp */,
80BB8963141C3E5900F1753A /* ContactSolver.cpp */,
Expand Down Expand Up @@ -1647,7 +1641,6 @@
4734B2271DC29F7C00F15E29 /* SimplexEdge.hpp in Headers */,
4787D6BB1F2E946E008C115E /* PrismaticJointConf.hpp in Headers */,
47C85D1B1F0D9D8D00F70C56 /* Units.hpp in Headers */,
998A7C022A801C1C00F29B01 /* ClipList.hpp in Headers */,
99D1BE212AEF18F8001BA497 /* ShapeFunction.hpp in Headers */,
998A7C0C2A82D55100F29B01 /* Contactable.hpp in Headers */,
470F9B181EDF2959007EF7B6 /* Transformation.hpp in Headers */,
Expand Down Expand Up @@ -2171,7 +2164,6 @@
47363E8920029DFD005912B1 /* Velocity.cpp in Sources */,
4787D6BA1F2E946E008C115E /* PrismaticJointConf.cpp in Sources */,
4787D6CE1F2EC902008C115E /* MotorJointConf.cpp in Sources */,
998A7C012A801C1C00F29B01 /* ClipList.cpp in Sources */,
4787D6CA1F2EA3A1008C115E /* GearJointConf.cpp in Sources */,
80BB89BE141C3E5900F1753A /* Contact.cpp in Sources */,
80BB89C0141C3E5900F1753A /* ContactSolver.cpp in Sources */,
Expand Down
2 changes: 0 additions & 2 deletions Library/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,6 @@ set(PLAYRHO_D2_HDRS
include/playrho/d2/BodyConf.hpp
include/playrho/d2/BodyConstraint.hpp
include/playrho/d2/ChainShapeConf.hpp
include/playrho/d2/ClipList.hpp
include/playrho/d2/CodeDumper.hpp
include/playrho/d2/ContactImpulsesFunction.hpp
include/playrho/d2/ContactImpulsesList.hpp
Expand Down Expand Up @@ -277,7 +276,6 @@ set(PLAYRHO_D2_SRCS
source/playrho/d2/Body.cpp
source/playrho/d2/BodyConf.cpp
source/playrho/d2/ChainShapeConf.cpp
source/playrho/d2/ClipList.cpp
source/playrho/d2/CodeDumper.cpp
source/playrho/d2/ContactImpulsesList.cpp
source/playrho/d2/ContactSolver.cpp
Expand Down
18 changes: 12 additions & 6 deletions Library/include/playrho/BodyID.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,18 +34,24 @@
namespace playrho {

/// @brief Body identifier.
/// @details A strongly typed identifier for uniquely identifying bodes within @c d2::World
/// instances. This is based on the @c BodyCounter type as its underlying type.
/// @see BodyCounter, ContactID, JointID, ShapeID, d2::Body, d2::World.
/// @details A strongly typed identifier for uniquely identifying bodes within
/// @c playrho::d2::World instances.
/// This is based on the @c playrho::BodyCounter type as its underlying type.
/// These identifiers can be compared with other body identifiers.
/// Two body identifiers from the same world that compare equal for example,
/// identify the same body within that world.
/// @see InvalidBodyID, BodyCounter, ContactID, JointID, ShapeID, d2::Body, d2::World.
using BodyID = detail::IndexingNamedType<BodyCounter, struct BodyIdentifier>;

/// @brief Invalid body ID value.
/// @details A special, reserved value of a @c BodyID that represents/identifies an _invalid_ body.
/// @details A special, reserved value of a @c playrho::BodyID that
/// represents/identifies an _invalid_ body.
/// @see BodyID, IsValid.
constexpr auto InvalidBodyID = BodyID{static_cast<BodyID::underlying_type>(-1)};

/// @brief Determines validity of given value by comparing against <code>InvalidBodyID</code>.
/// @return true if not equal to @c InvalidBodyID , else false.
/// @brief Determines validity of given value by comparing against
/// @c playrho::InvalidBodyID .
/// @return true if not equal to @c playrho::InvalidBodyID , else false.
/// @see BodyID, InvalidBodyID.
constexpr auto IsValid(const BodyID& value) noexcept -> bool
{
Expand Down
18 changes: 12 additions & 6 deletions Library/include/playrho/ContactID.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,18 +35,24 @@
namespace playrho {

/// @brief Contact identifier.
/// @details A strongly typed identifier for uniquely identifying contacts within @c d2::World
/// instances. This is based on the @c ContactCounter type as its underlying type.
/// @see Contact, ContactCounter, BodyID, JointID, ShapeID, d2::World.
/// @details A strongly typed identifier for uniquely identifying contacts within
/// @c playrho::d2::World instances.
/// This is based on the @c playrho::ContactCounter type as its underlying type.
/// These identifiers can be compared with other contact identifiers.
/// Two contact identifiers from the same world that compare equal for example,
/// identify the same contact within that world.
/// @see InvalidContactID, Contact, ContactCounter, BodyID, JointID, ShapeID, d2::World.
using ContactID = detail::IndexingNamedType<ContactCounter, struct ContactIdentifier>;

/// @brief Invalid contact ID value.
/// @details A special, reserved value of a @c ContactID that represents/identifies an _invalid_ contact.
/// @details A special, reserved value of a @c playrho::ContactID that
/// represents/identifies an _invalid_ contact.
/// @see ContactID, IsValid.
constexpr auto InvalidContactID = ContactID{static_cast<ContactID::underlying_type>(-1)};

/// @brief Determines validity of given value by comparing against <code>InvalidContactID</code>.
/// @return true if not equal to @c InvalidContactID , else false.
/// @brief Determines validity of given value by comparing against
/// @c playrho::InvalidContactID .
/// @return true if not equal to @c playrho::InvalidContactID , else false.
/// @see ContactID, InvalidContactID.
constexpr auto IsValid(const ContactID& value) noexcept -> bool
{
Expand Down
18 changes: 12 additions & 6 deletions Library/include/playrho/JointID.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,18 +34,24 @@
namespace playrho {

/// @brief Joint identifier.
/// @details A strongly typed identifier for uniquely identifying joints within @c d2::World
/// instances. This is based on the @c JointCounter type as its underlying type.
/// @see JointCounter, BodyID, ContactID, ShapeID, d2::Joint, d2::World.
/// @details A strongly typed identifier for uniquely identifying joints within
/// @c playrho::d2::World instances.
/// This is based on the @c playrho::JointCounter type as its underlying type.
/// These identifiers can be compared with other joint identifiers.
/// Two joint identifiers from the same world that compare equal for example,
/// identify the same joint within that world.
/// @see InvalidJointID, JointCounter, BodyID, ContactID, ShapeID, d2::Joint, d2::World.
using JointID = detail::IndexingNamedType<JointCounter, struct JointIdentifier>;

/// @brief Invalid joint ID value.
/// @details A special, reserved value of a @c JointID that represents/identifies an _invalid_ joint.
/// @details A special, reserved value of a @c playrho::JointID that
/// represents/identifies an _invalid_ joint.
/// @see JointID, IsValid.
constexpr auto InvalidJointID = JointID{static_cast<JointID::underlying_type>(-1)};

/// @brief Determines validity of given value by comparing against <code>InvalidJointID</code>.
/// @return true if not equal to @c InvalidJointID , else false.
/// @brief Determines validity of given value by comparing against
/// @c playrho::InvalidJointID .
/// @return true if not equal to @c playrho::InvalidJointID , else false.
/// @see JointID, InvalidJointID.
constexpr auto IsValid(const JointID& value) noexcept -> bool
{
Expand Down
28 changes: 13 additions & 15 deletions Library/include/playrho/Settings.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -175,29 +175,26 @@ constexpr auto DefaultRegMinMomentum = Momentum{0_Ns / 100};
constexpr auto DefaultToiMinMomentum = Momentum{0_Ns / 100};

/// @brief Maximum number of bodies in a world.
/// @note This is 2^16 - 2, i.e. 65534, based off <code>std::uint16_t</code> and eliminating one value for
/// the _invalid_ body identifier (@c InvalidBodyID).
/// @note This is 2^16 - 2, i.e. 65534, based off <code>std::uint16_t</code> and eliminating one
/// value for the _invalid_ body identifier (@c playrho::InvalidBodyID ).
/// @see BodyCounter, BodyID, InvalidBodyID, MaxContacts, MaxJoints, MaxShapes.
constexpr auto MaxBodies = static_cast<std::uint16_t>(std::numeric_limits<std::uint16_t>::max() -
std::uint16_t{1});

/// @brief Count type for bodies.
/// @note This type must always be able to contain the @c MaxBodies value.
/// @note This type must always be able to contain the @c playrho::MaxBodies value.
/// @see MaxBodies, ContactCounter, JointCounter, ShapeCounter.
using BodyCounter = std::remove_const_t<decltype(MaxBodies)>;

/// @brief Count type for contacts.
/// @note This type is meant to contain up to the square of the maximum value of a <code>BodyCounter</code> without possibility of overflow.
/// @note This type is meant to contain up to the square of the maximum value of a
/// @c playrho::BodyCounter without possibility of overflow.
/// @see MaxContacts, BodyCounter, JointCounter, ShapeCounter.
using ContactCounter = WiderType<BodyCounter>;

/// @brief Invalid contact index.
/// @see ContactCounter.
constexpr auto InvalidContactIndex = static_cast<ContactCounter>(-1);

/// @brief Maximum number of contacts in a world (2147319811).
/// @details Uses the formula for the maximum number of edges in an unidirectional graph of
/// <code>MaxBodies</code> nodes.
/// @details Uses the formula for the maximum number of edges in an unidirectional graph
/// of @c playrho::MaxBodies nodes.
/// This occurs when every possible body is connected to every other body.
/// @see ContactCounter. ContactID, InvalidContactID, MaxBodies, MaxJoints, MaxShapes.
constexpr auto MaxContacts = ContactCounter{MaxBodies} * ContactCounter{MaxBodies - 1} / ContactCounter{2};
Expand All @@ -206,25 +203,26 @@ constexpr auto MaxContacts = ContactCounter{MaxBodies} * ContactCounter{MaxBodie
using DynamicTreeSize = ContactCounter;

/// @brief Maximum number of joints in a world.
/// @note This is 2^16 - 2, i.e. 65534, based off <code>std::uint16_t</code> and eliminating one value for
/// the invalid joint identifier (@c InvalidJointID).
/// @note This is 2^16 - 2, i.e. 65534, based off <code>std::uint16_t</code> and eliminating one
/// value for the invalid joint identifier (@c playrho::InvalidJointID ).
/// @see JointCounter, JointID. InvalidJointID, MaxBodies, MaxContacts. MaxShapes.
constexpr auto MaxJoints = static_cast<std::uint16_t>(std::numeric_limits<std::uint16_t>::max() -
std::uint16_t{1});

/// @brief Counter type for joints.
/// @note This type must be able to contain the @c MaxJoints value.
/// @note This type must be able to contain the @c playrho::MaxJoints value.
/// @see MaxJoints, BodyCounter, ContactCounter, ShapeCounter.
using JointCounter = std::remove_const_t<decltype(MaxJoints)>;

/// @brief Maximum number of shapes in a world.
/// @note This is 65534 based off <code>std::uint16_t</code> and eliminating one value for invalid.
/// @note This is 65534 based off <code>std::uint16_t</code> and eliminating one value for
/// the invalid shape identifier (@c playrho::InvalidShapeID ).
/// @see ShapeCounter, ShapeID, InvalidShapeID, MaxBodies, MaxContacts, MaxJoints.
constexpr auto MaxShapes = static_cast<std::uint16_t>(std::numeric_limits<std::uint16_t>::max() -
std::uint16_t{1});

/// @brief Count type for shapes.
/// @note This type must always be able to contain the <code>MaxShapes</code> value.
/// @note This type must always be able to contain the @c playrho::MaxShapes value.
/// @see MaxShapes, BodyCounter, ContactCounter, JointCounter.
using ShapeCounter = std::remove_const_t<decltype(MaxShapes)>;

Expand Down
Loading
Loading