diff --git a/Library/include/playrho/d2/Body.hpp b/Library/include/playrho/d2/Body.hpp index d2de86ab05..ada889c4a5 100644 --- a/Library/include/playrho/d2/Body.hpp +++ b/Library/include/playrho/d2/Body.hpp @@ -165,6 +165,7 @@ class Body /// Sets the body's velocity. /// @note This sets what GetVelocity() returns. + /// @pre IsSpeedable() is true or given velocity is zero. /// @see GetVelocity. void JustSetVelocity(const Velocity& value) noexcept; @@ -230,12 +231,16 @@ class Body BodyType GetType() const noexcept; /// @brief Sets the type of this body. + /// @post GetType() returns type set. + /// @post GetUnderActiveTime() returns 0. + /// @post IsAwake() returns true for BodyType::Dynamic or + /// BodyType::Kinematic, and returns false for BodyType::Static. /// @see GetType. void SetType(BodyType value) noexcept; /// @brief Is "speedable". /// @details Is this body able to have a non-zero speed associated with it. - /// Kinematic and Dynamic bodies are speedable. Static bodies are not. + /// Kinematic and Dynamic bodies are speedable. Static bodies are not. /// @see GetType, SetType. bool IsSpeedable() const noexcept; @@ -247,19 +252,21 @@ class Body bool IsAccelerable() const noexcept; /// @brief Is this body treated like a bullet for continuous collision detection? - /// @see GetType, SetType, SetImpenetrable, UnsetImpenetrable. + /// @see SetImpenetrable, UnsetImpenetrable. bool IsImpenetrable() const noexcept; /// @brief Sets the impenetrable status of this body. - /// @details Sets whether or not this body should be treated like a bullet for continuous - /// collision detection. - /// @see IsImpenetrable, GetType, SetType. + /// @details Sets that this body should be treated like a bullet for continuous collision + /// detection. + /// @post IsImpenetrable() returns true. + /// @see IsImpenetrable. void SetImpenetrable() noexcept; /// @brief Unsets the impenetrable status of this body. - /// @details Sets whether or not this body should be treated like a bullet for continuous - /// collision detection. - /// @see IsImpenetrable, GetType, SetType. + /// @details Unsets that this body should be treated like a bullet for continuous collision + /// detection. + /// @post IsImpenetrable() returns false. + /// @see IsImpenetrable. void UnsetImpenetrable() noexcept; /// @brief Gets whether or not this body allowed to sleep. @@ -389,18 +396,25 @@ class Body const std::vector& GetShapes() const noexcept; /// @brief Sets the identifiers of the shapes attached to this body. - /// @note This also sets the mass-data-dirty flag. + /// @post GetShapes() returns the value given. + /// @post IsMassDataDirty() returns true. /// @see GetShapes, Attach, Detach. void SetShapes(std::vector value); /// @brief Adds the given shape identifier to the identifiers associated with this body. - /// @note This also sets the mass-data-dirty flag. Call SetInvMassData to clear it. + /// @param shapeId Identifier of the shape to attach. /// @pre @p shapeId is not @c InvalidShapeID . - /// @see GetShapes, SetShapes, Detach, SetInvMassData. + /// @post IsMassDataDirty() returns true. + /// @post GetShapes() returned container contains the given identifier. + /// @see Detach, GetShapes, SetShapes, IsMassDataDirty. Body& Attach(ShapeID shapeId); /// @brief Removes the given shape identifier from the identifiers associated with this body. /// @note This also sets the mass-data-dirty flag. Call SetInvMassData to clear it. + /// @param shapeId Identifier of the shape to detach. + /// @return true if identified shape was detached, false otherwise. + /// @post IsMassDataDirty() returns true if this function returned true. + /// @post GetShapes() returned container contains one less of the identifier. /// @see GetShapes, SetShapes, Attach, SetInvMassData. bool Detach(ShapeID shapeId);