From 37b4910e0f0947164e89ef0cfb4cb2cde514586c Mon Sep 17 00:00:00 2001 From: cinnaboot Date: Thu, 6 Jan 2022 08:35:14 -0500 Subject: [PATCH] add scaleEntity function --- src/entity.cpp | 6 ++++++ src/entity.h | 1 + 2 files changed, 7 insertions(+) diff --git a/src/entity.cpp b/src/entity.cpp index 34aa390..d992651 100644 --- a/src/entity.cpp +++ b/src/entity.cpp @@ -52,3 +52,9 @@ rotateEntity(Entity* e, glm::vec3 axis, float radians) *e->xform = glm::rotate(*e->xform, radians, axis); } +void +scaleEntity(Entity* e, float scale) +{ + *e->xform = glm::scale(*e->xform, glm::vec3(scale, scale, scale)); +} + diff --git a/src/entity.h b/src/entity.h index a13793b..6e71c3e 100644 --- a/src/entity.h +++ b/src/entity.h @@ -29,3 +29,4 @@ void setEntityPosition(Entity* e, glm::vec3 pos); void rotateEntity(Entity* e, glm::vec3 axis, float radians); +void scaleEntity(Entity* e, float scale);