File tree 2 files changed +12
-6
lines changed
Extensions/Physics3DBehavior
newIDE/app/src/BehaviorsEditor/Editors/Physics3DEditor
2 files changed +12
-6
lines changed Original file line number Diff line number Diff line change @@ -397,7 +397,8 @@ namespace gdjs {
397
397
this . bullet = behaviorData . bullet ;
398
398
this . fixedRotation = behaviorData . fixedRotation ;
399
399
this . shape = behaviorData . shape ;
400
- this . shapeOrientation = behaviorData . shapeOrientation ;
400
+ this . shapeOrientation =
401
+ behaviorData . shape === 'Box' ? 'Z' : behaviorData . shapeOrientation ;
401
402
this . shapeDimensionA = behaviorData . shapeDimensionA ;
402
403
this . shapeDimensionB = behaviorData . shapeDimensionB ;
403
404
this . shapeDimensionC = behaviorData . shapeDimensionC ;
Original file line number Diff line number Diff line change @@ -86,6 +86,10 @@ const Physics3DEditor = (props: Props) => {
86
86
87
87
const isStatic = properties . get ( 'bodyType' ) . getValue ( ) === 'Static' ;
88
88
89
+ const canShapeBeOriented =
90
+ properties . get ( 'shape' ) . getValue ( ) !== 'Sphere' &&
91
+ properties . get ( 'shape' ) . getValue ( ) !== 'Box' ;
92
+
89
93
return (
90
94
< Column
91
95
expand
@@ -171,14 +175,15 @@ const Physics3DEditor = (props: Props) => {
171
175
id = "physics3d-parameter-shape-orientation"
172
176
fullWidth
173
177
floatingLabelText = { properties . get ( 'shapeOrientation' ) . getLabel ( ) }
174
- value = { properties . get ( 'shapeOrientation' ) . getValue ( ) }
178
+ value = {
179
+ canShapeBeOriented
180
+ ? properties . get ( 'shapeOrientation' ) . getValue ( )
181
+ : 'Z'
182
+ }
175
183
onChange = { ( e , i , newValue : string ) =>
176
184
updateBehaviorProperty ( 'shapeOrientation' , newValue )
177
185
}
178
- disabled = {
179
- properties . get ( 'shape' ) . getValue ( ) === 'Sphere' ||
180
- properties . get ( 'shape' ) . getValue ( ) === 'Box'
181
- }
186
+ disabled = { ! canShapeBeOriented }
182
187
>
183
188
< SelectOption key = { 'shape-orientation-z' } value = { 'Z' } label = { t `Z` } />
184
189
< SelectOption key = { 'shape-orientation-y' } value = { 'Y' } label = { t `Y` } />
You can’t perform that action at this time.
0 commit comments