diff --git a/src/raylib.h b/src/raylib.h index e5453de7e..4505c952f 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -1405,6 +1405,7 @@ RLAPI BoundingBox GetModelBoundingBox(Model model); // Model drawing functions 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 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 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) diff --git a/src/rmodels.c b/src/rmodels.c index 8218a818d..eeca23d1d 100644 --- a/src/rmodels.c +++ b/src/rmodels.c @@ -3256,6 +3256,11 @@ void DrawModelEx(Model model, Vector3 position, Vector3 rotationAxis, float rota 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) model.transform = MatrixMultiply(model.transform, matTransform);