23 lines
		
	
	
		
			787 B
		
	
	
	
		
			C++
		
	
	
	
			
		
		
	
	
			23 lines
		
	
	
		
			787 B
		
	
	
	
		
			C++
		
	
	
	
#include "transform.h"
 | 
						|
 | 
						|
namespace TransformControls {
 | 
						|
    void SetPosition(Transform& transform, const glm::vec3& newPosition) {
 | 
						|
        transform.translation = newPosition;
 | 
						|
    }
 | 
						|
    void SetRotation(Transform& transform, const glm::vec3& newRotation) {
 | 
						|
        transform.rotation = newRotation;
 | 
						|
    }
 | 
						|
    void SetScale(Transform& transform, const glm::vec3& newScale) {
 | 
						|
        transform.scale = newScale;
 | 
						|
    }
 | 
						|
 | 
						|
    void Translate(Transform& transform, const glm::vec3& translationDelta) {
 | 
						|
        transform.translation += translationDelta;
 | 
						|
    }
 | 
						|
    void Rotate(Transform& transform, const glm::vec3& rotationDelta) {
 | 
						|
        transform.rotation += rotationDelta;
 | 
						|
    }
 | 
						|
    void Scale(Transform& transform, const glm::vec3& scaleDelta) {
 | 
						|
        transform.scale *= scaleDelta;
 | 
						|
    }
 | 
						|
} |