File tree 2 files changed +12
-36
lines changed
crates/bevy_transform/src/components 2 files changed +12
-36
lines changed Original file line number Diff line number Diff line change @@ -75,35 +75,23 @@ impl GlobalTransform {
75
75
}
76
76
77
77
#[ inline]
78
- pub fn right ( & self ) -> Vec3 {
78
+ /// Get the unit vector in the local x direction
79
+ pub fn local_x ( & self ) -> Vec3 {
79
80
self . rotation * Vec3 :: unit_x ( )
80
81
}
81
82
82
83
#[ inline]
83
- pub fn left ( & self ) -> Vec3 {
84
- -self . right ( )
85
- }
86
-
87
- #[ inline]
88
- pub fn up ( & self ) -> Vec3 {
84
+ /// Get the unit vector in the local y direction
85
+ pub fn local_y ( & self ) -> Vec3 {
89
86
self . rotation * Vec3 :: unit_y ( )
90
87
}
91
88
92
89
#[ inline]
93
- pub fn down ( & self ) -> Vec3 {
94
- -self . up ( )
95
- }
96
-
97
- #[ inline]
98
- pub fn forward ( & self ) -> Vec3 {
90
+ /// Get the unit vector in the local z direction
91
+ pub fn local_z ( & self ) -> Vec3 {
99
92
self . rotation * Vec3 :: unit_z ( )
100
93
}
101
94
102
- #[ inline]
103
- pub fn backward ( & self ) -> Vec3 {
104
- -self . forward ( )
105
- }
106
-
107
95
#[ inline]
108
96
/// Rotate the transform by the given rotation
109
97
pub fn rotate ( & mut self , rotation : Quat ) {
Original file line number Diff line number Diff line change @@ -75,35 +75,23 @@ impl Transform {
75
75
}
76
76
77
77
#[ inline]
78
- pub fn right ( & self ) -> Vec3 {
78
+ /// Get the unit vector in the local x direction
79
+ pub fn local_x ( & self ) -> Vec3 {
79
80
self . rotation * Vec3 :: unit_x ( )
80
81
}
81
82
82
83
#[ inline]
83
- pub fn left ( & self ) -> Vec3 {
84
- -self . right ( )
85
- }
86
-
87
- #[ inline]
88
- pub fn up ( & self ) -> Vec3 {
84
+ /// Get the unit vector in the local y direction
85
+ pub fn local_y ( & self ) -> Vec3 {
89
86
self . rotation * Vec3 :: unit_y ( )
90
87
}
91
88
92
89
#[ inline]
93
- pub fn down ( & self ) -> Vec3 {
94
- -self . up ( )
95
- }
96
-
97
- #[ inline]
98
- pub fn forward ( & self ) -> Vec3 {
90
+ /// Get the unit vector in the local z direction
91
+ pub fn local_z ( & self ) -> Vec3 {
99
92
self . rotation * Vec3 :: unit_z ( )
100
93
}
101
94
102
- #[ inline]
103
- pub fn backward ( & self ) -> Vec3 {
104
- -self . forward ( )
105
- }
106
-
107
95
#[ inline]
108
96
/// Rotate the transform by the given rotation
109
97
pub fn rotate ( & mut self , rotation : Quat ) {
You can’t perform that action at this time.
0 commit comments