Added set_position_rotation_scale procedures
This commit is contained in:
@@ -166,6 +166,17 @@ set_scale :: (transform: *Transform, scale: float, calculate_matrix: bool = true
|
||||
if calculate_matrix update_matrix(transform);
|
||||
}
|
||||
|
||||
set_position_rotation_scale :: (transform: *Transform, position: Vector3, rotation: Quaternion, scale: Vector3, calculate_matrix: bool = true) {
|
||||
transform.position = position;
|
||||
transform.orientation = rotation;
|
||||
transform.scale = scale;
|
||||
if calculate_matrix update_matrix(transform);
|
||||
}
|
||||
|
||||
set_position_rotation_scale :: (e: *Entity, position: Vector3, rotation: Quaternion, scale: Vector3, calculate_matrix: bool = true) {
|
||||
set_position_rotation_scale(*e.transform, position, rotation, scale, calculate_matrix);
|
||||
}
|
||||
|
||||
get_forward :: (transform: Transform) -> Vector3 {
|
||||
v := rotation_matrix(Matrix4, transform.orientation) * Vector4.{0,0,1,0};
|
||||
return .{v.x, v.y, v.z};
|
||||
|
||||
Reference in New Issue
Block a user