11#![ cfg( target_arch = "wasm32" ) ]
22
3- use bevy:: prelude:: Entity ;
3+ use bevy:: {
4+ math:: { Vec2 , Vec3 } ,
5+ prelude:: Entity ,
6+ } ;
47use processing_render:: {
58 config:: Config , exit, geometry_box, geometry_sphere, graphics_begin_draw, graphics_end_draw,
69 graphics_flush, graphics_record_command, image_create, image_destroy, image_load,
@@ -191,7 +194,7 @@ pub fn js_reset_matrix(surface_id: u64) -> Result<(), JsValue> {
191194pub fn js_translate ( surface_id : u64 , x : f32 , y : f32 ) -> Result < ( ) , JsValue > {
192195 check ( graphics_record_command (
193196 Entity :: from_bits ( surface_id) ,
194- DrawCommand :: Translate ( bevy :: math :: Vec2 :: new ( x, y) ) ,
197+ DrawCommand :: Translate ( Vec2 :: new ( x, y) ) ,
195198 ) )
196199}
197200
@@ -207,7 +210,7 @@ pub fn js_rotate(surface_id: u64, angle: f32) -> Result<(), JsValue> {
207210pub fn js_scale ( surface_id : u64 , x : f32 , y : f32 ) -> Result < ( ) , JsValue > {
208211 check ( graphics_record_command (
209212 Entity :: from_bits ( surface_id) ,
210- DrawCommand :: Scale ( bevy :: math :: Vec2 :: new ( x, y) ) ,
213+ DrawCommand :: Scale ( Vec2 :: new ( x, y) ) ,
211214 ) )
212215}
213216
@@ -279,23 +282,23 @@ pub fn js_image_destroy(image_id: u64) -> Result<(), JsValue> {
279282pub fn js_transform_set_position ( entity_id : u64 , x : f32 , y : f32 , z : f32 ) -> Result < ( ) , JsValue > {
280283 check ( transform_set_position (
281284 Entity :: from_bits ( entity_id) ,
282- bevy :: math :: Vec3 :: new ( x, y, z) ,
285+ Vec3 :: new ( x, y, z) ,
283286 ) )
284287}
285288
286289#[ wasm_bindgen( js_name = "transformTranslate" ) ]
287290pub fn js_transform_translate ( entity_id : u64 , x : f32 , y : f32 , z : f32 ) -> Result < ( ) , JsValue > {
288291 check ( transform_translate (
289292 Entity :: from_bits ( entity_id) ,
290- bevy :: math :: Vec3 :: new ( x, y, z) ,
293+ Vec3 :: new ( x, y, z) ,
291294 ) )
292295}
293296
294297#[ wasm_bindgen( js_name = "transformSetRotation" ) ]
295298pub fn js_transform_set_rotation ( entity_id : u64 , x : f32 , y : f32 , z : f32 ) -> Result < ( ) , JsValue > {
296299 check ( transform_set_rotation (
297300 Entity :: from_bits ( entity_id) ,
298- bevy :: math :: Vec3 :: new ( x, y, z) ,
301+ Vec3 :: new ( x, y, z) ,
299302 ) )
300303}
301304
@@ -325,23 +328,23 @@ pub fn js_transform_rotate_axis(
325328 check ( transform_rotate_axis (
326329 Entity :: from_bits ( entity_id) ,
327330 angle,
328- bevy :: math :: Vec3 :: new ( axis_x, axis_y, axis_z) ,
331+ Vec3 :: new ( axis_x, axis_y, axis_z) ,
329332 ) )
330333}
331334
332335#[ wasm_bindgen( js_name = "transformSetScale" ) ]
333336pub fn js_transform_set_scale ( entity_id : u64 , x : f32 , y : f32 , z : f32 ) -> Result < ( ) , JsValue > {
334337 check ( transform_set_scale (
335338 Entity :: from_bits ( entity_id) ,
336- bevy :: math :: Vec3 :: new ( x, y, z) ,
339+ Vec3 :: new ( x, y, z) ,
337340 ) )
338341}
339342
340343#[ wasm_bindgen( js_name = "transformScale" ) ]
341344pub fn js_transform_scale ( entity_id : u64 , x : f32 , y : f32 , z : f32 ) -> Result < ( ) , JsValue > {
342345 check ( transform_scale (
343346 Entity :: from_bits ( entity_id) ,
344- bevy :: math :: Vec3 :: new ( x, y, z) ,
347+ Vec3 :: new ( x, y, z) ,
345348 ) )
346349}
347350
@@ -354,7 +357,7 @@ pub fn js_transform_look_at(
354357) -> Result < ( ) , JsValue > {
355358 check ( transform_look_at (
356359 Entity :: from_bits ( entity_id) ,
357- bevy :: math :: Vec3 :: new ( target_x, target_y, target_z) ,
360+ Vec3 :: new ( target_x, target_y, target_z) ,
358361 ) )
359362}
360363
0 commit comments