File tree Expand file tree Collapse file tree 3 files changed +6
-0
lines changed Expand file tree Collapse file tree 3 files changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -156,6 +156,7 @@ fn deserialize_simple_physics(obj: JsonObject) -> InoxParseResult<SimplePhysics>
156
156
} ,
157
157
map_mode : match obj. get_str ( "map_mode" ) ? {
158
158
"AngleLength" => PhysicsParamMapMode :: AngleLength ,
159
+ "LengthAngle" => PhysicsParamMapMode :: LengthAngle ,
159
160
"XY" => PhysicsParamMapMode :: XY ,
160
161
"YX" => PhysicsParamMapMode :: YX ,
161
162
unknown => return Err ( InoxParseError :: UnknownParamMapMode ( unknown. to_owned ( ) ) ) ,
Original file line number Diff line number Diff line change @@ -129,6 +129,7 @@ pub enum PhysicsModel {
129
129
#[ derive( Clone ) ]
130
130
pub enum PhysicsParamMapMode {
131
131
AngleLength ,
132
+ LengthAngle ,
132
133
XY ,
133
134
YX ,
134
135
}
Original file line number Diff line number Diff line change @@ -74,6 +74,10 @@ impl<T: Pendulum> SimplePhysicsCtx for T {
74
74
let a = f32:: atan2 ( -local_angle. x , local_angle. y ) / PI ;
75
75
Vec2 :: new ( a, relative_length)
76
76
}
77
+ PhysicsParamMapMode :: LengthAngle => {
78
+ let a = f32:: atan2 ( -local_angle. x , local_angle. y ) / PI ;
79
+ Vec2 :: new ( relative_length, a)
80
+ } ,
77
81
} ;
78
82
79
83
param_value * oscale
You can’t perform that action at this time.
0 commit comments