Transform: Entity convenience procs | Static Array: Fixed off by one error in assert

This commit is contained in:
2024-11-04 23:25:27 +01:00
parent 4d4f5ab2c1
commit 194ec7d257
2 changed files with 13 additions and 1 deletions

View File

@@ -50,6 +50,10 @@ update_matrix :: (transform: *Transform) {
transform.dirty = true;
}
set_position :: (e: *Entity, position: Vector3, calculate_matrix: bool = true) {
set_position(*e.transform, position, calculate_matrix);
}
set_position :: (transform: *Transform, position: Vector3, calculate_matrix: bool = true) {
transform.position = position;
if calculate_matrix update_matrix(transform);
@@ -129,6 +133,10 @@ quaternion_to_euler :: (q: Quaternion) -> yaw: float, pitch: float, roll: float
return yaw, pitch, roll;
}
set_rotation :: (e: *Entity, orientation: Quaternion, calculate_matrix: bool = true) {
set_rotation(*e.transform, orientation, calculate_matrix);
}
set_rotation :: (transform: *Transform, orientation: Quaternion, calculate_matrix: bool = true) {
transform.orientation = orientation;
if calculate_matrix update_matrix(transform);
@@ -140,6 +148,10 @@ set_rotation :: (transform: *Transform, euler_angles: Vector3, calculate_matrix:
if calculate_matrix update_matrix(transform);
}
set_scale :: (e: *Entity, scale: Vector3, calculate_matrix: bool = true) {
set_scale(*e.transform, scale, calculate_matrix);
}
set_scale :: (transform: *Transform, scale: Vector3, calculate_matrix: bool = true) {
transform.scale = scale;
if calculate_matrix update_matrix(transform);