@@ -77,7 +77,7 @@ impl DebugLines {
77
77
let mut offset = 0 ;
78
78
for container in shared_debug_lines. containers . values ( ) {
79
79
buffers. multi_draw_items . push ( MultiDrawItem {
80
- model_matrix : container. isometry . to_homogeneous ( ) ,
80
+ model_matrix : na :: convert ( container. transform ) ,
81
81
starting_index : offset,
82
82
index_count : container. data . len ( ) as i32 ,
83
83
} ) ;
@@ -132,7 +132,7 @@ impl DebugLines {
132
132
133
133
let new_id = self . containers . borrow_mut ( )
134
134
. new_container (
135
- na:: Isometry3 :: from_parts ( na:: Translation3 :: from_vector ( pos. coords ) , na:: UnitQuaternion :: identity ( ) ) ,
135
+ na:: convert ( na :: Isometry3 :: from_parts ( na:: Translation3 :: from_vector ( pos. coords ) , na:: UnitQuaternion :: identity ( ) ) ) ,
136
136
vec ! [
137
137
LinePoint { pos: render_p3( pos + na:: Vector3 :: x( ) * half) , color: ( 0.0 , 1.0 , 0.0 , 1.0 ) . into( ) } ,
138
138
LinePoint { pos: render_p3( pos + na:: Vector3 :: x( ) * -half) , color: ( 0.0 , 1.0 , 0.0 , 1.0 ) . into( ) } ,
@@ -153,7 +153,7 @@ impl DebugLines {
153
153
let half = size / 2.0 ;
154
154
155
155
let new_id = self . containers . borrow_mut ( )
156
- . new_container ( na:: Isometry3 :: from_parts ( na:: Translation3 :: from_vector ( pos. coords ) , na:: UnitQuaternion :: identity ( ) ) ,
156
+ . new_container ( na:: convert ( na :: Isometry3 :: from_parts ( na:: Translation3 :: from_vector ( pos. coords ) , na:: UnitQuaternion :: identity ( ) ) ) ,
157
157
vec ! [
158
158
LinePoint { pos: render_p3( pos + na:: Vector3 :: x( ) * half) , color: render_color_vec4( color) } ,
159
159
LinePoint { pos: render_p3( pos + na:: Vector3 :: x( ) * -half) , color: render_color_vec4( color) } ,
@@ -169,7 +169,7 @@ impl DebugLines {
169
169
}
170
170
}
171
171
172
- pub fn ray_markers ( & self , isometry : na:: Isometry3 < f32 > , pos_direction_colors : impl Iterator < Item =( na:: Point3 < f32 > , na:: Vector3 < f32 > , na:: Vector4 < f32 > ) > ) -> RayMarkers {
172
+ pub fn ray_markers ( & self , transform : na:: Projective3 < f32 > , pos_direction_colors : impl Iterator < Item =( na:: Point3 < f32 > , na:: Vector3 < f32 > , na:: Vector4 < f32 > ) > ) -> RayMarkers {
173
173
struct PositionsIter {
174
174
pos : na:: Point3 < f32 > ,
175
175
dir : na:: Vector3 < f32 > ,
@@ -197,7 +197,7 @@ impl DebugLines {
197
197
198
198
let new_id = self . containers . borrow_mut ( )
199
199
. new_container (
200
- isometry ,
200
+ transform ,
201
201
pos_direction_colors
202
202
. flat_map ( |( pos, dir, color) |
203
203
PositionsIter {
@@ -215,12 +215,12 @@ impl DebugLines {
215
215
}
216
216
}
217
217
218
- pub fn aabb_marker ( & self , isometry : na:: Isometry3 < f32 > , aabb : ncollide3d:: bounding_volume:: aabb:: AABB < f32 > , color : na:: Vector4 < f32 > ) -> AabbMarker {
218
+ pub fn aabb_marker ( & self , transform : na:: Projective3 < f32 > , aabb : ncollide3d:: bounding_volume:: aabb:: AABB < f32 > , color : na:: Vector4 < f32 > ) -> AabbMarker {
219
219
let a = aabb. mins ( ) ;
220
220
let b = aabb. maxs ( ) ;
221
221
222
222
let new_id = self . containers . borrow_mut ( )
223
- . new_container ( isometry ,
223
+ . new_container ( transform ,
224
224
vec ! [
225
225
LinePoint { pos: render_p3( [ a. x, a. y, a. z] . into( ) ) , color: render_color_vec4( color) } ,
226
226
LinePoint { pos: render_p3( [ b. x, a. y, a. z] . into( ) ) , color: render_color_vec4( color) } ,
@@ -254,11 +254,11 @@ impl DebugLines {
254
254
}
255
255
}
256
256
257
- pub fn rect_marker ( & self , isometry : na:: Isometry3 < f32 > , size : na:: Vector2 < f32 > , color : na:: Vector4 < f32 > ) -> RectMarker {
258
- RectMarker :: new ( self . containers . clone ( ) , isometry , size, color)
257
+ pub fn rect_marker ( & self , transform : na:: Projective3 < f32 > , size : na:: Vector2 < f32 > , color : na:: Vector4 < f32 > ) -> RectMarker {
258
+ RectMarker :: new ( self . containers . clone ( ) , transform , size, color)
259
259
}
260
260
261
- pub fn grid_marker ( & self , isometry : na:: Isometry3 < f32 > , spacing : f32 , count : i32 , color : na:: Vector4 < f32 > ) -> GridMarker {
261
+ pub fn grid_marker ( & self , transform : na:: Projective3 < f32 > , spacing : f32 , count : i32 , color : na:: Vector4 < f32 > ) -> GridMarker {
262
262
let mut lines = Vec :: with_capacity ( ( count * 2 + 4 ) as usize ) ;
263
263
264
264
let mut half_count = count / 2 ;
@@ -283,7 +283,7 @@ impl DebugLines {
283
283
}
284
284
285
285
let new_id = self . containers . borrow_mut ( )
286
- . new_container ( isometry , lines) ;
286
+ . new_container ( transform , lines) ;
287
287
288
288
GridMarker {
289
289
containers : self . containers . clone ( ) ,
@@ -298,9 +298,9 @@ pub struct AabbMarker {
298
298
}
299
299
300
300
impl AabbMarker {
301
- pub fn update_isometry ( & self , isometry : na:: Isometry3 < f32 > ) {
301
+ pub fn update_transform ( & self , transform : na:: Projective3 < f32 > ) {
302
302
if let Some ( data) = self . containers . borrow_mut ( ) . get_container_mut ( self . id ) {
303
- data. isometry = isometry ;
303
+ data. transform = transform ;
304
304
}
305
305
}
306
306
}
@@ -317,9 +317,9 @@ pub struct GridMarker {
317
317
}
318
318
319
319
impl GridMarker {
320
- pub fn update_isometry ( & self , isometry : na:: Isometry3 < f32 > ) {
320
+ pub fn update_transform ( & self , transform : na:: Projective3 < f32 > ) {
321
321
if let Some ( data) = self . containers . borrow_mut ( ) . get_container_mut ( self . id ) {
322
- data. isometry = isometry ;
322
+ data. transform = transform ;
323
323
}
324
324
}
325
325
}
@@ -336,9 +336,9 @@ pub struct RectMarker {
336
336
}
337
337
338
338
impl RectMarker {
339
- fn new ( containers : Rc < RefCell < SharedDebugLines > > , isometry : na:: Isometry3 < f32 > , size : na:: Vector2 < f32 > , color : na:: Vector4 < f32 > ) -> RectMarker {
339
+ fn new ( containers : Rc < RefCell < SharedDebugLines > > , transform : na:: Projective3 < f32 > , size : na:: Vector2 < f32 > , color : na:: Vector4 < f32 > ) -> RectMarker {
340
340
let id = containers. borrow_mut ( )
341
- . new_container ( isometry , Vec :: with_capacity ( 8 ) ) ;
341
+ . new_container ( transform , Vec :: with_capacity ( 8 ) ) ;
342
342
343
343
let marker = RectMarker {
344
344
id,
@@ -377,9 +377,9 @@ impl RectMarker {
377
377
}
378
378
}
379
379
380
- pub fn update_isometry ( & self , isometry : na:: Isometry3 < f32 > ) {
380
+ pub fn update_transform ( & self , transform : na:: Projective3 < f32 > ) {
381
381
if let Some ( data) = self . containers . borrow_mut ( ) . get_container_mut ( self . id ) {
382
- data. isometry = isometry ;
382
+ data. transform = transform ;
383
383
}
384
384
}
385
385
@@ -409,9 +409,9 @@ impl RayMarkers {
409
409
}
410
410
}
411
411
412
- pub fn update_isometry ( & self , isometry : na:: Isometry3 < f32 > ) {
412
+ pub fn update_transform ( & self , transform : na:: Projective3 < f32 > ) {
413
413
if let Some ( data) = self . containers . borrow_mut ( ) . get_container_mut ( self . id ) {
414
- data. isometry = isometry ;
414
+ data. transform = transform ;
415
415
}
416
416
}
417
417
}
@@ -430,7 +430,7 @@ pub struct PointMarker {
430
430
impl PointMarker {
431
431
pub fn update_position ( & self , pos : na:: Point3 < f32 > ) {
432
432
if let Some ( data) = self . containers . borrow_mut ( ) . get_container_mut ( self . id ) {
433
- data. isometry = na:: Isometry3 :: from_parts ( na:: Translation3 :: from_vector ( pos. coords ) , na:: UnitQuaternion :: identity ( ) ) ;
433
+ data. transform = na:: convert ( na :: Isometry3 :: from_parts ( na:: Translation3 :: from_vector ( pos. coords ) , na:: UnitQuaternion :: identity ( ) ) ) ;
434
434
}
435
435
}
436
436
}
0 commit comments