Skip to content

Commit a1d3c61

Browse files
rename Transform::compute_matrix to to_matrix (#19646)
# Objective - Parity with #19643 ## Solution - Rename ## Testing - None --------- Co-authored-by: Alice Cecile <alice.i.cecile@gmail.com>
1 parent 6f08bb8 commit a1d3c61

File tree

6 files changed

+12
-11
lines changed

6 files changed

+12
-11
lines changed

crates/bevy_core_pipeline/src/skybox/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ impl ExtractComponent for Skybox {
125125
SkyboxUniforms {
126126
brightness: skybox.brightness * exposure,
127127
transform: Transform::from_rotation(skybox.rotation)
128-
.compute_matrix()
128+
.to_matrix()
129129
.inverse(),
130130
#[cfg(all(feature = "webgl", target_arch = "wasm32", not(feature = "webgpu")))]
131131
_wasm_padding_8b: 0,

crates/bevy_pbr/src/light/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -628,7 +628,7 @@ pub fn update_point_light_frusta(
628628

629629
for (view_rotation, frustum) in view_rotations.iter().zip(cubemap_frusta.iter_mut()) {
630630
let world_from_view = view_translation * *view_rotation;
631-
let clip_from_world = clip_from_view * world_from_view.compute_matrix().inverse();
631+
let clip_from_world = clip_from_view * world_from_view.to_matrix().inverse();
632632

633633
*frustum = Frustum::from_clip_from_world_custom_far(
634634
&clip_from_world,

crates/bevy_pbr/src/light_probe/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -378,7 +378,7 @@ fn gather_environment_map_uniform(
378378
let environment_map_uniform = if let Some(environment_map_light) = environment_map_light {
379379
EnvironmentMapUniform {
380380
transform: Transform::from_rotation(environment_map_light.rotation)
381-
.compute_matrix()
381+
.to_matrix()
382382
.inverse(),
383383
}
384384
} else {

crates/bevy_transform/src/components/transform.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -256,10 +256,10 @@ impl Transform {
256256
self
257257
}
258258

259-
/// Returns the 3d affine transformation matrix from this transforms translation,
259+
/// Computes the 3d affine transformation matrix from this transform's translation,
260260
/// rotation, and scale.
261261
#[inline]
262-
pub fn compute_matrix(&self) -> Mat4 {
262+
pub fn to_matrix(&self) -> Mat4 {
263263
Mat4::from_scale_rotation_translation(self.scale, self.rotation, self.translation)
264264
}
265265

release-content/migration-guides/rename_global_transform_compute_matrix.md

Lines changed: 0 additions & 6 deletions
This file was deleted.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
title: Transform and GlobalTransform::compute_matrix rename
3+
pull_requests: [19643, 19646]
4+
---
5+
6+
`GlobalTransform::compute_matrix` has been renamed to `GlobalTransform::to_matrix` because it does not compute anything, it simply moves data into a different type.
7+
`Transform::compute_matrix` has been renamed to `Transform::to_matrix` for consistency with `GlobalTransform`.

0 commit comments

Comments
 (0)