summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorRay <[email protected]>2021-05-11 01:02:53 +0200
committerRay <[email protected]>2021-05-11 01:02:53 +0200
commit6bd63de8d052f99e08ec20c0e0f13b2b4b5eed2b (patch)
treea08396c065705846105239d37cc5344c67348da3 /src
parentac204a11f7eb5d03e88188b06d004bb680902bfb (diff)
downloadraylib-6bd63de8d052f99e08ec20c0e0f13b2b4b5eed2b.tar.gz
raylib-6bd63de8d052f99e08ec20c0e0f13b2b4b5eed2b.zip
Reviewed latest PR
REMOVED: DrawBillboardEx()
Diffstat (limited to 'src')
-rw-r--r--src/models.c19
-rw-r--r--src/raylib.h5
2 files changed, 8 insertions, 16 deletions
diff --git a/src/models.c b/src/models.c
index 7a0ce8ad..177a1123 100644
--- a/src/models.c
+++ b/src/models.c
@@ -2798,25 +2798,17 @@ void DrawModelWiresEx(Model model, Vector3 position, Vector3 rotationAxis, float
}
// Draw a billboard
-void DrawBillboard(Camera camera, Texture2D texture, Vector3 center, float size, Color tint)
+void DrawBillboard(Camera camera, Texture2D texture, Vector3 position, float size, Color tint)
{
Rectangle source = { 0.0f, 0.0f, (float)texture.width, (float)texture.height };
- DrawBillboardRec(camera, texture, source, center, (Vector2){ size, size }, tint);
+ DrawBillboardRec(camera, texture, source, position, (Vector2){ size, size }, tint);
}
// Draw a billboard (part of a texture defined by a rectangle)
-void DrawBillboardRec(Camera camera, Texture2D texture, Rectangle source, Vector3 center, Vector2 size, Color tint)
+void DrawBillboardRec(Camera camera, Texture2D texture, Rectangle source, Vector3 position, Vector2 size, Color tint)
{
- DrawBillboardPro(camera, texture, source, center, size, Vector2Zero(), 0.0f, tint);
-}
-
-// Draw a billboard (part of a texture defined by a rectangle)
-void DrawBillboardEx(Camera camera, Texture2D texture, Vector3 center, Vector2 origin, float rotation, Vector2 size, Color tint)
-{
- Rectangle source = { 0.0f, 0.0f, (float)texture.width, (float)texture.height };
-
- DrawBillboardPro(camera, texture, source, center, size, origin, rotation, tint);
+ DrawBillboardPro(camera, texture, source, position, size, Vector2Zero(), 0.0f, tint);
}
void DrawBillboardPro(Camera camera, Texture2D texture, Rectangle source, Vector3 position, Vector2 size, Vector2 origin, float rotation, Color tint)
@@ -2880,7 +2872,8 @@ void DrawBillboardPro(Camera camera, Texture2D texture, Rectangle source, Vector
bottomLeft = Vector3Add(Vector3Scale(up, rotatedY), Vector3Scale(right, rotatedX));
}
- topLeft = Vector3Add(topLeft, position); // Translate points to the draw center (position)
+ // Translate points to the draw center (position)
+ topLeft = Vector3Add(topLeft, position);
topRight = Vector3Add(topRight, position);
bottomRight = Vector3Add(bottomRight, position);
bottomLeft = Vector3Add(bottomLeft, position);
diff --git a/src/raylib.h b/src/raylib.h
index c525ad2f..d0548fab 100644
--- a/src/raylib.h
+++ b/src/raylib.h
@@ -1443,9 +1443,8 @@ RLAPI void DrawModelEx(Model model, Vector3 position, Vector3 rotationAxis, floa
RLAPI void DrawModelWires(Model model, Vector3 position, float scale, Color tint); // Draw a model wires (with texture if set)
RLAPI void DrawModelWiresEx(Model model, Vector3 position, Vector3 rotationAxis, float rotationAngle, Vector3 scale, Color tint); // Draw a model wires (with texture if set) with extended parameters
RLAPI void DrawBoundingBox(BoundingBox box, Color color); // Draw bounding box (wires)
-RLAPI void DrawBillboard(Camera camera, Texture2D texture, Vector3 center, float size, Color tint); // Draw a billboard texture
-RLAPI void DrawBillboardRec(Camera camera, Texture2D texture, Rectangle source, Vector3 center, Vector2 size, Color tint); // Draw a billboard texture defined by source
-RLAPI void DrawBillboardEx(Camera camera, Texture2D texture, Vector3 center, Vector2 origin, float rotation, Vector2 size, Color tint); // Draw a billboard texture defined by rotation
+RLAPI void DrawBillboard(Camera camera, Texture2D texture, Vector3 position, float size, Color tint); // Draw a billboard texture
+RLAPI void DrawBillboardRec(Camera camera, Texture2D texture, Rectangle source, Vector3 position, Vector2 size, Color tint); // Draw a billboard texture defined by source
RLAPI void DrawBillboardPro(Camera camera, Texture2D texture, Rectangle source, Vector3 position, Vector2 size, Vector2 origin, float rotation, Color tint); // Draw a billboard texture defined by source and rotation
// Collision detection functions