File tree 3 files changed +42
-42
lines changed
3 files changed +42
-42
lines changed Original file line number Diff line number Diff line change @@ -43,13 +43,13 @@ pub fn snapped(mut value: f32, step: f32) -> f32 {
43
43
44
44
pub fn sign ( value : f32 ) -> f32 {
45
45
if value == 0.0 {
46
- 0.0
46
+ 0.0
47
47
} else {
48
- if value < 0.0 {
49
- -1.0
50
- } else {
51
- 1.0
52
- }
48
+ if value < 0.0 {
49
+ -1.0
50
+ } else {
51
+ 1.0
52
+ }
53
53
}
54
54
}
55
55
Original file line number Diff line number Diff line change @@ -209,18 +209,18 @@ impl Vector2 {
209
209
210
210
pub fn max_axis_index ( self ) -> Vector2Axis {
211
211
if self . x < self . y {
212
- Vector2Axis :: Y
213
- } else {
214
- Vector2Axis :: X
215
- }
212
+ Vector2Axis :: Y
213
+ } else {
214
+ Vector2Axis :: X
215
+ }
216
216
}
217
217
218
218
pub fn min_axis_index ( self ) -> Vector2Axis {
219
219
if self . x < self . y {
220
- Vector2Axis :: X
221
- } else {
222
- Vector2Axis :: Y
223
- }
220
+ Vector2Axis :: X
221
+ } else {
222
+ Vector2Axis :: Y
223
+ }
224
224
}
225
225
226
226
pub fn move_toward ( self , to : Self , delta : f32 ) -> Self {
@@ -258,7 +258,7 @@ impl Vector2 {
258
258
}
259
259
260
260
pub fn sign ( self ) -> Self {
261
- Self :: new ( sign ( self . x ) , sign ( self . y ) )
261
+ Self :: new ( sign ( self . x ) , sign ( self . y ) )
262
262
}
263
263
264
264
pub fn slerp ( self , to : Self , weight : f32 ) -> Self {
Original file line number Diff line number Diff line change @@ -211,35 +211,35 @@ impl Vector3 {
211
211
}
212
212
213
213
pub fn max_axis_index ( self ) -> Vector3Axis {
214
- if self . x < y {
215
- if self . y < self . z {
216
- Vector3Axis :: Z
217
- } else {
218
- Vector3Axis :: Y
219
- }
220
- } else {
221
- if self . x < self . z {
222
- Vector3Axis :: Z
223
- } else {
224
- Vector3Axis :: X
225
- }
226
- }
214
+ if self . x < y {
215
+ if self . y < self . z {
216
+ Vector3Axis :: Z
217
+ } else {
218
+ Vector3Axis :: Y
219
+ }
220
+ } else {
221
+ if self . x < self . z {
222
+ Vector3Axis :: Z
223
+ } else {
224
+ Vector3Axis :: X
225
+ }
226
+ }
227
227
}
228
228
229
229
pub fn min_axis_index ( self ) -> Vector3Axis {
230
- if self . x < self . y {
231
- if self . x < self . z {
232
- Vector3Axis :: X
233
- } else {
234
- Vector3Axis :: Z
235
- }
236
- } else {
237
- if self . y < self . z {
238
- Vector3Axis :: Y
239
- } else {
240
- Vector3Axis :: Z
241
- }
242
- }
230
+ if self . x < self . y {
231
+ if self . x < self . z {
232
+ Vector3Axis :: X
233
+ } else {
234
+ Vector3Axis :: Z
235
+ }
236
+ } else {
237
+ if self . y < self . z {
238
+ Vector3Axis :: Y
239
+ } else {
240
+ Vector3Axis :: Z
241
+ }
242
+ }
243
243
}
244
244
245
245
pub fn move_toward ( self , to : Self , delta : f32 ) -> Self {
@@ -281,7 +281,7 @@ impl Vector3 {
281
281
}
282
282
283
283
pub fn sign ( self ) -> Self {
284
- Self :: new ( sign ( self . x ) , sign ( self . y ) , sign ( self . z ) )
284
+ Self :: new ( sign ( self . x ) , sign ( self . y ) , sign ( self . z ) )
285
285
}
286
286
287
287
pub fn signed_angle_to ( self , to : Self , axis : Self ) -> f32 {
You can’t perform that action at this time.
0 commit comments