mirror of
https://github.com/SFML/CSFML.git
synced 2026-10-27 21:36:13 +01:00
Implement getGeometricCenter
This commit is contained in:
1 parent
77b3035308
commit
fbe6e6193f
8 files changed
+88
No files matched your search
@@ -369,6 +369,20 @@ CSFML_GRAPHICS_API size_t sfCircleShape_getPointCount(const sfCircleShape* shape
|
|||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
CSFML_GRAPHICS_API sfVector2f sfCircleShape_getPoint(const sfCircleShape* shape, size_t index);
|
CSFML_GRAPHICS_API sfVector2f sfCircleShape_getPoint(const sfCircleShape* shape, size_t index);
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////
|
||||||
|
/// \brief Get the geometric center of the circle
|
||||||
|
///
|
||||||
|
/// The returned point is in local coordinates, that is,
|
||||||
|
/// the shape's transforms (position, rotation, scale) are
|
||||||
|
/// not taken into account.
|
||||||
|
///
|
||||||
|
/// \param shape Shape object
|
||||||
|
///
|
||||||
|
/// \return The geometric center of the shape
|
||||||
|
///
|
||||||
|
////////////////////////////////////////////////////////////
|
||||||
|
CSFML_GRAPHICS_API sfVector2f sfCircleShape_getGeometricCenter(const sfCircleShape* shape);
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
/// \brief Set the radius of a circle
|
/// \brief Set the radius of a circle
|
||||||
///
|
///
|
||||||
|
|||||||
@@ -369,6 +369,20 @@ CSFML_GRAPHICS_API size_t sfConvexShape_getPointCount(const sfConvexShape* shape
|
|||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
CSFML_GRAPHICS_API sfVector2f sfConvexShape_getPoint(const sfConvexShape* shape, size_t index);
|
CSFML_GRAPHICS_API sfVector2f sfConvexShape_getPoint(const sfConvexShape* shape, size_t index);
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////
|
||||||
|
/// \brief Get the geometric center of a convex shape
|
||||||
|
///
|
||||||
|
/// The returned point is in local coordinates, that is,
|
||||||
|
/// the shape's transforms (position, rotation, scale) are
|
||||||
|
/// not taken into account.
|
||||||
|
///
|
||||||
|
/// \param shape Shape object
|
||||||
|
///
|
||||||
|
/// \return The geometric center of the shape
|
||||||
|
///
|
||||||
|
////////////////////////////////////////////////////////////
|
||||||
|
CSFML_GRAPHICS_API sfVector2f sfConvexShape_getGeometricCenter(const sfConvexShape* shape);
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
/// \brief Set the number of points of a convex shap
|
/// \brief Set the number of points of a convex shap
|
||||||
///
|
///
|
||||||
|
|||||||
@@ -369,6 +369,20 @@ CSFML_GRAPHICS_API size_t sfRectangleShape_getPointCount(const sfRectangleShape*
|
|||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
CSFML_GRAPHICS_API sfVector2f sfRectangleShape_getPoint(const sfRectangleShape* shape, size_t index);
|
CSFML_GRAPHICS_API sfVector2f sfRectangleShape_getPoint(const sfRectangleShape* shape, size_t index);
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////
|
||||||
|
/// \brief Get the geometric center of the rectangle
|
||||||
|
///
|
||||||
|
/// The returned point is in local coordinates, that is,
|
||||||
|
/// the shape's transforms (position, rotation, scale) are
|
||||||
|
/// not taken into account.
|
||||||
|
///
|
||||||
|
/// \param shape Shape object
|
||||||
|
///
|
||||||
|
/// \return The geometric center of the shape
|
||||||
|
///
|
||||||
|
////////////////////////////////////////////////////////////
|
||||||
|
CSFML_GRAPHICS_API sfVector2f sfRectangleShape_getGeometricCenter(const sfRectangleShape* shape);
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
/// \brief Set the size of a rectangle shape
|
/// \brief Set the size of a rectangle shape
|
||||||
///
|
///
|
||||||
|
|||||||
@@ -368,6 +368,20 @@ CSFML_GRAPHICS_API size_t sfShape_getPointCount(const sfShape* shape);
|
|||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
CSFML_GRAPHICS_API sfVector2f sfShape_getPoint(const sfShape* shape, size_t index);
|
CSFML_GRAPHICS_API sfVector2f sfShape_getPoint(const sfShape* shape, size_t index);
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////
|
||||||
|
/// \brief Get the geometric center of the shape
|
||||||
|
///
|
||||||
|
/// The returned point is in local coordinates, that is,
|
||||||
|
/// the shape's transforms (position, rotation, scale) are
|
||||||
|
/// not taken into account.
|
||||||
|
///
|
||||||
|
/// \param shape Shape object
|
||||||
|
///
|
||||||
|
/// \return The geometric center of the shape
|
||||||
|
///
|
||||||
|
////////////////////////////////////////////////////////////
|
||||||
|
CSFML_GRAPHICS_API sfVector2f sfShape_getGeometricCenter(const sfShape* shape);
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
/// \brief Get the local bounding rectangle of a shape
|
/// \brief Get the local bounding rectangle of a shape
|
||||||
///
|
///
|
||||||
|
|||||||
@@ -263,6 +263,14 @@ sfVector2f sfCircleShape_getPoint(const sfCircleShape* shape, size_t index)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////
|
||||||
|
sfVector2f sfCircleShape_getGeometricCenter(const sfCircleShape* shape)
|
||||||
|
{
|
||||||
|
assert(shape);
|
||||||
|
return convertVector2(shape->This.getGeometricCenter());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
void sfCircleShape_setRadius(sfCircleShape* shape, float radius)
|
void sfCircleShape_setRadius(sfCircleShape* shape, float radius)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -260,6 +260,14 @@ sfVector2f sfConvexShape_getPoint(const sfConvexShape* shape, size_t index)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////
|
||||||
|
sfVector2f sfConvexShape_getGeometricCenter(const sfConvexShape* shape)
|
||||||
|
{
|
||||||
|
assert(shape);
|
||||||
|
return convertVector2(shape->This.getGeometricCenter());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
void sfConvexShape_setPointCount(sfConvexShape* shape, size_t count)
|
void sfConvexShape_setPointCount(sfConvexShape* shape, size_t count)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -260,6 +260,14 @@ sfVector2f sfRectangleShape_getPoint(const sfRectangleShape* shape, size_t index
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////
|
||||||
|
sfVector2f sfRectangleShape_getGeometricCenter(const sfRectangleShape* shape)
|
||||||
|
{
|
||||||
|
assert(shape);
|
||||||
|
return convertVector2(shape->This.getGeometricCenter());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
void sfRectangleShape_setSize(sfRectangleShape* shape, sfVector2f size)
|
void sfRectangleShape_setSize(sfRectangleShape* shape, sfVector2f size)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -252,6 +252,14 @@ sfVector2f sfShape_getPoint(const sfShape* shape, size_t index)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////
|
||||||
|
sfVector2f sfShape_getGeometricCenter(const sfShape* shape)
|
||||||
|
{
|
||||||
|
assert(shape);
|
||||||
|
return convertVector2(shape->getGeometricCenter());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
sfFloatRect sfShape_getLocalBounds(const sfShape* shape)
|
sfFloatRect sfShape_getLocalBounds(const sfShape* shape)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in new issue
Block a user