Skip to content

Commit 8ac05d4

Browse files
committed
Add an icon.
1 parent 46d5aaf commit 8ac05d4

File tree

3 files changed

+32
-23
lines changed

3 files changed

+32
-23
lines changed

Extensions/Physics3DBehavior/JsExtension.js

+22-17
Original file line numberDiff line numberDiff line change
@@ -3026,6 +3026,8 @@ module.exports = {
30263026
.setLabel('Back wheel offset X')
30273027
.setGroup('Wheels')
30283028
.setType('Number')
3029+
.setMeasurementUnit(gd.MeasurementUnit.getPixel())
3030+
.setDescription(_('Positive values move wheels outside.'))
30293031
.setValue(
30303032
behaviorContent
30313033
.getChild('backWheelOffsetX')
@@ -3041,6 +3043,7 @@ module.exports = {
30413043
.setGroup('Wheels')
30423044
.setType('Number')
30433045
.setMeasurementUnit(gd.MeasurementUnit.getPixel())
3046+
.setDescription(_('Positive values move wheels outside.'))
30443047
.setValue(
30453048
behaviorContent
30463049
.getChild('frontWheelOffsetX')
@@ -3056,6 +3059,7 @@ module.exports = {
30563059
.setGroup('Wheels')
30573060
.setType('Number')
30583061
.setMeasurementUnit(gd.MeasurementUnit.getPixel())
3062+
.setDescription(_('Positive values move wheels outside.'))
30593063
.setValue(
30603064
behaviorContent
30613065
.getChild('wheelOffsetY')
@@ -3071,6 +3075,7 @@ module.exports = {
30713075
.setGroup('Wheels')
30723076
.setType('Number')
30733077
.setMeasurementUnit(gd.MeasurementUnit.getPixel())
3078+
.setDescription(_('Positive values move wheels outside.'))
30743079
.setValue(
30753080
behaviorContent
30763081
.getChild('wheelOffsetZ')
@@ -3158,7 +3163,7 @@ module.exports = {
31583163
'PhysicsVehicle3D',
31593164
_('Simulate a realistic car.'),
31603165
'',
3161-
'JsPlatform/Extensions/physics_character3d.svg',
3166+
'JsPlatform/Extensions/physics_car3d.svg',
31623167
'PhysicsVehicle3D',
31633168
//@ts-ignore The class hierarchy is incorrect leading to a type error, but this is valid.
31643169
behavior,
@@ -3175,8 +3180,8 @@ module.exports = {
31753180
_('Simulate a press of the move forward key.'),
31763181
_('Simulate pressing Forward key for _PARAM0_'),
31773182
_('Car controls'),
3178-
'JsPlatform/Extensions/physics_character3d.svg',
3179-
'JsPlatform/Extensions/physics_character3d.svg'
3183+
'JsPlatform/Extensions/physics_car3d.svg',
3184+
'JsPlatform/Extensions/physics_car3d.svg'
31803185
)
31813186
.addParameter('object', _('Object'), '', false)
31823187
.addParameter('behavior', _('Behavior'), 'PhysicsVehicle3D')
@@ -3189,8 +3194,8 @@ module.exports = {
31893194
_('Simulate a press of the move backward key.'),
31903195
_('Simulate pressing Backward key for _PARAM0_'),
31913196
_('Car controls'),
3192-
'JsPlatform/Extensions/physics_character3d.svg',
3193-
'JsPlatform/Extensions/physics_character3d.svg'
3197+
'JsPlatform/Extensions/physics_car3d.svg',
3198+
'JsPlatform/Extensions/physics_car3d.svg'
31943199
)
31953200
.addParameter('object', _('Object'), '', false)
31963201
.addParameter('behavior', _('Behavior'), 'PhysicsVehicle3D')
@@ -3203,8 +3208,8 @@ module.exports = {
32033208
_('Simulate a press of the move right key.'),
32043209
_('Simulate pressing Right key for _PARAM0_'),
32053210
_('Car controls'),
3206-
'JsPlatform/Extensions/physics_character3d.svg',
3207-
'JsPlatform/Extensions/physics_character3d.svg'
3211+
'JsPlatform/Extensions/physics_car3d.svg',
3212+
'JsPlatform/Extensions/physics_car3d.svg'
32083213
)
32093214
.addParameter('object', _('Object'), '', false)
32103215
.addParameter('behavior', _('Behavior'), 'PhysicsVehicle3D')
@@ -3217,8 +3222,8 @@ module.exports = {
32173222
_('Simulate a press of the move left key.'),
32183223
_('Simulate pressing Left key for _PARAM0_'),
32193224
_('Car controls'),
3220-
'JsPlatform/Extensions/physics_character3d.svg',
3221-
'JsPlatform/Extensions/physics_character3d.svg'
3225+
'JsPlatform/Extensions/physics_car3d.svg',
3226+
'JsPlatform/Extensions/physics_car3d.svg'
32223227
)
32233228
.addParameter('object', _('Object'), '', false)
32243229
.addParameter('behavior', _('Behavior'), 'PhysicsVehicle3D')
@@ -3231,8 +3236,8 @@ module.exports = {
32313236
_('Simulate a press of the hand break key.'),
32323237
_('Simulate pressing hand break key for _PARAM0_'),
32333238
_('Car controls'),
3234-
'JsPlatform/Extensions/physics_character3d.svg',
3235-
'JsPlatform/Extensions/physics_character3d.svg'
3239+
'JsPlatform/Extensions/physics_car3d.svg',
3240+
'JsPlatform/Extensions/physics_car3d.svg'
32363241
)
32373242
.addParameter('object', _('Object'), '', false)
32383243
.addParameter('behavior', _('Behavior'), 'PhysicsVehicle3D')
@@ -3247,8 +3252,8 @@ module.exports = {
32473252
'Simulate an accelerator stick control for _PARAM0_ with a _PARAM2_ force'
32483253
),
32493254
_('Car controls'),
3250-
'JsPlatform/Extensions/physics_character3d.svg',
3251-
'JsPlatform/Extensions/physics_character3d.svg'
3255+
'JsPlatform/Extensions/physics_car3d.svg',
3256+
'JsPlatform/Extensions/physics_car3d.svg'
32523257
)
32533258
.addParameter('object', _('Object'), '', false)
32543259
.addParameter('behavior', _('Behavior'), 'PhysicsVehicle3D')
@@ -3265,8 +3270,8 @@ module.exports = {
32653270
'Simulate a steering stick control for _PARAM0_ with a _PARAM2_ force'
32663271
),
32673272
_('Car controls'),
3268-
'JsPlatform/Extensions/physics_character3d.svg',
3269-
'JsPlatform/Extensions/physics_character3d.svg'
3273+
'JsPlatform/Extensions/physics_car3d.svg',
3274+
'JsPlatform/Extensions/physics_car3d.svg'
32703275
)
32713276
.addParameter('object', _('Object'), '', false)
32723277
.addParameter('behavior', _('Behavior'), 'PhysicsVehicle3D')
@@ -3282,8 +3287,8 @@ module.exports = {
32823287
_('Check if a 3D physics character is on a given platform.'),
32833288
_('_PARAM0_ is on platform _PARAM2_'),
32843289
_('Collision'),
3285-
'JsPlatform/Extensions/physics_character3d.svg',
3286-
'JsPlatform/Extensions/physics_character3d.svg'
3290+
'JsPlatform/Extensions/physics_car3d.svg',
3291+
'JsPlatform/Extensions/physics_car3d.svg'
32873292
)
32883293
.addParameter('objectList', _('Object'), '', false)
32893294
.addParameter('behavior', _('Behavior'), 'PhysicsCharacter3D')

Extensions/Physics3DBehavior/PhysicsVehicle3DRuntimeBehavior.ts

+8-6
Original file line numberDiff line numberDiff line change
@@ -446,6 +446,8 @@ namespace gdjs {
446446
60 *
447447
60) /
448448
1000,
449+
'Gear',
450+
this._vehicleController.GetTransmission().GetCurrentGear(),
449451
'Wheels',
450452
vec3ToString(wheels[0].GetContactPosition()),
451453
vec3ToString(wheels[1].GetContactPosition()),
@@ -819,8 +821,8 @@ namespace gdjs {
819821
halfVehicleHeight - wheelWidth / 2 + this._wheelOffsetY * shapeScale;
820822
// Put the wheels center at the bottom of the car physics shape.
821823
const wheelOffsetZ =
822-
-halfVehicleDepth +
823-
(behavior.shapeOffsetZ + this._wheelOffsetZ) * shapeScale;
824+
halfVehicleDepth +
825+
(-behavior.shapeOffsetZ + this._wheelOffsetZ) * shapeScale;
824826
const suspensionMinLength = wheelRadius;
825827
const suspensionMaxLength = 1.5 * suspensionMinLength;
826828

@@ -829,25 +831,25 @@ namespace gdjs {
829831
fl.mPosition = this.getVec3(
830832
frontWheelOffsetX,
831833
-wheelOffsetY,
832-
wheelOffsetZ
834+
-wheelOffsetZ
833835
);
834836
const fr = constraint.GetWheel(1).GetSettings();
835837
fr.mPosition = this.getVec3(
836838
frontWheelOffsetX,
837839
wheelOffsetY,
838-
wheelOffsetZ
840+
-wheelOffsetZ
839841
);
840842
const bl = constraint.GetWheel(2).GetSettings();
841843
bl.mPosition = this.getVec3(
842844
-backWheelOffsetX,
843845
-wheelOffsetY,
844-
wheelOffsetZ
846+
-wheelOffsetZ
845847
);
846848
const br = constraint.GetWheel(3).GetSettings();
847849
br.mPosition = this.getVec3(
848850
-backWheelOffsetX,
849851
wheelOffsetY,
850-
wheelOffsetZ
852+
-wheelOffsetZ
851853
);
852854
for (let index = 0; index < 4; index++) {
853855
const wheel = constraint.GetWheel(index).GetSettings();
Loading

0 commit comments

Comments
 (0)