Skip to content

Commit 361dcb2

Browse files
committed
WARNING: REVIEWED: DrawCapsule()/DrawCapsuleWires() parameter order
for consistency with `DrawSphere*()`
1 parent 5082f5a commit 361dcb2

2 files changed

Lines changed: 9 additions & 9 deletions

File tree

src/raylib.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1577,9 +1577,9 @@ RLAPI void DrawSphereWires(Vector3 centerPos, float radius, int rings, int slice
15771577
RLAPI void DrawCylinder(Vector3 position, float radiusTop, float radiusBottom, float height, int slices, Color color); // Draw a cylinder/cone
15781578
RLAPI void DrawCylinderEx(Vector3 startPos, Vector3 endPos, float startRadius, float endRadius, int sides, Color color); // Draw a cylinder with base at startPos and top at endPos
15791579
RLAPI void DrawCylinderWires(Vector3 position, float radiusTop, float radiusBottom, float height, int slices, Color color); // Draw a cylinder/cone wires
1580-
RLAPI void DrawCylinderWiresEx(Vector3 startPos, Vector3 endPos, float startRadius, float endRadius, int sides, Color color); // Draw a cylinder wires with base at startPos and top at endPos
1581-
RLAPI void DrawCapsule(Vector3 startPos, Vector3 endPos, float radius, int slices, int rings, Color color); // Draw a capsule with the center of its sphere caps at startPos and endPos
1582-
RLAPI void DrawCapsuleWires(Vector3 startPos, Vector3 endPos, float radius, int slices, int rings, Color color); // Draw capsule wireframe with the center of its sphere caps at startPos and endPos
1580+
RLAPI void DrawCylinderWiresEx(Vector3 startPos, Vector3 endPos, float startRadius, float endRadius, int slices, Color color); // Draw a cylinder wires with base at startPos and top at endPos
1581+
RLAPI void DrawCapsule(Vector3 startPos, Vector3 endPos, float radius, int rings, int slices, Color color); // Draw a capsule with the center of its sphere caps at startPos and endPos
1582+
RLAPI void DrawCapsuleWires(Vector3 startPos, Vector3 endPos, float radius, int rings, int slices, Color color); // Draw capsule wireframe with the center of its sphere caps at startPos and endPos
15831583
RLAPI void DrawPlane(Vector3 centerPos, Vector2 size, Color color); // Draw a plane XZ
15841584
RLAPI void DrawRay(Ray ray, Color color); // Draw a ray line
15851585
RLAPI void DrawGrid(int slices, float spacing); // Draw a grid (centered at (0, 0, 0))

src/rmodels.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -724,9 +724,9 @@ void DrawCylinderWires(Vector3 position, float radiusTop, float radiusBottom, fl
724724

725725
// Draw a wired cylinder with base at startPos and top at endPos
726726
// NOTE: It could be also used for pyramid and cone
727-
void DrawCylinderWiresEx(Vector3 startPos, Vector3 endPos, float startRadius, float endRadius, int sides, Color color)
727+
void DrawCylinderWiresEx(Vector3 startPos, Vector3 endPos, float startRadius, float endRadius, int slices, Color color)
728728
{
729-
if (sides < 3) sides = 3;
729+
if (slices < 3) slices = 3;
730730

731731
Vector3 direction = { endPos.x - startPos.x, endPos.y - startPos.y, endPos.z - startPos.z };
732732
if ((direction.x == 0) && (direction.y == 0) && (direction.z == 0)) return; // Security check
@@ -735,12 +735,12 @@ void DrawCylinderWiresEx(Vector3 startPos, Vector3 endPos, float startRadius, fl
735735
Vector3 b1 = Vector3Normalize(Vector3Perpendicular(direction));
736736
Vector3 b2 = Vector3Normalize(Vector3CrossProduct(b1, direction));
737737

738-
float baseAngle = (2.0f*PI)/sides;
738+
float baseAngle = (2.0f*PI)/slices;
739739

740740
rlBegin(RL_LINES);
741741
rlColor4ub(color.r, color.g, color.b, color.a);
742742

743-
for (int i = 0; i < sides; i++)
743+
for (int i = 0; i < slices; i++)
744744
{
745745
// Compute the four vertices
746746
float s1 = sinf(baseAngle*(i + 0))*startRadius;
@@ -769,7 +769,7 @@ void DrawCylinderWiresEx(Vector3 startPos, Vector3 endPos, float startRadius, fl
769769
}
770770

771771
// Draw a capsule with the center of its sphere caps at startPos and endPos
772-
void DrawCapsule(Vector3 startPos, Vector3 endPos, float radius, int slices, int rings, Color color)
772+
void DrawCapsule(Vector3 startPos, Vector3 endPos, float radius, int rings, int slices, Color color)
773773
{
774774
if (slices < 3) slices = 3;
775775

@@ -908,7 +908,7 @@ void DrawCapsule(Vector3 startPos, Vector3 endPos, float radius, int slices, int
908908
}
909909

910910
// Draw capsule wires with the center of its sphere caps at startPos and endPos
911-
void DrawCapsuleWires(Vector3 startPos, Vector3 endPos, float radius, int slices, int rings, Color color)
911+
void DrawCapsuleWires(Vector3 startPos, Vector3 endPos, float radius, int rings, int slices, Color color)
912912
{
913913
if (slices < 3) slices = 3;
914914

0 commit comments

Comments
 (0)