diff --git a/src/raylib.h b/src/raylib.h index 6c343d7b5..42ca7eabd 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -1577,9 +1577,9 @@ RLAPI void DrawSphereWires(Vector3 centerPos, float radius, int rings, int slice RLAPI void DrawCylinder(Vector3 position, float radiusTop, float radiusBottom, float height, int slices, Color color); // Draw a cylinder/cone 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 RLAPI void DrawCylinderWires(Vector3 position, float radiusTop, float radiusBottom, float height, int slices, Color color); // Draw a cylinder/cone wires -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 -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 -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 +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 +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 +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 RLAPI void DrawPlane(Vector3 centerPos, Vector2 size, Color color); // Draw a plane XZ RLAPI void DrawRay(Ray ray, Color color); // Draw a ray line RLAPI void DrawGrid(int slices, float spacing); // Draw a grid (centered at (0, 0, 0)) diff --git a/src/rmodels.c b/src/rmodels.c index bcc481962..eb7f30cb8 100644 --- a/src/rmodels.c +++ b/src/rmodels.c @@ -724,9 +724,9 @@ void DrawCylinderWires(Vector3 position, float radiusTop, float radiusBottom, fl // Draw a wired cylinder with base at startPos and top at endPos // NOTE: It could be also used for pyramid and cone -void DrawCylinderWiresEx(Vector3 startPos, Vector3 endPos, float startRadius, float endRadius, int sides, Color color) +void DrawCylinderWiresEx(Vector3 startPos, Vector3 endPos, float startRadius, float endRadius, int slices, Color color) { - if (sides < 3) sides = 3; + if (slices < 3) slices = 3; Vector3 direction = { endPos.x - startPos.x, endPos.y - startPos.y, endPos.z - startPos.z }; 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 Vector3 b1 = Vector3Normalize(Vector3Perpendicular(direction)); Vector3 b2 = Vector3Normalize(Vector3CrossProduct(b1, direction)); - float baseAngle = (2.0f*PI)/sides; + float baseAngle = (2.0f*PI)/slices; rlBegin(RL_LINES); rlColor4ub(color.r, color.g, color.b, color.a); - for (int i = 0; i < sides; i++) + for (int i = 0; i < slices; i++) { // Compute the four vertices float s1 = sinf(baseAngle*(i + 0))*startRadius; @@ -769,7 +769,7 @@ void DrawCylinderWiresEx(Vector3 startPos, Vector3 endPos, float startRadius, fl } // Draw a capsule with the center of its sphere caps at startPos and endPos -void DrawCapsule(Vector3 startPos, Vector3 endPos, float radius, int slices, int rings, Color color) +void DrawCapsule(Vector3 startPos, Vector3 endPos, float radius, int rings, int slices, Color color) { if (slices < 3) slices = 3; @@ -908,7 +908,7 @@ void DrawCapsule(Vector3 startPos, Vector3 endPos, float radius, int slices, int } // Draw capsule wires with the center of its sphere caps at startPos and endPos -void DrawCapsuleWires(Vector3 startPos, Vector3 endPos, float radius, int slices, int rings, Color color) +void DrawCapsuleWires(Vector3 startPos, Vector3 endPos, float radius, int rings, int slices, Color color) { if (slices < 3) slices = 3;