@@ -27,20 +27,23 @@ use crate::{
2727 math:: Matrix4Ext ,
2828 pool:: Handle ,
2929 reflect:: prelude:: * ,
30- some_or_return,
30+ some_or_return, uuid , Uuid ,
3131 } ,
3232 graph:: SceneGraph ,
3333 gui:: {
3434 button:: { ButtonBuilder , ButtonMessage } ,
3535 grid:: { Column , GridBuilder , Row } ,
36- inspector:: { InspectorBuilder , InspectorContext , InspectorMessage , PropertyAction } ,
36+ inspector:: {
37+ editors:: PropertyEditorDefinitionContainer , Inspector , InspectorBuilder ,
38+ InspectorContext , InspectorContextArgs , InspectorMessage , PropertyAction ,
39+ } ,
3740 menu:: MenuItemMessage ,
3841 message:: UiMessage ,
3942 scroll_viewer:: ScrollViewerBuilder ,
4043 stack_panel:: StackPanelBuilder ,
4144 utils:: make_simple_tooltip,
4245 widget:: WidgetBuilder ,
43- window:: { WindowBuilder , WindowMessage , WindowTitle } ,
46+ window:: { WindowAlignment , WindowBuilder , WindowMessage , WindowTitle } ,
4447 BuildContext , HorizontalAlignment , Orientation , Thickness , UiNode , UserInterface ,
4548 } ,
4649 scene:: {
@@ -50,7 +53,7 @@ use crate::{
5053 joint:: { BallJoint , JointBuilder , JointParams , RevoluteJoint } ,
5154 node:: Node ,
5255 ragdoll:: { Limb , RagdollBuilder } ,
53- rigidbody:: { RigidBodyBuilder , RigidBodyType } ,
56+ rigidbody:: { RigidBody , RigidBodyBuilder , RigidBodyType } ,
5457 transform:: TransformBuilder ,
5558 } ,
5659 } ,
@@ -64,10 +67,6 @@ use crate::{
6467 world:: selection:: GraphSelection ,
6568 Editor ,
6669} ;
67- use fyrox:: core:: { uuid, Uuid } ;
68- use fyrox:: gui:: inspector:: editors:: PropertyEditorDefinitionContainer ;
69- use fyrox:: gui:: inspector:: { Inspector , InspectorContextArgs } ;
70- use fyrox:: gui:: window:: WindowAlignment ;
7170use std:: { ops:: Range , sync:: Arc } ;
7271
7372#[ derive( Reflect , Clone , Debug ) ]
@@ -182,8 +181,8 @@ struct BallJointLimits {
182181}
183182
184183fn try_make_ball_joint (
185- body1 : Handle < Node > ,
186- body2 : Handle < Node > ,
184+ body1 : Handle < RigidBody > ,
185+ body2 : Handle < RigidBody > ,
187186 name : & str ,
188187 limits : Option < BallJointLimits > ,
189188 offset_radius : AxisOffset ,
@@ -238,8 +237,8 @@ fn try_make_ball_joint(
238237 ) ,
239238 )
240239 . with_params ( JointParams :: BallJoint ( joint) )
241- . with_body1 ( body1. transmute ( ) )
242- . with_body2 ( body2. transmute ( ) )
240+ . with_body1 ( body1)
241+ . with_body2 ( body2)
243242 . with_auto_rebinding_enabled ( false )
244243 . with_contacts_enabled ( false )
245244 . build ( graph) ;
@@ -253,8 +252,8 @@ fn try_make_ball_joint(
253252}
254253
255254fn try_make_hinge_joint (
256- body1 : Handle < Node > ,
257- body2 : Handle < Node > ,
255+ body1 : Handle < RigidBody > ,
256+ body2 : Handle < RigidBody > ,
258257 name : & str ,
259258 limits : Option < Range < f32 > > ,
260259 ragdoll : Handle < Node > ,
@@ -282,8 +281,8 @@ fn try_make_hinge_joint(
282281 ) ,
283282 )
284283 . with_params ( JointParams :: RevoluteJoint ( joint) )
285- . with_body1 ( body1. transmute ( ) )
286- . with_body2 ( body2. transmute ( ) )
284+ . with_body1 ( body1)
285+ . with_body2 ( body2)
287286 . with_auto_rebinding_enabled ( false )
288287 . with_contacts_enabled ( false )
289288 . build ( graph) ;
@@ -306,7 +305,7 @@ impl RagdollPreset {
306305 ragdoll : Handle < Node > ,
307306 apply_offset : bool ,
308307 graph : & mut Graph ,
309- ) -> Handle < Node > {
308+ ) -> Handle < RigidBody > {
310309 if let Ok ( from_ref) = graph. try_get_node ( from) {
311310 let offset = if apply_offset {
312311 from_ref
@@ -349,7 +348,7 @@ impl RagdollPreset {
349348
350349 graph. link_nodes ( sphere, ragdoll) ;
351350
352- sphere
351+ sphere. to_variant ( )
353352 } else {
354353 Default :: default ( )
355354 }
@@ -364,7 +363,7 @@ impl RagdollPreset {
364363 name : & str ,
365364 ragdoll : Handle < Node > ,
366365 graph : & mut Graph ,
367- ) -> Handle < Node > {
366+ ) -> Handle < RigidBody > {
368367 if let ( Ok ( from_ref) , Ok ( to_ref) ) = ( graph. try_get_node ( from) , graph. try_get_node ( to) ) {
369368 let pos_from = from_ref. global_position ( ) ;
370369 let pos_to = to_ref. global_position ( ) ;
@@ -404,7 +403,7 @@ impl RagdollPreset {
404403
405404 graph. link_nodes ( capsule, ragdoll) ;
406405
407- capsule
406+ capsule. to_variant ( )
408407 } else {
409408 Default :: default ( )
410409 }
@@ -418,7 +417,7 @@ impl RagdollPreset {
418417 name : & str ,
419418 ragdoll : Handle < Node > ,
420419 graph : & mut Graph ,
421- ) -> Handle < Node > {
420+ ) -> Handle < RigidBody > {
422421 if let Ok ( from_ref) = graph. try_get_node ( from) {
423422 let cuboid = RigidBodyBuilder :: new (
424423 BaseBuilder :: new ( )
@@ -445,7 +444,7 @@ impl RagdollPreset {
445444
446445 graph. link_nodes ( cuboid, ragdoll) ;
447446
448- cuboid
447+ cuboid. to_variant ( )
449448 } else {
450449 Default :: default ( )
451450 }
0 commit comments