瀏覽代碼

Reviewed latest PR

REMOVED: DrawBillboardEx()
pull/1766/head
Ray 3 年之前
父節點
當前提交
6bd63de8d0
共有 2 個檔案被更改,包括 8 行新增16 行删除
  1. +6
    -13
      src/models.c
  2. +2
    -3
      src/raylib.h

+ 6
- 13
src/models.c 查看文件

@ -2798,25 +2798,17 @@ void DrawModelWiresEx(Model model, Vector3 position, Vector3 rotationAxis, float
} }
// Draw a billboard // 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 }; 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) // 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) 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)); 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); topRight = Vector3Add(topRight, position);
bottomRight = Vector3Add(bottomRight, position); bottomRight = Vector3Add(bottomRight, position);
bottomLeft = Vector3Add(bottomLeft, position); bottomLeft = Vector3Add(bottomLeft, position);

+ 2
- 3
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 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 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 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 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 // Collision detection functions

Loading…
取消
儲存