- Add DrawModelFromTransform()

This commit is contained in:
warzes 2021-11-12 08:52:38 +10:00
parent 864e3ee9f3
commit c56b8b1fcb
2 changed files with 6 additions and 0 deletions

View File

@ -1405,6 +1405,7 @@ RLAPI BoundingBox GetModelBoundingBox(Model model);
// Model drawing functions // Model drawing functions
RLAPI void DrawModel(Model model, Vector3 position, float scale, Color tint); // Draw a model (with texture if set) RLAPI void DrawModel(Model model, Vector3 position, float scale, Color tint); // Draw a model (with texture if set)
RLAPI void DrawModelEx(Model model, Vector3 position, Vector3 rotationAxis, float rotationAngle, Vector3 scale, Color tint); // Draw a model with extended parameters RLAPI void DrawModelEx(Model model, Vector3 position, Vector3 rotationAxis, float rotationAngle, Vector3 scale, Color tint); // Draw a model with extended parameters
RLAPI void DrawModelFromTransform(Model model, Matrix matTransform, Color tint); // Draw a model from world transform
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)

View File

@ -3256,6 +3256,11 @@ void DrawModelEx(Model model, Vector3 position, Vector3 rotationAxis, float rota
Matrix matTransform = MatrixMultiply(MatrixMultiply(matScale, matRotation), matTranslation); Matrix matTransform = MatrixMultiply(MatrixMultiply(matScale, matRotation), matTranslation);
DrawModelFromTransform(model, matTransform, tint);
}
void DrawModelFromTransform(Model model, Matrix matTransform, Color tint)
{
// Combine model transformation matrix (model.transform) with matrix generated by function parameters (matTransform) // Combine model transformation matrix (model.transform) with matrix generated by function parameters (matTransform)
model.transform = MatrixMultiply(model.transform, matTransform); model.transform = MatrixMultiply(model.transform, matTransform);