diff --git a/examples/3d-car-coin-hunt/3d-car-coin-hunt.json b/examples/3d-car-coin-hunt/3d-car-coin-hunt.json index 55ab9dd06..878b2997a 100644 --- a/examples/3d-car-coin-hunt/3d-car-coin-hunt.json +++ b/examples/3d-car-coin-hunt/3d-car-coin-hunt.json @@ -143,14 +143,6 @@ "name": "Line light joystick thumb.png" } }, - { - "file": "assets/Line light joystick border UpDown.png", - "kind": "image", - "metadata": "", - "name": "assets\\Line light joystick border UpDown.png", - "smoothed": true, - "userAdded": true - }, { "file": "assets/Line light joystick border LeftRightt.png", "kind": "image", @@ -687,6 +679,22 @@ "identifier": "https://asset-resources.gdevelop.io/public-resources/3D City Kit (Roads)/Ground/0ecdbe600c3efca2dfce618286081460c6a079cff0dce79f21ae9514ca4a2896_Road Slant Curve.glb", "name": "Road Slant Curve.glb" } + }, + { + "file": "assets/StartingGasPedal.png", + "kind": "image", + "metadata": "", + "name": "assets/StartingGasPedal.png", + "smoothed": true, + "userAdded": false + }, + { + "file": "assets/StartingBrakePedal.png", + "kind": "image", + "metadata": "", + "name": "assets/StartingBrakePedal.png", + "smoothed": true, + "userAdded": false } ] }, @@ -6096,7 +6104,7 @@ "effects": [], "behaviors": [], "content": { - "DeadZoneRadius": 0.33 + "DeadZoneRadius": 0.1 }, "childrenContent": { "Border": { @@ -6171,91 +6179,6 @@ } } }, - { - "assetStoreId": "112c69f62e03fa6df7716cc6b8f174c17857fbf71c8d3fffd16fa8fdbfa49bf1", - "name": "SpeedJoystick", - "type": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", - "variant": "", - "variables": [], - "effects": [], - "behaviors": [], - "content": { - "DeadZoneRadius": 0.33, - "JoystickIdentifier": "Secondary" - }, - "childrenContent": { - "Border": { - "adaptCollisionMaskAutomatically": false, - "updateIfNotVisible": false, - "animations": [ - { - "name": "Idle", - "useMultipleDirections": false, - "directions": [ - { - "looping": false, - "timeBetweenFrames": 0.08, - "sprites": [ - { - "hasCustomCollisionMask": false, - "image": "assets\\Line light joystick border UpDown.png", - "points": [], - "originPoint": { - "name": "origine", - "x": 0, - "y": 0 - }, - "centerPoint": { - "automatic": true, - "name": "centre", - "x": 0, - "y": 0 - }, - "customCollisionMask": [] - } - ] - } - ] - } - ] - }, - "Thumb": { - "adaptCollisionMaskAutomatically": false, - "updateIfNotVisible": false, - "animations": [ - { - "name": "Idle", - "useMultipleDirections": false, - "directions": [ - { - "looping": false, - "timeBetweenFrames": 0.08, - "sprites": [ - { - "hasCustomCollisionMask": false, - "image": "Line light joystick thumb.png", - "points": [], - "originPoint": { - "name": "origine", - "x": 0, - "y": 0 - }, - "centerPoint": { - "automatic": true, - "name": "centre", - "x": 0, - "y": 0 - }, - "customCollisionMask": [] - } - ] - } - ] - } - ] - } - } - }, { "assetStoreId": "cddab55130dbd5a0b36f763200e876fb514aa608e1b057a136ebdb5f80006e2c", "name": "Player", @@ -6330,11 +6253,11 @@ "shapeDimensionB": 39, "shapeDimensionC": 27, "density": 1, - "friction": 10, - "restitution": 0.5, - "linearDamping": 0.1, - "angularDamping": 0.1, - "gravityScale": 6, + "friction": 0.2, + "restitution": 0.05, + "linearDamping": 0.02, + "angularDamping": 1, + "gravityScale": 2, "layers": 17, "masks": 17, "shapeOffsetX": 0, @@ -6342,38 +6265,46 @@ "shapeOffsetZ": 9, "massCenterOffsetX": 0, "massCenterOffsetY": 0, - "massCenterOffsetZ": -25, + "massCenterOffsetZ": -16, "massOverride": 1500 }, { "name": "PhysicsCar3D", "type": "Physics3D::PhysicsCar3D", "physics3D": "Physics3D", - "steerAngleMax": 70, - "beginningSteerSpeed": 140, - "endSteerSpeed": 10, + "steerAngleMax": 32, + "beginningSteerSpeed": 120, + "endSteerSpeed": 120, "mass": 1500, - "engineTorqueMax": 8000, + "engineTorqueMax": 1500, "engineSpeedMax": 6000, - "engineInertia": 0.1, + "engineInertia": 0.3, "reverseGearRatio1": -2.9, "gearRatio1": 2.66, "gearRatio2": 1.78, "gearRatio3": 1.3, "gearRatio4": 1, - "gearRatio5": 0.74, + "gearRatio5": 0, "gearRatio6": 0, "backWheelOffsetX": -6, "frontWheelOffsetX": -5, - "wheelOffsetY": 0, - "wheelOffsetZ": 0, + "wheelOffsetY": 3, + "wheelOffsetZ": -4.5, "wheelRadius": 6, "wheelWidth": 3, - "brakeTorqueMax": 3000, - "handBrakeTorqueMax": 6000, - "hasBackWheelDrive": false, + "brakeTorqueMax": 2800, + "handBrakeTorqueMax": 4000, + "hasBackWheelDrive": true, "hasFrontWheelDrive": true, - "pitchRollAngleMax": 89 + "pitchRollAngleMax": 45, + "steerReturnSpeed": 180, + "corneringForceMax": 3, + "suspensionTravel": 6, + "suspensionFrequency": 2.2, + "suspensionDamping": 0.6, + "gearSwitchDuration": 0.2, + "gearShiftUpEngineSpeed": 5200, + "gearShiftDownEngineSpeed": 2500 }, { "name": "PhysicsCar3DGamepadMapper", @@ -6408,9 +6339,9 @@ "name": "ThirdPersonCamera", "type": "ThirdPersonCamera::ThirdPersonCamera", "Object3D": "Object3D", - "RotationHalfwayDuration": 0.125, + "RotationHalfwayDuration": 0.2, "TranslationZHalfwayDuration": 0.125, - "Distance": 450, + "Distance": 260, "LateralOffset": 0, "AheadOffset": 200, "OffsetZ": 0, @@ -6424,7 +6355,7 @@ "CameraZ": 0, "LocalOffsetY": 200, "LocalOffsetX": 0, - "OffsetY": 200, + "OffsetY": 120, "ElevationHalfwayDuration": 1, "IsElevatingWithObject": false } @@ -6718,7 +6649,7 @@ "shapeDimensionB": 0, "shapeDimensionC": 0, "density": 1, - "friction": 7, + "friction": 2, "restitution": 0.1, "linearDamping": 0.1, "angularDamping": 0.1, @@ -6901,7 +6832,7 @@ "shapeDimensionB": 0, "shapeDimensionC": 0, "density": 1, - "friction": 7, + "friction": 2, "restitution": 0.1, "linearDamping": 0.1, "angularDamping": 0.1, @@ -7111,7 +7042,7 @@ "shapeDimensionB": 0, "shapeDimensionC": 0, "density": 1, - "friction": 7, + "friction": 2, "restitution": 0.1, "linearDamping": 0.1, "angularDamping": 0.1, @@ -7144,6 +7075,108 @@ "width": 768, "animations": [] } + }, + { + "adaptCollisionMaskAutomatically": true, + "name": "GasPedal", + "type": "Sprite", + "updateIfNotVisible": false, + "variables": [], + "effects": [], + "behaviors": [ + { + "name": "MultitouchButton", + "type": "SpriteMultitouchJoystick::MultitouchButton", + "ControllerIdentifier": 1, + "ButtonIdentifier": "Gas", + "TouchId": 0, + "TouchIndex": 0, + "IsReleased": false, + "Radius": 110 + } + ], + "animations": [ + { + "name": "", + "useMultipleDirections": false, + "directions": [ + { + "looping": false, + "timeBetweenFrames": 0.08, + "sprites": [ + { + "hasCustomCollisionMask": false, + "image": "assets/StartingGasPedal.png", + "points": [], + "originPoint": { + "name": "origine", + "x": 0, + "y": 0 + }, + "centerPoint": { + "automatic": true, + "name": "centre", + "x": 0, + "y": 0 + }, + "customCollisionMask": [] + } + ] + } + ] + } + ] + }, + { + "adaptCollisionMaskAutomatically": true, + "name": "BrakePedal", + "type": "Sprite", + "updateIfNotVisible": false, + "variables": [], + "effects": [], + "behaviors": [ + { + "name": "MultitouchButton", + "type": "SpriteMultitouchJoystick::MultitouchButton", + "ControllerIdentifier": 1, + "ButtonIdentifier": "Brake", + "TouchId": 0, + "TouchIndex": 0, + "IsReleased": false, + "Radius": 90 + } + ], + "animations": [ + { + "name": "", + "useMultipleDirections": false, + "directions": [ + { + "looping": false, + "timeBetweenFrames": 0.08, + "sprites": [ + { + "hasCustomCollisionMask": false, + "image": "assets/StartingBrakePedal.png", + "points": [], + "originPoint": { + "name": "origine", + "x": 0, + "y": 0 + }, + "centerPoint": { + "automatic": true, + "name": "centre", + "x": 0, + "y": 0 + }, + "customCollisionMask": [] + } + ] + } + ] + } + ] } ], "objectsFolderStructure": { @@ -7180,9 +7213,6 @@ { "objectName": "SteerJoystick" }, - { - "objectName": "SpeedJoystick" - }, { "objectName": "ScreenOrientationChecker" }, @@ -7197,6 +7227,12 @@ }, { "objectName": "BestTimeText" + }, + { + "objectName": "GasPedal" + }, + { + "objectName": "BrakePedal" } ] }, @@ -7687,14 +7723,6 @@ "SteerJoystick" ] }, - { - "type": { - "value": "Hide" - }, - "parameters": [ - "SpeedJoystick" - ] - }, { "type": { "value": "SpriteMultitouchJoystick::SpriteMultitouchJoystick::ActivateControl" @@ -7704,16 +7732,6 @@ "", "" ] - }, - { - "type": { - "value": "SpriteMultitouchJoystick::SpriteMultitouchJoystick::ActivateControl" - }, - "parameters": [ - "SpeedJoystick", - "", - "" - ] } ] } @@ -7753,12 +7771,11 @@ "conditions": [ { "type": { - "value": "SpriteMultitouchJoystick::HasTouchStartedOnScreenSide" + "value": "SpriteMultitouchJoystick::MultitouchButton::IsPressed" }, "parameters": [ - "", - "SpeedJoystick", - "\"Right\"", + "GasPedal", + "MultitouchButton", "" ] } @@ -7766,15 +7783,119 @@ "actions": [ { "type": { - "value": "SpriteMultitouchJoystick::SpriteMultitouchJoystick::TeleportAndPress" + "value": "Physics3D::PhysicsCar3D::SimulateForwardKey" }, "parameters": [ - "SpeedJoystick", - "CursorX(\"UI\")", - "CursorY(\"UI\")", + "Player", + "PhysicsCar3D" + ] + }, + { + "type": { + "value": "OpacityCapability::OpacityBehavior::SetValue" + }, + "parameters": [ + "GasPedal", + "Opacity", + "=", + "255" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::MultitouchButton::IsPressed", + "inverted": true + }, + "parameters": [ + "GasPedal", + "MultitouchButton", "" ] } + ], + "actions": [ + { + "type": { + "value": "OpacityCapability::OpacityBehavior::SetValue" + }, + "parameters": [ + "GasPedal", + "Opacity", + "=", + "130" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::MultitouchButton::IsPressed" + }, + "parameters": [ + "BrakePedal", + "MultitouchButton", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "Physics3D::PhysicsCar3D::SimulateBackwardKey" + }, + "parameters": [ + "Player", + "PhysicsCar3D" + ] + }, + { + "type": { + "value": "OpacityCapability::OpacityBehavior::SetValue" + }, + "parameters": [ + "BrakePedal", + "Opacity", + "=", + "255" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::MultitouchButton::IsPressed", + "inverted": true + }, + "parameters": [ + "BrakePedal", + "MultitouchButton", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "OpacityCapability::OpacityBehavior::SetValue" + }, + "parameters": [ + "BrakePedal", + "Opacity", + "=", + "130" + ] + } ] } ] @@ -7875,11 +7996,11 @@ }, { "type": { - "value": "SpriteMultitouchJoystick::SpriteMultitouchJoystick::IsDirectionPushed8Way" + "value": "SpriteMultitouchJoystick::MultitouchButton::IsPressed" }, "parameters": [ - "SpeedJoystick", - "\"Down\"", + "BrakePedal", + "MultitouchButton", "" ] } @@ -7930,11 +8051,11 @@ }, { "type": { - "value": "SpriteMultitouchJoystick::SpriteMultitouchJoystick::IsDirectionPushed8Way" + "value": "SpriteMultitouchJoystick::MultitouchButton::IsPressed" }, "parameters": [ - "SpeedJoystick", - "\"Up\"", + "GasPedal", + "MultitouchButton", "" ] } @@ -8473,7 +8594,7 @@ "ambientLightColorR": 200, "camera2DPlaneMaxDrawingDistance": 5000, "camera3DFarPlaneDistance": 5000, - "camera3DFieldOfView": 45, + "camera3DFieldOfView": 60, "camera3DNearPlaneDistance": 0.1, "cameraType": "perspective", "followBaseLayerCamera": false, @@ -51662,11 +51783,11 @@ "angle": 0, "customSize": true, "depth": 32, - "height": 160, + "height": 120, "layer": "MobileControls", "name": "SteerJoystick", "persistentUuid": "d42256d9-4b75-48e5-8211-672b4a24b2ff", - "width": 160, + "width": 120, "x": 112, "y": 592, "zOrder": 25, @@ -51677,15 +51798,32 @@ { "angle": 0, "customSize": true, - "depth": 32, - "height": 160, + "depth": 1.0013908205841446, + "height": 720, "layer": "MobileControls", - "name": "SpeedJoystick", - "persistentUuid": "37b8a038-ac16-4e8b-8ed5-38629193ec1f", + "name": "ScreenOrientationChecker", + "persistentUuid": "eee10984-d670-48cb-b98e-b9cbe189e3f6", + "width": 1280, + "x": 0, + "y": 0, + "zOrder": 27, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "height": 240, + "keepRatio": true, + "layer": "MobileControls", + "locked": true, + "name": "GasPedal", + "persistentUuid": "aeea9a56-cedc-472e-a346-07a6a2378bed", "width": 160, - "x": 1168, - "y": 592, - "zOrder": 26, + "x": 1080, + "y": 440, + "zOrder": 10, "numberProperties": [], "stringProperties": [], "initialVariables": [] @@ -51693,15 +51831,16 @@ { "angle": 0, "customSize": true, - "depth": 1.0013908205841446, - "height": 720, + "height": 170, + "keepRatio": true, "layer": "MobileControls", - "name": "ScreenOrientationChecker", - "persistentUuid": "eee10984-d670-48cb-b98e-b9cbe189e3f6", - "width": 1280, - "x": 0, - "y": 0, - "zOrder": 27, + "locked": true, + "name": "BrakePedal", + "persistentUuid": "1d9923ea-c090-4c09-a58c-8a872fe29c4b", + "width": 160, + "x": 880, + "y": 510, + "zOrder": 10, "numberProperties": [], "stringProperties": [], "initialVariables": [] diff --git a/examples/3d-car-coin-hunt/assets/Line light joystick border UpDown.png b/examples/3d-car-coin-hunt/assets/Line light joystick border UpDown.png deleted file mode 100644 index 34bbf0cb9..000000000 Binary files a/examples/3d-car-coin-hunt/assets/Line light joystick border UpDown.png and /dev/null differ diff --git a/examples/3d-car-coin-hunt/assets/StartingBrakePedal.png b/examples/3d-car-coin-hunt/assets/StartingBrakePedal.png new file mode 100644 index 000000000..3906f9542 Binary files /dev/null and b/examples/3d-car-coin-hunt/assets/StartingBrakePedal.png differ diff --git a/examples/3d-car-coin-hunt/assets/StartingGasPedal.png b/examples/3d-car-coin-hunt/assets/StartingGasPedal.png new file mode 100644 index 000000000..50ad4605c Binary files /dev/null and b/examples/3d-car-coin-hunt/assets/StartingGasPedal.png differ diff --git a/examples/3d-endless-terrain/3d-endless-terrain.json b/examples/3d-endless-terrain/3d-endless-terrain.json index b9ba18f03..a145a87e3 100644 --- a/examples/3d-endless-terrain/3d-endless-terrain.json +++ b/examples/3d-endless-terrain/3d-endless-terrain.json @@ -217,7 +217,7 @@ "massCenterOffsetZ": 0, "massOverride": 0, "density": 1, - "friction": 7, + "friction": 2, "restitution": 0, "linearDamping": 0, "angularDamping": 0, @@ -270,11 +270,11 @@ "shapeDimensionB": 65, "shapeDimensionC": 40, "density": 1, - "friction": 10, - "restitution": 0.5, - "linearDamping": 0.01, + "friction": 0.2, + "restitution": 0.05, + "linearDamping": 0.02, "angularDamping": 2, - "gravityScale": 6, + "gravityScale": 2, "layers": 17, "masks": 17, "shapeOffsetX": 0, @@ -282,38 +282,46 @@ "shapeOffsetZ": 2, "massCenterOffsetX": 0, "massCenterOffsetY": 0, - "massCenterOffsetZ": -25, + "massCenterOffsetZ": -30, "massOverride": 1500 }, { "name": "PhysicsCar3D", "type": "Physics3D::PhysicsCar3D", "physics3D": "Physics3D", - "steerAngleMax": 70, - "beginningSteerSpeed": 140, - "endSteerSpeed": 10, + "steerAngleMax": 32, + "beginningSteerSpeed": 120, + "endSteerSpeed": 120, "mass": 1500, - "engineTorqueMax": 16000, + "engineTorqueMax": 1300, "engineSpeedMax": 6000, - "engineInertia": 0.1, + "engineInertia": 0.3, "reverseGearRatio1": -2.9, - "gearRatio1": 3.66, - "gearRatio2": 1.78, - "gearRatio3": 1.3, - "gearRatio4": 1, - "gearRatio5": 0.74, + "gearRatio1": 2.66, + "gearRatio2": 1.9, + "gearRatio3": 0, + "gearRatio4": 0, + "gearRatio5": 0, "gearRatio6": 0, "backWheelOffsetX": -6, "frontWheelOffsetX": -5, "wheelOffsetY": 0, - "wheelOffsetZ": 0, + "wheelOffsetZ": -10.5, "wheelRadius": 8, "wheelWidth": 5, - "brakeTorqueMax": 6000, - "handBrakeTorqueMax": 12000, + "brakeTorqueMax": 3700, + "handBrakeTorqueMax": 5000, "hasBackWheelDrive": true, "hasFrontWheelDrive": true, - "pitchRollAngleMax": 89 + "pitchRollAngleMax": 45, + "corneringForceMax": 2.3, + "suspensionTravel": 12, + "suspensionFrequency": 2, + "steerReturnSpeed": 180, + "suspensionDamping": 0.6, + "gearSwitchDuration": 0.2, + "gearShiftUpEngineSpeed": 5200, + "gearShiftDownEngineSpeed": 2500 }, { "name": "PhysicsCar3DGamepadMapper", @@ -348,9 +356,9 @@ "name": "ThirdPersonCamera", "type": "ThirdPersonCamera::ThirdPersonCamera", "Object3D": "Object3D", - "RotationHalfwayDuration": 0.125, + "RotationHalfwayDuration": 0.2, "TranslationZHalfwayDuration": 0.125, - "Distance": 800, + "Distance": 450, "LateralOffset": 0, "AheadOffset": 200, "OffsetZ": 0, @@ -364,7 +372,7 @@ "CameraZ": 0, "LocalOffsetY": 200, "LocalOffsetX": 0, - "OffsetY": 200, + "OffsetY": 120, "ElevationHalfwayDuration": 1, "IsElevatingWithObject": false } @@ -1763,7 +1771,7 @@ "ambientLightColorR": 200, "camera2DPlaneMaxDrawingDistance": 5000, "camera3DFarPlaneDistance": 20000, - "camera3DFieldOfView": 45, + "camera3DFieldOfView": 60, "camera3DNearPlaneDistance": 30, "cameraType": "", "followBaseLayerCamera": false, diff --git a/examples/starting-3d-car-racing/assets/Flat dark joystick border vertical.png b/examples/starting-3d-car-racing/assets/Flat dark joystick border vertical.png deleted file mode 100644 index ec315d4b6..000000000 Binary files a/examples/starting-3d-car-racing/assets/Flat dark joystick border vertical.png and /dev/null differ diff --git a/examples/starting-3d-car-racing/assets/StartingBrakePedal.png b/examples/starting-3d-car-racing/assets/StartingBrakePedal.png new file mode 100644 index 000000000..3906f9542 Binary files /dev/null and b/examples/starting-3d-car-racing/assets/StartingBrakePedal.png differ diff --git a/examples/starting-3d-car-racing/assets/StartingGasPedal.png b/examples/starting-3d-car-racing/assets/StartingGasPedal.png new file mode 100644 index 000000000..50ad4605c Binary files /dev/null and b/examples/starting-3d-car-racing/assets/StartingGasPedal.png differ diff --git a/examples/starting-3d-car-racing/starting-3d-car-racing.json b/examples/starting-3d-car-racing/starting-3d-car-racing.json index 066540e30..9825a8074 100644 --- a/examples/starting-3d-car-racing/starting-3d-car-racing.json +++ b/examples/starting-3d-car-racing/starting-3d-car-racing.json @@ -215,26 +215,34 @@ "userAdded": false }, { - "file": "assets/Flat dark joystick border vertical.png", + "file": "assets/Flat dark joystick border horizontal.png", "kind": "image", "metadata": "", - "name": "assets/Flat dark joystick border vertical.png", + "name": "assets/Flat dark joystick border horizontal.png", "smoothed": true, "userAdded": false }, { - "file": "assets/Flat dark joystick border horizontal.png", + "file": "assets/StartingGround.png", "kind": "image", "metadata": "", - "name": "assets/Flat dark joystick border horizontal.png", + "name": "assets/StartingGround.png", "smoothed": true, "userAdded": false }, { - "file": "assets/StartingGround.png", + "file": "assets/StartingGasPedal.png", "kind": "image", "metadata": "", - "name": "assets/StartingGround.png", + "name": "assets/StartingGasPedal.png", + "smoothed": true, + "userAdded": false + }, + { + "file": "assets/StartingBrakePedal.png", + "kind": "image", + "metadata": "", + "name": "assets/StartingBrakePedal.png", "smoothed": true, "userAdded": false } @@ -331,31 +339,14 @@ }, { "angle": 0, - "customSize": false, - "height": 0, - "keepRatio": true, - "layer": "MobileControls", - "locked": true, - "name": "Speed_Joystick", - "persistentUuid": "98bcbea1-1b37-46a3-8686-ff716b1b1024", - "width": 0, - "x": 1072, - "y": 537, - "zOrder": 9, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] - }, - { - "angle": 0, - "customSize": false, - "height": 0, + "customSize": true, + "height": 120, "keepRatio": true, "layer": "MobileControls", "locked": true, "name": "Steer_Joystick", "persistentUuid": "6c0d6cbc-a8d1-4930-b2e4-a83ac76f2d7e", - "width": 0, + "width": 120, "x": 208, "y": 537, "zOrder": 10, @@ -792,6 +783,40 @@ "numberProperties": [], "stringProperties": [], "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "height": 240, + "keepRatio": true, + "layer": "MobileControls", + "locked": true, + "name": "GasPedal", + "persistentUuid": "ea47a091-8536-4fa2-9dfa-bdefb7197bb0", + "width": 160, + "x": 1080, + "y": 440, + "zOrder": 10, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "height": 170, + "keepRatio": true, + "layer": "MobileControls", + "locked": true, + "name": "BrakePedal", + "persistentUuid": "50f1125a-d230-4eaa-a32e-d1b20c305620", + "width": 160, + "x": 880, + "y": 510, + "zOrder": 10, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] } ], "objects": [ @@ -816,7 +841,7 @@ "shapeDimensionB": 0, "shapeDimensionC": 0, "density": 1, - "friction": 7, + "friction": 2, "restitution": 0, "linearDamping": 0.1, "angularDamping": 0.1, @@ -899,11 +924,11 @@ "shapeDimensionB": 39, "shapeDimensionC": 27, "density": 1, - "friction": 10, - "restitution": 0.5, - "linearDamping": 0.1, - "angularDamping": 0.1, - "gravityScale": 6, + "friction": 0.2, + "restitution": 0.05, + "linearDamping": 0.02, + "angularDamping": 1, + "gravityScale": 2, "layers": 17, "masks": 17, "shapeOffsetX": 0, @@ -911,7 +936,7 @@ "shapeOffsetZ": 6, "massCenterOffsetX": 0, "massCenterOffsetY": 0, - "massCenterOffsetZ": -25, + "massCenterOffsetZ": -16, "massOverride": 1500 }, { @@ -919,31 +944,39 @@ "name": "PhysicsCar3D", "type": "Physics3D::PhysicsCar3D", "physics3D": "Physics3D", - "steerAngleMax": 70, - "beginningSteerSpeed": 140, - "endSteerSpeed": 10, + "steerAngleMax": 32, + "beginningSteerSpeed": 120, + "endSteerSpeed": 120, "mass": 1500, - "engineTorqueMax": 8000, + "engineTorqueMax": 1500, "engineSpeedMax": 6000, - "engineInertia": 0.1, + "engineInertia": 0.3, "reverseGearRatio1": -2.9, "gearRatio1": 2.66, "gearRatio2": 1.78, "gearRatio3": 1.3, "gearRatio4": 1, - "gearRatio5": 0.74, + "gearRatio5": 0, "gearRatio6": 0, "backWheelOffsetX": -6, - "frontWheelOffsetX": 10, + "frontWheelOffsetX": -4, "wheelOffsetY": 3, - "wheelOffsetZ": 0, + "wheelOffsetZ": -4.5, "wheelRadius": 6, "wheelWidth": 3, - "brakeTorqueMax": 3000, - "handBrakeTorqueMax": 6000, - "hasBackWheelDrive": false, + "brakeTorqueMax": 2800, + "handBrakeTorqueMax": 4000, + "hasBackWheelDrive": true, "hasFrontWheelDrive": true, - "pitchRollAngleMax": 89 + "pitchRollAngleMax": 45, + "steerReturnSpeed": 180, + "corneringForceMax": 3, + "suspensionTravel": 6, + "suspensionFrequency": 2.2, + "suspensionDamping": 0.6, + "gearSwitchDuration": 0.2, + "gearShiftUpEngineSpeed": 5200, + "gearShiftDownEngineSpeed": 2500 }, { "isFolded": true, @@ -969,9 +1002,9 @@ "name": "ThirdPersonCamera", "type": "ThirdPersonCamera::ThirdPersonCamera", "Object3D": "Object3D", - "RotationHalfwayDuration": 0.125, + "RotationHalfwayDuration": 0.2, "TranslationZHalfwayDuration": 0.25, - "Distance": 450, + "Distance": 260, "LateralOffset": 0, "AheadOffset": 200, "OffsetZ": 0, @@ -985,7 +1018,7 @@ "CameraZ": 0, "LocalOffsetY": 200, "LocalOffsetX": 0, - "OffsetY": 200, + "OffsetY": 120, "ElevationHalfwayDuration": 1, "IsElevatingWithObject": false, "OffsetX": 0 @@ -1009,92 +1042,6 @@ "animations": [] } }, - { - "assetStoreId": "e71bd69f896d6c7531b48c65ceb5da25071d4fbdeb518aeceecba8d21f34ed8d", - "name": "Speed_Joystick", - "persistentUuid": "f0dcaf34-2fe1-4333-aef2-6bb1f660efb2", - "type": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", - "variant": "", - "variables": [], - "effects": [], - "behaviors": [], - "content": { - "DeadZoneRadius": 0.2, - "JoystickIdentifier": "Secondary" - }, - "childrenContent": { - "Border": { - "adaptCollisionMaskAutomatically": false, - "updateIfNotVisible": false, - "animations": [ - { - "name": "Idle", - "useMultipleDirections": false, - "directions": [ - { - "looping": false, - "timeBetweenFrames": 0.08, - "sprites": [ - { - "hasCustomCollisionMask": false, - "image": "assets/Flat dark joystick border vertical.png", - "points": [], - "originPoint": { - "name": "origine", - "x": 0, - "y": 0 - }, - "centerPoint": { - "automatic": true, - "name": "centre", - "x": 0, - "y": 0 - }, - "customCollisionMask": [] - } - ] - } - ] - } - ] - }, - "Thumb": { - "adaptCollisionMaskAutomatically": false, - "updateIfNotVisible": false, - "animations": [ - { - "name": "Idle", - "useMultipleDirections": false, - "directions": [ - { - "looping": false, - "timeBetweenFrames": 0.08, - "sprites": [ - { - "hasCustomCollisionMask": false, - "image": "assets\\Flat dark joystick thumb.png", - "points": [], - "originPoint": { - "name": "origine", - "x": 0, - "y": 0 - }, - "centerPoint": { - "automatic": true, - "name": "centre", - "x": 0, - "y": 0 - }, - "customCollisionMask": [] - } - ] - } - ] - } - ] - } - } - }, { "assetStoreId": "e71bd69f896d6c7531b48c65ceb5da25071d4fbdeb518aeceecba8d21f34ed8d", "name": "Steer_Joystick", @@ -1106,7 +1053,7 @@ "behaviors": [], "content": { "JoystickIdentifier": "Primary", - "DeadZoneRadius": 0.2 + "DeadZoneRadius": 0.1 }, "childrenContent": { "Border": { @@ -1418,7 +1365,7 @@ "shapeDimensionB": 0, "shapeDimensionC": 0, "density": 1, - "friction": 7, + "friction": 0.2, "restitution": 0, "linearDamping": 0.1, "angularDamping": 0.1, @@ -1496,7 +1443,7 @@ "massCenterOffsetZ": 0, "massOverride": 0, "density": 1, - "friction": 6, + "friction": 1.7, "restitution": 0.1, "linearDamping": 0.1, "angularDamping": 0.1, @@ -1519,6 +1466,108 @@ "CastShadow": false, "Layer2Color": "255;255;255" } + }, + { + "adaptCollisionMaskAutomatically": true, + "name": "GasPedal", + "type": "Sprite", + "updateIfNotVisible": false, + "variables": [], + "effects": [], + "behaviors": [ + { + "name": "MultitouchButton", + "type": "SpriteMultitouchJoystick::MultitouchButton", + "ControllerIdentifier": 1, + "ButtonIdentifier": "Gas", + "TouchId": 0, + "TouchIndex": 0, + "IsReleased": false, + "Radius": 110 + } + ], + "animations": [ + { + "name": "", + "useMultipleDirections": false, + "directions": [ + { + "looping": false, + "timeBetweenFrames": 0.08, + "sprites": [ + { + "hasCustomCollisionMask": false, + "image": "assets/StartingGasPedal.png", + "points": [], + "originPoint": { + "name": "origine", + "x": 0, + "y": 0 + }, + "centerPoint": { + "automatic": true, + "name": "centre", + "x": 0, + "y": 0 + }, + "customCollisionMask": [] + } + ] + } + ] + } + ] + }, + { + "adaptCollisionMaskAutomatically": true, + "name": "BrakePedal", + "type": "Sprite", + "updateIfNotVisible": false, + "variables": [], + "effects": [], + "behaviors": [ + { + "name": "MultitouchButton", + "type": "SpriteMultitouchJoystick::MultitouchButton", + "ControllerIdentifier": 1, + "ButtonIdentifier": "Brake", + "TouchId": 0, + "TouchIndex": 0, + "IsReleased": false, + "Radius": 90 + } + ], + "animations": [ + { + "name": "", + "useMultipleDirections": false, + "directions": [ + { + "looping": false, + "timeBetweenFrames": 0.08, + "sprites": [ + { + "hasCustomCollisionMask": false, + "image": "assets/StartingBrakePedal.png", + "points": [], + "originPoint": { + "name": "origine", + "x": 0, + "y": 0 + }, + "centerPoint": { + "automatic": true, + "name": "centre", + "x": 0, + "y": 0 + }, + "customCollisionMask": [] + } + ] + } + ] + } + ] } ], "objectsFolderStructure": { @@ -1552,10 +1601,13 @@ "folderName": "Mobile Controls", "children": [ { - "objectName": "Speed_Joystick" + "objectName": "Steer_Joystick" }, { - "objectName": "Steer_Joystick" + "objectName": "GasPedal" + }, + { + "objectName": "BrakePedal" } ] } @@ -1740,6 +1792,277 @@ ] } ] + }, + { + "colorB": 228, + "colorG": 176, + "colorR": 74, + "creationTime": 0, + "name": "Mobile controls", + "source": "", + "type": "BuiltinCommonInstructions::Group", + "parameters": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SceneJustBegins" + }, + "parameters": [ + "" + ] + }, + { + "type": { + "value": "SystemInfo::HasTouchScreen", + "inverted": true + }, + "parameters": [ + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "Delete" + }, + "parameters": [ + "Steer_Joystick", + "" + ] + }, + { + "type": { + "value": "Delete" + }, + "parameters": [ + "GasPedal", + "" + ] + }, + { + "type": { + "value": "Delete" + }, + "parameters": [ + "BrakePedal", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SystemInfo::HasTouchScreen" + }, + "parameters": [ + "" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SceneJustBegins" + }, + "parameters": [ + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "Hide" + }, + "parameters": [ + "Steer_Joystick" + ] + }, + { + "type": { + "value": "SpriteMultitouchJoystick::SpriteMultitouchJoystick::ActivateControl" + }, + "parameters": [ + "Steer_Joystick", + "", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::HasTouchStartedOnScreenSide" + }, + "parameters": [ + "", + "Steer_Joystick", + "\"Left\"", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::SpriteMultitouchJoystick::TeleportAndPress" + }, + "parameters": [ + "Steer_Joystick", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::MultitouchButton::IsPressed" + }, + "parameters": [ + "GasPedal", + "MultitouchButton", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "Physics3D::PhysicsCar3D::SimulateForwardKey" + }, + "parameters": [ + "PlayerCar", + "PhysicsCar3D" + ] + }, + { + "type": { + "value": "OpacityCapability::OpacityBehavior::SetValue" + }, + "parameters": [ + "GasPedal", + "Opacity", + "=", + "255" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::MultitouchButton::IsPressed", + "inverted": true + }, + "parameters": [ + "GasPedal", + "MultitouchButton", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "OpacityCapability::OpacityBehavior::SetValue" + }, + "parameters": [ + "GasPedal", + "Opacity", + "=", + "130" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::MultitouchButton::IsPressed" + }, + "parameters": [ + "BrakePedal", + "MultitouchButton", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "Physics3D::PhysicsCar3D::SimulateBackwardKey" + }, + "parameters": [ + "PlayerCar", + "PhysicsCar3D" + ] + }, + { + "type": { + "value": "OpacityCapability::OpacityBehavior::SetValue" + }, + "parameters": [ + "BrakePedal", + "Opacity", + "=", + "255" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::MultitouchButton::IsPressed", + "inverted": true + }, + "parameters": [ + "BrakePedal", + "MultitouchButton", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "OpacityCapability::OpacityBehavior::SetValue" + }, + "parameters": [ + "BrakePedal", + "Opacity", + "=", + "130" + ] + } + ] + } + ] + } + ] } ], "layers": [ @@ -1749,7 +2072,7 @@ "ambientLightColorR": 200, "camera2DPlaneMaxDrawingDistance": 5000, "camera3DFarPlaneDistance": 10000, - "camera3DFieldOfView": 45, + "camera3DFieldOfView": 60, "camera3DNearPlaneDistance": 3, "cameraType": "", "followBaseLayerCamera": false, diff --git a/examples/starting-3d-driving/assets/Flat dark joystick border vertical.png b/examples/starting-3d-driving/assets/Flat dark joystick border vertical.png deleted file mode 100644 index ec315d4b6..000000000 Binary files a/examples/starting-3d-driving/assets/Flat dark joystick border vertical.png and /dev/null differ diff --git a/examples/starting-3d-driving/assets/StartingBrakePedal.png b/examples/starting-3d-driving/assets/StartingBrakePedal.png new file mode 100644 index 000000000..3906f9542 Binary files /dev/null and b/examples/starting-3d-driving/assets/StartingBrakePedal.png differ diff --git a/examples/starting-3d-driving/assets/StartingGasPedal.png b/examples/starting-3d-driving/assets/StartingGasPedal.png new file mode 100644 index 000000000..50ad4605c Binary files /dev/null and b/examples/starting-3d-driving/assets/StartingGasPedal.png differ diff --git a/examples/starting-3d-driving/starting-3d-driving.json b/examples/starting-3d-driving/starting-3d-driving.json index ae2301a7b..454427c54 100644 --- a/examples/starting-3d-driving/starting-3d-driving.json +++ b/examples/starting-3d-driving/starting-3d-driving.json @@ -191,14 +191,6 @@ "smoothed": true, "userAdded": false }, - { - "file": "assets/Flat dark joystick border vertical.png", - "kind": "image", - "metadata": "", - "name": "assets/Flat dark joystick border vertical.png", - "smoothed": true, - "userAdded": false - }, { "file": "assets/Flat dark joystick border horizontal.png", "kind": "image", @@ -222,6 +214,22 @@ "name": "assets/StartingGround.png", "smoothed": true, "userAdded": false + }, + { + "file": "assets/StartingGasPedal.png", + "kind": "image", + "metadata": "", + "name": "assets/StartingGasPedal.png", + "smoothed": true, + "userAdded": false + }, + { + "file": "assets/StartingBrakePedal.png", + "kind": "image", + "metadata": "", + "name": "assets/StartingBrakePedal.png", + "smoothed": true, + "userAdded": false } ] }, @@ -299,31 +307,14 @@ }, { "angle": 0, - "customSize": false, - "height": 0, - "keepRatio": true, - "layer": "MobileControls", - "locked": true, - "name": "Speed_Joystick", - "persistentUuid": "98bcbea1-1b37-46a3-8686-ff716b1b1024", - "width": 0, - "x": 1072, - "y": 537, - "zOrder": 9, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] - }, - { - "angle": 0, - "customSize": false, - "height": 0, + "customSize": true, + "height": 120, "keepRatio": true, "layer": "MobileControls", "locked": true, "name": "Steer_Joystick", "persistentUuid": "6c0d6cbc-a8d1-4930-b2e4-a83ac76f2d7e", - "width": 0, + "width": 120, "x": 208, "y": 537, "zOrder": 10, @@ -678,6 +669,40 @@ "numberProperties": [], "stringProperties": [], "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "height": 240, + "keepRatio": true, + "layer": "MobileControls", + "locked": true, + "name": "GasPedal", + "persistentUuid": "a76a6490-4820-43cd-9566-db7194d9b3a0", + "width": 160, + "x": 1080, + "y": 440, + "zOrder": 10, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "height": 170, + "keepRatio": true, + "layer": "MobileControls", + "locked": true, + "name": "BrakePedal", + "persistentUuid": "b3fddbaf-b905-4d6d-9360-5f548c851c43", + "width": 160, + "x": 880, + "y": 510, + "zOrder": 10, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] } ], "objects": [ @@ -702,7 +727,7 @@ "shapeDimensionB": 0, "shapeDimensionC": 0, "density": 1, - "friction": 7, + "friction": 2, "restitution": 0, "linearDamping": 0.1, "angularDamping": 0.1, @@ -771,11 +796,11 @@ "shapeDimensionB": 39, "shapeDimensionC": 27, "density": 1, - "friction": 10, - "restitution": 0.5, - "linearDamping": 0.1, - "angularDamping": 0.1, - "gravityScale": 6, + "friction": 0.2, + "restitution": 0.05, + "linearDamping": 0.02, + "angularDamping": 1, + "gravityScale": 2, "layers": 17, "masks": 17, "shapeOffsetX": 0, @@ -783,38 +808,46 @@ "shapeOffsetZ": 6, "massCenterOffsetX": 0, "massCenterOffsetY": 0, - "massCenterOffsetZ": -25, + "massCenterOffsetZ": -16, "massOverride": 1500 }, { "name": "PhysicsCar3D", "type": "Physics3D::PhysicsCar3D", "physics3D": "Physics3D", - "steerAngleMax": 70, - "beginningSteerSpeed": 140, - "endSteerSpeed": 10, + "steerAngleMax": 32, + "beginningSteerSpeed": 120, + "endSteerSpeed": 120, "mass": 1500, - "engineTorqueMax": 8000, + "engineTorqueMax": 1500, "engineSpeedMax": 6000, - "engineInertia": 0.1, + "engineInertia": 0.3, "reverseGearRatio1": -2.9, "gearRatio1": 2.66, "gearRatio2": 1.78, "gearRatio3": 1.3, "gearRatio4": 1, - "gearRatio5": 0.74, + "gearRatio5": 0, "gearRatio6": 0, "backWheelOffsetX": -6, - "frontWheelOffsetX": 10, + "frontWheelOffsetX": -4, "wheelOffsetY": 3, - "wheelOffsetZ": 0, + "wheelOffsetZ": -4.5, "wheelRadius": 6, "wheelWidth": 3, - "brakeTorqueMax": 3000, - "handBrakeTorqueMax": 6000, - "hasBackWheelDrive": false, + "brakeTorqueMax": 2800, + "handBrakeTorqueMax": 4000, + "hasBackWheelDrive": true, "hasFrontWheelDrive": true, - "pitchRollAngleMax": 89 + "pitchRollAngleMax": 45, + "steerReturnSpeed": 180, + "corneringForceMax": 3, + "suspensionTravel": 6, + "suspensionFrequency": 2.2, + "suspensionDamping": 0.6, + "gearSwitchDuration": 0.2, + "gearShiftUpEngineSpeed": 5200, + "gearShiftDownEngineSpeed": 2500 }, { "name": "PhysicsCar3DKeyboardMapper", @@ -839,9 +872,9 @@ "name": "ThirdPersonCamera", "type": "ThirdPersonCamera::ThirdPersonCamera", "Object3D": "Object3D", - "RotationHalfwayDuration": 0.125, + "RotationHalfwayDuration": 0.2, "TranslationZHalfwayDuration": 0.25, - "Distance": 450, + "Distance": 260, "LateralOffset": 0, "AheadOffset": 200, "OffsetZ": 0, @@ -855,7 +888,7 @@ "CameraZ": 0, "LocalOffsetY": 200, "LocalOffsetX": 0, - "OffsetY": 200, + "OffsetY": 120, "ElevationHalfwayDuration": 1, "IsElevatingWithObject": false } @@ -878,92 +911,6 @@ "animations": [] } }, - { - "assetStoreId": "e71bd69f896d6c7531b48c65ceb5da25071d4fbdeb518aeceecba8d21f34ed8d", - "name": "Speed_Joystick", - "persistentUuid": "9cec9083-d43d-4a9d-9017-7f44615dc54b", - "type": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", - "variant": "", - "variables": [], - "effects": [], - "behaviors": [], - "content": { - "DeadZoneRadius": 0.2, - "JoystickIdentifier": "Secondary" - }, - "childrenContent": { - "Border": { - "adaptCollisionMaskAutomatically": false, - "updateIfNotVisible": false, - "animations": [ - { - "name": "Idle", - "useMultipleDirections": false, - "directions": [ - { - "looping": false, - "timeBetweenFrames": 0.08, - "sprites": [ - { - "hasCustomCollisionMask": false, - "image": "assets/Flat dark joystick border vertical.png", - "points": [], - "originPoint": { - "name": "origine", - "x": 0, - "y": 0 - }, - "centerPoint": { - "automatic": true, - "name": "centre", - "x": 0, - "y": 0 - }, - "customCollisionMask": [] - } - ] - } - ] - } - ] - }, - "Thumb": { - "adaptCollisionMaskAutomatically": false, - "updateIfNotVisible": false, - "animations": [ - { - "name": "Idle", - "useMultipleDirections": false, - "directions": [ - { - "looping": false, - "timeBetweenFrames": 0.08, - "sprites": [ - { - "hasCustomCollisionMask": false, - "image": "assets\\Flat dark joystick thumb.png", - "points": [], - "originPoint": { - "name": "origine", - "x": 0, - "y": 0 - }, - "centerPoint": { - "automatic": true, - "name": "centre", - "x": 0, - "y": 0 - }, - "customCollisionMask": [] - } - ] - } - ] - } - ] - } - } - }, { "assetStoreId": "e71bd69f896d6c7531b48c65ceb5da25071d4fbdeb518aeceecba8d21f34ed8d", "name": "Steer_Joystick", @@ -975,7 +922,7 @@ "behaviors": [], "content": { "JoystickIdentifier": "Primary", - "DeadZoneRadius": 0.2 + "DeadZoneRadius": 0.1 }, "childrenContent": { "Border": { @@ -1125,7 +1072,7 @@ "shapeDimensionB": 0, "shapeDimensionC": 0, "density": 1, - "friction": 7, + "friction": 0.2, "restitution": 0, "linearDamping": 0.1, "angularDamping": 0.1, @@ -1203,7 +1150,7 @@ "massCenterOffsetZ": 0, "massOverride": 0, "density": 1, - "friction": 7, + "friction": 2, "restitution": 0.1, "linearDamping": 0.1, "angularDamping": 0.1, @@ -1226,6 +1173,108 @@ "CastShadow": false, "Layer2Color": "255;255;255" } + }, + { + "adaptCollisionMaskAutomatically": true, + "name": "GasPedal", + "type": "Sprite", + "updateIfNotVisible": false, + "variables": [], + "effects": [], + "behaviors": [ + { + "name": "MultitouchButton", + "type": "SpriteMultitouchJoystick::MultitouchButton", + "ControllerIdentifier": 1, + "ButtonIdentifier": "Gas", + "TouchId": 0, + "TouchIndex": 0, + "IsReleased": false, + "Radius": 110 + } + ], + "animations": [ + { + "name": "", + "useMultipleDirections": false, + "directions": [ + { + "looping": false, + "timeBetweenFrames": 0.08, + "sprites": [ + { + "hasCustomCollisionMask": false, + "image": "assets/StartingGasPedal.png", + "points": [], + "originPoint": { + "name": "origine", + "x": 0, + "y": 0 + }, + "centerPoint": { + "automatic": true, + "name": "centre", + "x": 0, + "y": 0 + }, + "customCollisionMask": [] + } + ] + } + ] + } + ] + }, + { + "adaptCollisionMaskAutomatically": true, + "name": "BrakePedal", + "type": "Sprite", + "updateIfNotVisible": false, + "variables": [], + "effects": [], + "behaviors": [ + { + "name": "MultitouchButton", + "type": "SpriteMultitouchJoystick::MultitouchButton", + "ControllerIdentifier": 1, + "ButtonIdentifier": "Brake", + "TouchId": 0, + "TouchIndex": 0, + "IsReleased": false, + "Radius": 90 + } + ], + "animations": [ + { + "name": "", + "useMultipleDirections": false, + "directions": [ + { + "looping": false, + "timeBetweenFrames": 0.08, + "sprites": [ + { + "hasCustomCollisionMask": false, + "image": "assets/StartingBrakePedal.png", + "points": [], + "originPoint": { + "name": "origine", + "x": 0, + "y": 0 + }, + "centerPoint": { + "automatic": true, + "name": "centre", + "x": 0, + "y": 0 + }, + "customCollisionMask": [] + } + ] + } + ] + } + ] } ], "objectsFolderStructure": { @@ -1250,16 +1299,291 @@ "folderName": "Mobile Controls", "children": [ { - "objectName": "Speed_Joystick" + "objectName": "Steer_Joystick" }, { - "objectName": "Steer_Joystick" + "objectName": "GasPedal" + }, + { + "objectName": "BrakePedal" } ] } ] }, - "events": [], + "events": [ + { + "colorB": 228, + "colorG": 176, + "colorR": 74, + "creationTime": 0, + "name": "Mobile controls", + "source": "", + "type": "BuiltinCommonInstructions::Group", + "parameters": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SceneJustBegins" + }, + "parameters": [ + "" + ] + }, + { + "type": { + "value": "SystemInfo::HasTouchScreen", + "inverted": true + }, + "parameters": [ + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "Delete" + }, + "parameters": [ + "Steer_Joystick", + "" + ] + }, + { + "type": { + "value": "Delete" + }, + "parameters": [ + "GasPedal", + "" + ] + }, + { + "type": { + "value": "Delete" + }, + "parameters": [ + "BrakePedal", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SystemInfo::HasTouchScreen" + }, + "parameters": [ + "" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SceneJustBegins" + }, + "parameters": [ + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "Hide" + }, + "parameters": [ + "Steer_Joystick" + ] + }, + { + "type": { + "value": "SpriteMultitouchJoystick::SpriteMultitouchJoystick::ActivateControl" + }, + "parameters": [ + "Steer_Joystick", + "", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::HasTouchStartedOnScreenSide" + }, + "parameters": [ + "", + "Steer_Joystick", + "\"Left\"", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::SpriteMultitouchJoystick::TeleportAndPress" + }, + "parameters": [ + "Steer_Joystick", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::MultitouchButton::IsPressed" + }, + "parameters": [ + "GasPedal", + "MultitouchButton", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "Physics3D::PhysicsCar3D::SimulateForwardKey" + }, + "parameters": [ + "PlayerCar", + "PhysicsCar3D" + ] + }, + { + "type": { + "value": "OpacityCapability::OpacityBehavior::SetValue" + }, + "parameters": [ + "GasPedal", + "Opacity", + "=", + "255" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::MultitouchButton::IsPressed", + "inverted": true + }, + "parameters": [ + "GasPedal", + "MultitouchButton", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "OpacityCapability::OpacityBehavior::SetValue" + }, + "parameters": [ + "GasPedal", + "Opacity", + "=", + "130" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::MultitouchButton::IsPressed" + }, + "parameters": [ + "BrakePedal", + "MultitouchButton", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "Physics3D::PhysicsCar3D::SimulateBackwardKey" + }, + "parameters": [ + "PlayerCar", + "PhysicsCar3D" + ] + }, + { + "type": { + "value": "OpacityCapability::OpacityBehavior::SetValue" + }, + "parameters": [ + "BrakePedal", + "Opacity", + "=", + "255" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::MultitouchButton::IsPressed", + "inverted": true + }, + "parameters": [ + "BrakePedal", + "MultitouchButton", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "OpacityCapability::OpacityBehavior::SetValue" + }, + "parameters": [ + "BrakePedal", + "Opacity", + "=", + "130" + ] + } + ] + } + ] + } + ] + } + ], "layers": [ { "ambientLightColorB": 200, @@ -1267,7 +1591,7 @@ "ambientLightColorR": 200, "camera2DPlaneMaxDrawingDistance": 5000, "camera3DFarPlaneDistance": 10000, - "camera3DFieldOfView": 45, + "camera3DFieldOfView": 60, "camera3DNearPlaneDistance": 3, "cameraType": "", "followBaseLayerCamera": false, diff --git a/examples/starting-3d-grand-theft-auto/starting-3d-grand-theft-auto.json b/examples/starting-3d-grand-theft-auto/starting-3d-grand-theft-auto.json index 27b8dd02c..e0ccb43fe 100644 --- a/examples/starting-3d-grand-theft-auto/starting-3d-grand-theft-auto.json +++ b/examples/starting-3d-grand-theft-auto/starting-3d-grand-theft-auto.json @@ -1489,7 +1489,7 @@ "shapeDimensionB": 0, "shapeDimensionC": 0, "density": 10, - "friction": 2.75, + "friction": 0.69, "restitution": 0.1, "linearDamping": 4, "angularDamping": 5, @@ -1639,11 +1639,11 @@ "shapeDimensionB": 67, "shapeDimensionC": 35, "density": 1, - "friction": 10, - "restitution": 0.5, - "linearDamping": 0.1, - "angularDamping": 0.1, - "gravityScale": 3, + "friction": 0.2, + "restitution": 0.05, + "linearDamping": 0.02, + "angularDamping": 1, + "gravityScale": 2, "layers": 17, "masks": 17, "shapeOffsetX": 0, @@ -1651,7 +1651,7 @@ "shapeOffsetZ": 10, "massCenterOffsetX": 0, "massCenterOffsetY": 0, - "massCenterOffsetZ": -25, + "massCenterOffsetZ": -18, "massOverride": 1000 }, { @@ -1659,31 +1659,39 @@ "name": "PhysicsCar3D", "type": "Physics3D::PhysicsCar3D", "physics3D": "Physics3D", - "steerAngleMax": 70, - "beginningSteerSpeed": 140, - "endSteerSpeed": 10, + "steerAngleMax": 32, + "beginningSteerSpeed": 120, + "endSteerSpeed": 120, "mass": 1500, - "engineTorqueMax": 8000, + "engineTorqueMax": 500, "engineSpeedMax": 6000, - "engineInertia": 0.1, + "engineInertia": 0.3, "reverseGearRatio1": -2.17, "gearRatio1": 1.99, "gearRatio2": 1.33, "gearRatio3": 0.97, "gearRatio4": 0.75, - "gearRatio5": 0.55, + "gearRatio5": 0, "gearRatio6": 0, "backWheelOffsetX": 0, "frontWheelOffsetX": 0, "wheelOffsetY": 0, - "wheelOffsetZ": 9, + "wheelOffsetZ": 1.5, "wheelRadius": 6, "wheelWidth": 12, - "brakeTorqueMax": 3000, - "handBrakeTorqueMax": 6000, - "hasBackWheelDrive": false, + "brakeTorqueMax": 1000, + "handBrakeTorqueMax": 1500, + "hasBackWheelDrive": true, "hasFrontWheelDrive": true, - "pitchRollAngleMax": 89 + "pitchRollAngleMax": 45, + "corneringForceMax": 2.3, + "suspensionTravel": 12, + "suspensionFrequency": 2.2, + "steerReturnSpeed": 180, + "suspensionDamping": 0.6, + "gearSwitchDuration": 0.2, + "gearShiftUpEngineSpeed": 5200, + "gearShiftDownEngineSpeed": 2500 }, { "isFolded": true, @@ -1710,7 +1718,7 @@ "name": "ThirdPersonCamera", "type": "ThirdPersonCamera::ThirdPersonCamera", "Object3D": "Object3D", - "RotationHalfwayDuration": 0.125, + "RotationHalfwayDuration": 0.2, "TranslationZHalfwayDuration": 0.25, "Distance": 550, "LateralOffset": 0, @@ -1870,7 +1878,7 @@ "massCenterOffsetZ": 0, "massOverride": 0, "density": 1, - "friction": 0.3, + "friction": 1.2, "restitution": 0.1, "linearDamping": 0.1, "angularDamping": 0.1, diff --git a/examples/starting-3d-tank/starting-3d-tank.json b/examples/starting-3d-tank/starting-3d-tank.json index 4f2766be8..011b0544b 100644 --- a/examples/starting-3d-tank/starting-3d-tank.json +++ b/examples/starting-3d-tank/starting-3d-tank.json @@ -605,11 +605,11 @@ "shapeDimensionB": 65, "shapeDimensionC": 25, "density": 1, - "friction": 5, - "restitution": 0.2, - "linearDamping": 0.1, - "angularDamping": 0.1, - "gravityScale": 5, + "friction": 0.2, + "restitution": 0.05, + "linearDamping": 0.02, + "angularDamping": 1, + "gravityScale": 2, "layers": 17, "masks": 17, "shapeOffsetX": 0, @@ -617,7 +617,7 @@ "shapeOffsetZ": 0, "massCenterOffsetX": 0, "massCenterOffsetY": 0, - "massCenterOffsetZ": -25, + "massCenterOffsetZ": -24, "massOverride": 2000 }, { @@ -625,30 +625,38 @@ "type": "Physics3D::PhysicsCar3D", "physics3D": "Physics3D", "steerAngleMax": 60, - "beginningSteerSpeed": 140, - "endSteerSpeed": 10, + "beginningSteerSpeed": 120, + "endSteerSpeed": 120, "mass": 1500, - "engineTorqueMax": 6000, - "engineSpeedMax": 75, - "engineInertia": 0.05, - "reverseGearRatio1": -1, - "gearRatio1": 1, - "gearRatio2": 1, - "gearRatio3": 1, - "gearRatio4": 1, - "gearRatio5": 1, - "gearRatio6": 1, + "engineTorqueMax": 300, + "engineSpeedMax": 6000, + "engineInertia": 0.3, + "reverseGearRatio1": -4, + "gearRatio1": 4, + "gearRatio2": 0, + "gearRatio3": 0, + "gearRatio4": 0, + "gearRatio5": 0, + "gearRatio6": 0, "backWheelOffsetX": -2, "frontWheelOffsetX": -2, "wheelOffsetY": 5, - "wheelOffsetZ": 6, + "wheelOffsetZ": 1, "wheelRadius": 7, "wheelWidth": 20, "brakeTorqueMax": 3000, - "handBrakeTorqueMax": 6000, + "handBrakeTorqueMax": 4000, "hasBackWheelDrive": true, "hasFrontWheelDrive": true, - "pitchRollAngleMax": 89 + "pitchRollAngleMax": 45, + "corneringForceMax": 3, + "suspensionTravel": 7, + "suspensionFrequency": 2, + "steerReturnSpeed": 180, + "suspensionDamping": 0.6, + "gearSwitchDuration": 0.2, + "gearShiftUpEngineSpeed": 5200, + "gearShiftDownEngineSpeed": 2500 }, { "isFolded": true, @@ -723,7 +731,7 @@ "shapeDimensionB": 0, "shapeDimensionC": 0, "density": 1, - "friction": 7, + "friction": 2, "restitution": 0, "linearDamping": 0.1, "angularDamping": 0.1, @@ -1294,7 +1302,7 @@ "shapeDimensionB": 0, "shapeDimensionC": 0, "density": 1, - "friction": 7, + "friction": 0.2, "restitution": 0, "linearDamping": 0.1, "angularDamping": 0.1, @@ -1372,7 +1380,7 @@ "massCenterOffsetZ": 0, "massOverride": 0, "density": 1, - "friction": 7, + "friction": 2, "restitution": 0.1, "linearDamping": 0.1, "angularDamping": 0.1, @@ -1551,7 +1559,7 @@ "parameters": [ "PlayerTank", "PhysicsCar3D", - "Steer_Joystick.StickForceX()/3" + "Steer_Joystick.StickForceX()" ] } ] diff --git a/examples/starting-expanded-3d-car-racing/assets/Flat dark joystick border vertical.png b/examples/starting-expanded-3d-car-racing/assets/Flat dark joystick border vertical.png deleted file mode 100644 index ec315d4b6..000000000 Binary files a/examples/starting-expanded-3d-car-racing/assets/Flat dark joystick border vertical.png and /dev/null differ diff --git a/examples/starting-expanded-3d-car-racing/assets/StartingBrakePedal.png b/examples/starting-expanded-3d-car-racing/assets/StartingBrakePedal.png new file mode 100644 index 000000000..3906f9542 Binary files /dev/null and b/examples/starting-expanded-3d-car-racing/assets/StartingBrakePedal.png differ diff --git a/examples/starting-expanded-3d-car-racing/assets/StartingGasPedal.png b/examples/starting-expanded-3d-car-racing/assets/StartingGasPedal.png new file mode 100644 index 000000000..50ad4605c Binary files /dev/null and b/examples/starting-expanded-3d-car-racing/assets/StartingGasPedal.png differ diff --git a/examples/starting-expanded-3d-car-racing/starting-expanded-3d-car-racing.json b/examples/starting-expanded-3d-car-racing/starting-expanded-3d-car-racing.json index 51b454b14..580b0e351 100644 --- a/examples/starting-expanded-3d-car-racing/starting-expanded-3d-car-racing.json +++ b/examples/starting-expanded-3d-car-racing/starting-expanded-3d-car-racing.json @@ -190,14 +190,6 @@ "smoothed": true, "userAdded": false }, - { - "file": "assets/Flat dark joystick border vertical.png", - "kind": "image", - "metadata": "", - "name": "assets/Flat dark joystick border vertical.png", - "smoothed": true, - "userAdded": false - }, { "file": "assets/Flat dark joystick border horizontal.png", "kind": "image", @@ -353,6 +345,22 @@ "metadata": "", "name": "assets/Rock Large A.glb", "userAdded": true + }, + { + "file": "assets/StartingGasPedal.png", + "kind": "image", + "metadata": "", + "name": "assets/StartingGasPedal.png", + "smoothed": true, + "userAdded": false + }, + { + "file": "assets/StartingBrakePedal.png", + "kind": "image", + "metadata": "", + "name": "assets/StartingBrakePedal.png", + "smoothed": true, + "userAdded": false } ] }, @@ -395,31 +403,14 @@ "instances": [ { "angle": 0, - "customSize": false, - "height": 0, - "keepRatio": true, - "layer": "MobileControls", - "locked": true, - "name": "Speed_Joystick", - "persistentUuid": "98bcbea1-1b37-46a3-8686-ff716b1b1024", - "width": 0, - "x": 1072, - "y": 537, - "zOrder": 9, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] - }, - { - "angle": 0, - "customSize": false, - "height": 0, + "customSize": true, + "height": 120, "keepRatio": true, "layer": "MobileControls", "locked": true, "name": "Steer_Joystick", "persistentUuid": "6c0d6cbc-a8d1-4930-b2e4-a83ac76f2d7e", - "width": 0, + "width": 120, "x": 208, "y": 537, "zOrder": 10, @@ -1662,6 +1653,40 @@ "stringProperties": [], "initialVariables": [], "depth": 200 + }, + { + "angle": 0, + "customSize": true, + "height": 240, + "keepRatio": true, + "layer": "MobileControls", + "locked": true, + "name": "GasPedal", + "persistentUuid": "b934ea15-ceb1-4a2e-86a8-1554831eb30d", + "width": 160, + "x": 1080, + "y": 440, + "zOrder": 10, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "height": 170, + "keepRatio": true, + "layer": "MobileControls", + "locked": true, + "name": "BrakePedal", + "persistentUuid": "fbcbe090-5e97-4aa5-a377-1b537c118339", + "width": 160, + "x": 880, + "y": 510, + "zOrder": 10, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] } ], "objects": [ @@ -1700,11 +1725,11 @@ "shapeDimensionB": 39, "shapeDimensionC": 27, "density": 1, - "friction": 10, - "restitution": 0.5, - "linearDamping": 0.1, - "angularDamping": 0.1, - "gravityScale": 6, + "friction": 0.2, + "restitution": 0.05, + "linearDamping": 0.02, + "angularDamping": 1, + "gravityScale": 2, "layers": 17, "masks": 17, "shapeOffsetX": 0, @@ -1712,7 +1737,7 @@ "shapeOffsetZ": 6, "massCenterOffsetX": 0, "massCenterOffsetY": 0, - "massCenterOffsetZ": -25, + "massCenterOffsetZ": -16, "massOverride": 1500 }, { @@ -1720,31 +1745,39 @@ "name": "PhysicsCar3D", "type": "Physics3D::PhysicsCar3D", "physics3D": "Physics3D", - "steerAngleMax": 70, - "beginningSteerSpeed": 140, - "endSteerSpeed": 10, + "steerAngleMax": 32, + "beginningSteerSpeed": 120, + "endSteerSpeed": 120, "mass": 1500, - "engineTorqueMax": 8000, + "engineTorqueMax": 1500, "engineSpeedMax": 6000, - "engineInertia": 0.1, + "engineInertia": 0.3, "reverseGearRatio1": -2.9, "gearRatio1": 2.66, "gearRatio2": 1.78, "gearRatio3": 1.3, "gearRatio4": 1, - "gearRatio5": 0.74, + "gearRatio5": 0, "gearRatio6": 0, "backWheelOffsetX": -6, - "frontWheelOffsetX": 10, + "frontWheelOffsetX": -4, "wheelOffsetY": 3, - "wheelOffsetZ": 0, + "wheelOffsetZ": -4.5, "wheelRadius": 6, "wheelWidth": 3, - "brakeTorqueMax": 3000, - "handBrakeTorqueMax": 6000, - "hasBackWheelDrive": false, + "brakeTorqueMax": 2800, + "handBrakeTorqueMax": 4000, + "hasBackWheelDrive": true, "hasFrontWheelDrive": true, - "pitchRollAngleMax": 89 + "pitchRollAngleMax": 45, + "steerReturnSpeed": 180, + "corneringForceMax": 3, + "suspensionTravel": 6, + "suspensionFrequency": 2.2, + "suspensionDamping": 0.6, + "gearSwitchDuration": 0.2, + "gearShiftUpEngineSpeed": 5200, + "gearShiftDownEngineSpeed": 2500 }, { "isFolded": true, @@ -1770,9 +1803,9 @@ "name": "ThirdPersonCamera", "type": "ThirdPersonCamera::ThirdPersonCamera", "Object3D": "Object3D", - "RotationHalfwayDuration": 0.125, + "RotationHalfwayDuration": 0.2, "TranslationZHalfwayDuration": 0.25, - "Distance": 450, + "Distance": 260, "LateralOffset": 0, "AheadOffset": 200, "OffsetZ": 0, @@ -1786,7 +1819,7 @@ "CameraZ": 0, "LocalOffsetY": 200, "LocalOffsetX": 0, - "OffsetY": 200, + "OffsetY": 120, "ElevationHalfwayDuration": 1, "IsElevatingWithObject": false, "OffsetX": 0 @@ -1810,92 +1843,6 @@ "animations": [] } }, - { - "assetStoreId": "e71bd69f896d6c7531b48c65ceb5da25071d4fbdeb518aeceecba8d21f34ed8d", - "name": "Speed_Joystick", - "persistentUuid": "f0dcaf34-2fe1-4333-aef2-6bb1f660efb2", - "type": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", - "variant": "", - "variables": [], - "effects": [], - "behaviors": [], - "content": { - "DeadZoneRadius": 0.2, - "JoystickIdentifier": "Secondary" - }, - "childrenContent": { - "Border": { - "adaptCollisionMaskAutomatically": false, - "updateIfNotVisible": false, - "animations": [ - { - "name": "Idle", - "useMultipleDirections": false, - "directions": [ - { - "looping": false, - "timeBetweenFrames": 0.08, - "sprites": [ - { - "hasCustomCollisionMask": false, - "image": "assets/Flat dark joystick border vertical.png", - "points": [], - "originPoint": { - "name": "origine", - "x": 0, - "y": 0 - }, - "centerPoint": { - "automatic": true, - "name": "centre", - "x": 0, - "y": 0 - }, - "customCollisionMask": [] - } - ] - } - ] - } - ] - }, - "Thumb": { - "adaptCollisionMaskAutomatically": false, - "updateIfNotVisible": false, - "animations": [ - { - "name": "Idle", - "useMultipleDirections": false, - "directions": [ - { - "looping": false, - "timeBetweenFrames": 0.08, - "sprites": [ - { - "hasCustomCollisionMask": false, - "image": "assets\\Flat dark joystick thumb.png", - "points": [], - "originPoint": { - "name": "origine", - "x": 0, - "y": 0 - }, - "centerPoint": { - "automatic": true, - "name": "centre", - "x": 0, - "y": 0 - }, - "customCollisionMask": [] - } - ] - } - ] - } - ] - } - } - }, { "assetStoreId": "e71bd69f896d6c7531b48c65ceb5da25071d4fbdeb518aeceecba8d21f34ed8d", "name": "Steer_Joystick", @@ -1907,7 +1854,7 @@ "behaviors": [], "content": { "JoystickIdentifier": "Primary", - "DeadZoneRadius": 0.2 + "DeadZoneRadius": 0.1 }, "childrenContent": { "Border": { @@ -2198,7 +2145,7 @@ "massCenterOffsetZ": 0, "massOverride": 0, "density": 1, - "friction": 7, + "friction": 2, "restitution": 0, "linearDamping": 0.1, "angularDamping": 0.1, @@ -2872,6 +2819,108 @@ "TrunkCollisions": true, "TrunkDiameter": 110 } + }, + { + "adaptCollisionMaskAutomatically": true, + "name": "GasPedal", + "type": "Sprite", + "updateIfNotVisible": false, + "variables": [], + "effects": [], + "behaviors": [ + { + "name": "MultitouchButton", + "type": "SpriteMultitouchJoystick::MultitouchButton", + "ControllerIdentifier": 1, + "ButtonIdentifier": "Gas", + "TouchId": 0, + "TouchIndex": 0, + "IsReleased": false, + "Radius": 110 + } + ], + "animations": [ + { + "name": "", + "useMultipleDirections": false, + "directions": [ + { + "looping": false, + "timeBetweenFrames": 0.08, + "sprites": [ + { + "hasCustomCollisionMask": false, + "image": "assets/StartingGasPedal.png", + "points": [], + "originPoint": { + "name": "origine", + "x": 0, + "y": 0 + }, + "centerPoint": { + "automatic": true, + "name": "centre", + "x": 0, + "y": 0 + }, + "customCollisionMask": [] + } + ] + } + ] + } + ] + }, + { + "adaptCollisionMaskAutomatically": true, + "name": "BrakePedal", + "type": "Sprite", + "updateIfNotVisible": false, + "variables": [], + "effects": [], + "behaviors": [ + { + "name": "MultitouchButton", + "type": "SpriteMultitouchJoystick::MultitouchButton", + "ControllerIdentifier": 1, + "ButtonIdentifier": "Brake", + "TouchId": 0, + "TouchIndex": 0, + "IsReleased": false, + "Radius": 90 + } + ], + "animations": [ + { + "name": "", + "useMultipleDirections": false, + "directions": [ + { + "looping": false, + "timeBetweenFrames": 0.08, + "sprites": [ + { + "hasCustomCollisionMask": false, + "image": "assets/StartingBrakePedal.png", + "points": [], + "originPoint": { + "name": "origine", + "x": 0, + "y": 0 + }, + "centerPoint": { + "automatic": true, + "name": "centre", + "x": 0, + "y": 0 + }, + "customCollisionMask": [] + } + ] + } + ] + } + ] } ], "objectsFolderStructure": { @@ -2896,10 +2945,13 @@ "folderName": "Mobile Controls", "children": [ { - "objectName": "Speed_Joystick" + "objectName": "Steer_Joystick" }, { - "objectName": "Steer_Joystick" + "objectName": "GasPedal" + }, + { + "objectName": "BrakePedal" } ] }, @@ -3144,6 +3196,277 @@ ] } ] + }, + { + "colorB": 228, + "colorG": 176, + "colorR": 74, + "creationTime": 0, + "name": "Mobile controls", + "source": "", + "type": "BuiltinCommonInstructions::Group", + "parameters": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SceneJustBegins" + }, + "parameters": [ + "" + ] + }, + { + "type": { + "value": "SystemInfo::HasTouchScreen", + "inverted": true + }, + "parameters": [ + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "Delete" + }, + "parameters": [ + "Steer_Joystick", + "" + ] + }, + { + "type": { + "value": "Delete" + }, + "parameters": [ + "GasPedal", + "" + ] + }, + { + "type": { + "value": "Delete" + }, + "parameters": [ + "BrakePedal", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SystemInfo::HasTouchScreen" + }, + "parameters": [ + "" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SceneJustBegins" + }, + "parameters": [ + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "Hide" + }, + "parameters": [ + "Steer_Joystick" + ] + }, + { + "type": { + "value": "SpriteMultitouchJoystick::SpriteMultitouchJoystick::ActivateControl" + }, + "parameters": [ + "Steer_Joystick", + "", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::HasTouchStartedOnScreenSide" + }, + "parameters": [ + "", + "Steer_Joystick", + "\"Left\"", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::SpriteMultitouchJoystick::TeleportAndPress" + }, + "parameters": [ + "Steer_Joystick", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::MultitouchButton::IsPressed" + }, + "parameters": [ + "GasPedal", + "MultitouchButton", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "Physics3D::PhysicsCar3D::SimulateForwardKey" + }, + "parameters": [ + "PlayerCar", + "PhysicsCar3D" + ] + }, + { + "type": { + "value": "OpacityCapability::OpacityBehavior::SetValue" + }, + "parameters": [ + "GasPedal", + "Opacity", + "=", + "255" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::MultitouchButton::IsPressed", + "inverted": true + }, + "parameters": [ + "GasPedal", + "MultitouchButton", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "OpacityCapability::OpacityBehavior::SetValue" + }, + "parameters": [ + "GasPedal", + "Opacity", + "=", + "130" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::MultitouchButton::IsPressed" + }, + "parameters": [ + "BrakePedal", + "MultitouchButton", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "Physics3D::PhysicsCar3D::SimulateBackwardKey" + }, + "parameters": [ + "PlayerCar", + "PhysicsCar3D" + ] + }, + { + "type": { + "value": "OpacityCapability::OpacityBehavior::SetValue" + }, + "parameters": [ + "BrakePedal", + "Opacity", + "=", + "255" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::MultitouchButton::IsPressed", + "inverted": true + }, + "parameters": [ + "BrakePedal", + "MultitouchButton", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "OpacityCapability::OpacityBehavior::SetValue" + }, + "parameters": [ + "BrakePedal", + "Opacity", + "=", + "130" + ] + } + ] + } + ] + } + ] } ], "layers": [ @@ -3153,7 +3476,7 @@ "ambientLightColorR": 200, "camera2DPlaneMaxDrawingDistance": 5000, "camera3DFarPlaneDistance": 12000, - "camera3DFieldOfView": 45, + "camera3DFieldOfView": 60, "camera3DNearPlaneDistance": 3, "cameraType": "", "followBaseLayerCamera": false, diff --git a/examples/starting-expanded-3d-driving/assets/Flat dark joystick border vertical.png b/examples/starting-expanded-3d-driving/assets/Flat dark joystick border vertical.png deleted file mode 100644 index ec315d4b6..000000000 Binary files a/examples/starting-expanded-3d-driving/assets/Flat dark joystick border vertical.png and /dev/null differ diff --git a/examples/starting-expanded-3d-driving/assets/StartingBrakePedal.png b/examples/starting-expanded-3d-driving/assets/StartingBrakePedal.png new file mode 100644 index 000000000..3906f9542 Binary files /dev/null and b/examples/starting-expanded-3d-driving/assets/StartingBrakePedal.png differ diff --git a/examples/starting-expanded-3d-driving/assets/StartingGasPedal.png b/examples/starting-expanded-3d-driving/assets/StartingGasPedal.png new file mode 100644 index 000000000..50ad4605c Binary files /dev/null and b/examples/starting-expanded-3d-driving/assets/StartingGasPedal.png differ diff --git a/examples/starting-expanded-3d-driving/starting-expanded-3d-driving.json b/examples/starting-expanded-3d-driving/starting-expanded-3d-driving.json index 4a994910c..108d62305 100644 --- a/examples/starting-expanded-3d-driving/starting-expanded-3d-driving.json +++ b/examples/starting-expanded-3d-driving/starting-expanded-3d-driving.json @@ -175,14 +175,6 @@ "smoothed": true, "userAdded": false }, - { - "file": "assets/Flat dark joystick border vertical.png", - "kind": "image", - "metadata": "", - "name": "assets/Flat dark joystick border vertical.png", - "smoothed": true, - "userAdded": false - }, { "file": "assets/Flat dark joystick border horizontal.png", "kind": "image", @@ -324,6 +316,22 @@ "metadata": "", "name": "assets/Rock Large A.glb", "userAdded": true + }, + { + "file": "assets/StartingGasPedal.png", + "kind": "image", + "metadata": "", + "name": "assets/StartingGasPedal.png", + "smoothed": true, + "userAdded": false + }, + { + "file": "assets/StartingBrakePedal.png", + "kind": "image", + "metadata": "", + "name": "assets/StartingBrakePedal.png", + "smoothed": true, + "userAdded": false } ] }, @@ -366,31 +374,14 @@ "instances": [ { "angle": 0, - "customSize": false, - "height": 0, - "keepRatio": true, - "layer": "MobileControls", - "locked": true, - "name": "Speed_Joystick", - "persistentUuid": "98bcbea1-1b37-46a3-8686-ff716b1b1024", - "width": 0, - "x": 1072, - "y": 537, - "zOrder": 9, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] - }, - { - "angle": 0, - "customSize": false, - "height": 0, + "customSize": true, + "height": 120, "keepRatio": true, "layer": "MobileControls", "locked": true, "name": "Steer_Joystick", "persistentUuid": "6c0d6cbc-a8d1-4930-b2e4-a83ac76f2d7e", - "width": 0, + "width": 120, "x": 208, "y": 537, "zOrder": 10, @@ -1329,6 +1320,40 @@ "stringProperties": [], "initialVariables": [], "depth": 200 + }, + { + "angle": 0, + "customSize": true, + "height": 240, + "keepRatio": true, + "layer": "MobileControls", + "locked": true, + "name": "GasPedal", + "persistentUuid": "727cb62a-236d-48ca-b9bd-c363972440dd", + "width": 160, + "x": 1080, + "y": 440, + "zOrder": 10, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "height": 170, + "keepRatio": true, + "layer": "MobileControls", + "locked": true, + "name": "BrakePedal", + "persistentUuid": "60dbe3fc-4682-4513-b81b-c533f85a5887", + "width": 160, + "x": 880, + "y": 510, + "zOrder": 10, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] } ], "objects": [ @@ -1353,7 +1378,7 @@ "shapeDimensionB": 0, "shapeDimensionC": 0, "density": 1, - "friction": 7, + "friction": 2, "restitution": 0, "linearDamping": 0.1, "angularDamping": 0.1, @@ -1422,11 +1447,11 @@ "shapeDimensionB": 39, "shapeDimensionC": 27, "density": 1, - "friction": 10, - "restitution": 0.5, - "linearDamping": 0.1, - "angularDamping": 0.1, - "gravityScale": 6, + "friction": 0.2, + "restitution": 0.05, + "linearDamping": 0.02, + "angularDamping": 1, + "gravityScale": 2, "layers": 17, "masks": 17, "shapeOffsetX": 0, @@ -1434,38 +1459,46 @@ "shapeOffsetZ": 6, "massCenterOffsetX": 0, "massCenterOffsetY": 0, - "massCenterOffsetZ": -25, + "massCenterOffsetZ": -16, "massOverride": 1500 }, { "name": "PhysicsCar3D", "type": "Physics3D::PhysicsCar3D", "physics3D": "Physics3D", - "steerAngleMax": 70, - "beginningSteerSpeed": 140, - "endSteerSpeed": 10, + "steerAngleMax": 32, + "beginningSteerSpeed": 120, + "endSteerSpeed": 120, "mass": 1500, - "engineTorqueMax": 8000, + "engineTorqueMax": 1500, "engineSpeedMax": 6000, - "engineInertia": 0.1, + "engineInertia": 0.3, "reverseGearRatio1": -2.9, "gearRatio1": 2.66, "gearRatio2": 1.78, "gearRatio3": 1.3, "gearRatio4": 1, - "gearRatio5": 0.74, + "gearRatio5": 0, "gearRatio6": 0, "backWheelOffsetX": -6, - "frontWheelOffsetX": 10, + "frontWheelOffsetX": -4, "wheelOffsetY": 3, - "wheelOffsetZ": 0, + "wheelOffsetZ": -4.5, "wheelRadius": 6, "wheelWidth": 3, - "brakeTorqueMax": 3000, - "handBrakeTorqueMax": 6000, - "hasBackWheelDrive": false, + "brakeTorqueMax": 2800, + "handBrakeTorqueMax": 4000, + "hasBackWheelDrive": true, "hasFrontWheelDrive": true, - "pitchRollAngleMax": 89 + "pitchRollAngleMax": 45, + "steerReturnSpeed": 180, + "corneringForceMax": 3, + "suspensionTravel": 6, + "suspensionFrequency": 2.2, + "suspensionDamping": 0.6, + "gearSwitchDuration": 0.2, + "gearShiftUpEngineSpeed": 5200, + "gearShiftDownEngineSpeed": 2500 }, { "name": "PhysicsCar3DKeyboardMapper", @@ -1490,9 +1523,9 @@ "name": "ThirdPersonCamera", "type": "ThirdPersonCamera::ThirdPersonCamera", "Object3D": "Object3D", - "RotationHalfwayDuration": 0.125, + "RotationHalfwayDuration": 0.2, "TranslationZHalfwayDuration": 0.25, - "Distance": 450, + "Distance": 260, "LateralOffset": 0, "AheadOffset": 200, "OffsetZ": 0, @@ -1506,7 +1539,7 @@ "CameraZ": 0, "LocalOffsetY": 200, "LocalOffsetX": 0, - "OffsetY": 200, + "OffsetY": 120, "ElevationHalfwayDuration": 1, "IsElevatingWithObject": false } @@ -1529,92 +1562,6 @@ "animations": [] } }, - { - "assetStoreId": "e71bd69f896d6c7531b48c65ceb5da25071d4fbdeb518aeceecba8d21f34ed8d", - "name": "Speed_Joystick", - "persistentUuid": "9cec9083-d43d-4a9d-9017-7f44615dc54b", - "type": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", - "variant": "", - "variables": [], - "effects": [], - "behaviors": [], - "content": { - "DeadZoneRadius": 0.2, - "JoystickIdentifier": "Secondary" - }, - "childrenContent": { - "Border": { - "adaptCollisionMaskAutomatically": false, - "updateIfNotVisible": false, - "animations": [ - { - "name": "Idle", - "useMultipleDirections": false, - "directions": [ - { - "looping": false, - "timeBetweenFrames": 0.08, - "sprites": [ - { - "hasCustomCollisionMask": false, - "image": "assets/Flat dark joystick border vertical.png", - "points": [], - "originPoint": { - "name": "origine", - "x": 0, - "y": 0 - }, - "centerPoint": { - "automatic": true, - "name": "centre", - "x": 0, - "y": 0 - }, - "customCollisionMask": [] - } - ] - } - ] - } - ] - }, - "Thumb": { - "adaptCollisionMaskAutomatically": false, - "updateIfNotVisible": false, - "animations": [ - { - "name": "Idle", - "useMultipleDirections": false, - "directions": [ - { - "looping": false, - "timeBetweenFrames": 0.08, - "sprites": [ - { - "hasCustomCollisionMask": false, - "image": "assets\\Flat dark joystick thumb.png", - "points": [], - "originPoint": { - "name": "origine", - "x": 0, - "y": 0 - }, - "centerPoint": { - "automatic": true, - "name": "centre", - "x": 0, - "y": 0 - }, - "customCollisionMask": [] - } - ] - } - ] - } - ] - } - } - }, { "assetStoreId": "e71bd69f896d6c7531b48c65ceb5da25071d4fbdeb518aeceecba8d21f34ed8d", "name": "Steer_Joystick", @@ -1626,7 +1573,7 @@ "behaviors": [], "content": { "JoystickIdentifier": "Primary", - "DeadZoneRadius": 0.2 + "DeadZoneRadius": 0.1 }, "childrenContent": { "Border": { @@ -1783,7 +1730,7 @@ "massCenterOffsetZ": 0, "massOverride": 0, "density": 1, - "friction": 7, + "friction": 2, "restitution": 0, "linearDamping": 0.1, "angularDamping": 0.1, @@ -2432,6 +2379,108 @@ "TrunkCollisions": true, "TrunkDiameter": 110 } + }, + { + "adaptCollisionMaskAutomatically": true, + "name": "GasPedal", + "type": "Sprite", + "updateIfNotVisible": false, + "variables": [], + "effects": [], + "behaviors": [ + { + "name": "MultitouchButton", + "type": "SpriteMultitouchJoystick::MultitouchButton", + "ControllerIdentifier": 1, + "ButtonIdentifier": "Gas", + "TouchId": 0, + "TouchIndex": 0, + "IsReleased": false, + "Radius": 110 + } + ], + "animations": [ + { + "name": "", + "useMultipleDirections": false, + "directions": [ + { + "looping": false, + "timeBetweenFrames": 0.08, + "sprites": [ + { + "hasCustomCollisionMask": false, + "image": "assets/StartingGasPedal.png", + "points": [], + "originPoint": { + "name": "origine", + "x": 0, + "y": 0 + }, + "centerPoint": { + "automatic": true, + "name": "centre", + "x": 0, + "y": 0 + }, + "customCollisionMask": [] + } + ] + } + ] + } + ] + }, + { + "adaptCollisionMaskAutomatically": true, + "name": "BrakePedal", + "type": "Sprite", + "updateIfNotVisible": false, + "variables": [], + "effects": [], + "behaviors": [ + { + "name": "MultitouchButton", + "type": "SpriteMultitouchJoystick::MultitouchButton", + "ControllerIdentifier": 1, + "ButtonIdentifier": "Brake", + "TouchId": 0, + "TouchIndex": 0, + "IsReleased": false, + "Radius": 90 + } + ], + "animations": [ + { + "name": "", + "useMultipleDirections": false, + "directions": [ + { + "looping": false, + "timeBetweenFrames": 0.08, + "sprites": [ + { + "hasCustomCollisionMask": false, + "image": "assets/StartingBrakePedal.png", + "points": [], + "originPoint": { + "name": "origine", + "x": 0, + "y": 0 + }, + "centerPoint": { + "automatic": true, + "name": "centre", + "x": 0, + "y": 0 + }, + "customCollisionMask": [] + } + ] + } + ] + } + ] } ], "objectsFolderStructure": { @@ -2450,10 +2499,13 @@ "folderName": "Mobile Controls", "children": [ { - "objectName": "Speed_Joystick" + "objectName": "Steer_Joystick" }, { - "objectName": "Steer_Joystick" + "objectName": "GasPedal" + }, + { + "objectName": "BrakePedal" } ] }, @@ -2513,7 +2565,279 @@ } ] }, - "events": [], + "events": [ + { + "colorB": 228, + "colorG": 176, + "colorR": 74, + "creationTime": 0, + "name": "Mobile controls", + "source": "", + "type": "BuiltinCommonInstructions::Group", + "parameters": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SceneJustBegins" + }, + "parameters": [ + "" + ] + }, + { + "type": { + "value": "SystemInfo::HasTouchScreen", + "inverted": true + }, + "parameters": [ + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "Delete" + }, + "parameters": [ + "Steer_Joystick", + "" + ] + }, + { + "type": { + "value": "Delete" + }, + "parameters": [ + "GasPedal", + "" + ] + }, + { + "type": { + "value": "Delete" + }, + "parameters": [ + "BrakePedal", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SystemInfo::HasTouchScreen" + }, + "parameters": [ + "" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SceneJustBegins" + }, + "parameters": [ + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "Hide" + }, + "parameters": [ + "Steer_Joystick" + ] + }, + { + "type": { + "value": "SpriteMultitouchJoystick::SpriteMultitouchJoystick::ActivateControl" + }, + "parameters": [ + "Steer_Joystick", + "", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::HasTouchStartedOnScreenSide" + }, + "parameters": [ + "", + "Steer_Joystick", + "\"Left\"", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::SpriteMultitouchJoystick::TeleportAndPress" + }, + "parameters": [ + "Steer_Joystick", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::MultitouchButton::IsPressed" + }, + "parameters": [ + "GasPedal", + "MultitouchButton", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "Physics3D::PhysicsCar3D::SimulateForwardKey" + }, + "parameters": [ + "PlayerCar", + "PhysicsCar3D" + ] + }, + { + "type": { + "value": "OpacityCapability::OpacityBehavior::SetValue" + }, + "parameters": [ + "GasPedal", + "Opacity", + "=", + "255" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::MultitouchButton::IsPressed", + "inverted": true + }, + "parameters": [ + "GasPedal", + "MultitouchButton", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "OpacityCapability::OpacityBehavior::SetValue" + }, + "parameters": [ + "GasPedal", + "Opacity", + "=", + "130" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::MultitouchButton::IsPressed" + }, + "parameters": [ + "BrakePedal", + "MultitouchButton", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "Physics3D::PhysicsCar3D::SimulateBackwardKey" + }, + "parameters": [ + "PlayerCar", + "PhysicsCar3D" + ] + }, + { + "type": { + "value": "OpacityCapability::OpacityBehavior::SetValue" + }, + "parameters": [ + "BrakePedal", + "Opacity", + "=", + "255" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::MultitouchButton::IsPressed", + "inverted": true + }, + "parameters": [ + "BrakePedal", + "MultitouchButton", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "OpacityCapability::OpacityBehavior::SetValue" + }, + "parameters": [ + "BrakePedal", + "Opacity", + "=", + "130" + ] + } + ] + } + ] + } + ] + } + ], "layers": [ { "ambientLightColorB": 200, @@ -2521,7 +2845,7 @@ "ambientLightColorR": 200, "camera2DPlaneMaxDrawingDistance": 5000, "camera3DFarPlaneDistance": 12000, - "camera3DFieldOfView": 45, + "camera3DFieldOfView": 60, "camera3DNearPlaneDistance": 3, "cameraType": "", "followBaseLayerCamera": false, diff --git a/examples/starting-expanded-3d-grand-theft-auto/starting-expanded-3d-grand-theft-auto.json b/examples/starting-expanded-3d-grand-theft-auto/starting-expanded-3d-grand-theft-auto.json index f20c1c91b..d824dfda0 100644 --- a/examples/starting-expanded-3d-grand-theft-auto/starting-expanded-3d-grand-theft-auto.json +++ b/examples/starting-expanded-3d-grand-theft-auto/starting-expanded-3d-grand-theft-auto.json @@ -2992,7 +2992,7 @@ "shapeDimensionB": 0, "shapeDimensionC": 0, "density": 10, - "friction": 2.75, + "friction": 0.69, "restitution": 0.1, "linearDamping": 4, "angularDamping": 5, @@ -3073,11 +3073,11 @@ "shapeDimensionB": 67, "shapeDimensionC": 35, "density": 1, - "friction": 10, - "restitution": 0.5, - "linearDamping": 0.1, - "angularDamping": 0.1, - "gravityScale": 3, + "friction": 0.2, + "restitution": 0.05, + "linearDamping": 0.02, + "angularDamping": 1, + "gravityScale": 2, "layers": 17, "masks": 17, "shapeOffsetX": 0, @@ -3085,7 +3085,7 @@ "shapeOffsetZ": 10, "massCenterOffsetX": 0, "massCenterOffsetY": 0, - "massCenterOffsetZ": -25, + "massCenterOffsetZ": -18, "massOverride": 1000 }, { @@ -3093,31 +3093,39 @@ "name": "PhysicsCar3D", "type": "Physics3D::PhysicsCar3D", "physics3D": "Physics3D", - "steerAngleMax": 70, - "beginningSteerSpeed": 140, - "endSteerSpeed": 10, + "steerAngleMax": 32, + "beginningSteerSpeed": 120, + "endSteerSpeed": 120, "mass": 1500, - "engineTorqueMax": 8000, + "engineTorqueMax": 500, "engineSpeedMax": 6000, - "engineInertia": 0.1, + "engineInertia": 0.3, "reverseGearRatio1": -2.17, "gearRatio1": 1.99, "gearRatio2": 1.33, "gearRatio3": 0.97, "gearRatio4": 0.75, - "gearRatio5": 0.55, + "gearRatio5": 0, "gearRatio6": 0, "backWheelOffsetX": 0, "frontWheelOffsetX": 0, "wheelOffsetY": 0, - "wheelOffsetZ": 9, + "wheelOffsetZ": 1.5, "wheelRadius": 6, "wheelWidth": 12, - "brakeTorqueMax": 3000, - "handBrakeTorqueMax": 6000, - "hasBackWheelDrive": false, + "brakeTorqueMax": 1000, + "handBrakeTorqueMax": 1500, + "hasBackWheelDrive": true, "hasFrontWheelDrive": true, - "pitchRollAngleMax": 89 + "pitchRollAngleMax": 45, + "corneringForceMax": 2.3, + "suspensionTravel": 12, + "suspensionFrequency": 2.2, + "steerReturnSpeed": 180, + "suspensionDamping": 0.6, + "gearSwitchDuration": 0.2, + "gearShiftUpEngineSpeed": 5200, + "gearShiftDownEngineSpeed": 2500 }, { "isFolded": true, @@ -3144,7 +3152,7 @@ "name": "ThirdPersonCamera", "type": "ThirdPersonCamera::ThirdPersonCamera", "Object3D": "Object3D", - "RotationHalfwayDuration": 0.125, + "RotationHalfwayDuration": 0.2, "TranslationZHalfwayDuration": 0.25, "Distance": 550, "LateralOffset": 0, @@ -3302,7 +3310,7 @@ "massCenterOffsetZ": 0, "massOverride": 0, "density": 1, - "friction": 0.3, + "friction": 1.2, "restitution": 0.1, "linearDamping": 0.1, "angularDamping": 0.1, diff --git a/examples/starting-expanded-3d-tank/starting-expanded-3d-tank.json b/examples/starting-expanded-3d-tank/starting-expanded-3d-tank.json index 43bb77c61..1da8f150b 100644 --- a/examples/starting-expanded-3d-tank/starting-expanded-3d-tank.json +++ b/examples/starting-expanded-3d-tank/starting-expanded-3d-tank.json @@ -1424,11 +1424,11 @@ "shapeDimensionB": 65, "shapeDimensionC": 25, "density": 1, - "friction": 10, - "restitution": 0.2, - "linearDamping": 0.1, - "angularDamping": 0.1, - "gravityScale": 5, + "friction": 0.2, + "restitution": 0.05, + "linearDamping": 0.02, + "angularDamping": 1, + "gravityScale": 2, "layers": 17, "masks": 17, "shapeOffsetX": 0, @@ -1436,7 +1436,7 @@ "shapeOffsetZ": 0, "massCenterOffsetX": 0, "massCenterOffsetY": 0, - "massCenterOffsetZ": -25, + "massCenterOffsetZ": -24, "massOverride": 2000 }, { @@ -1444,30 +1444,38 @@ "type": "Physics3D::PhysicsCar3D", "physics3D": "Physics3D", "steerAngleMax": 60, - "beginningSteerSpeed": 140, - "endSteerSpeed": 10, + "beginningSteerSpeed": 120, + "endSteerSpeed": 120, "mass": 1500, - "engineTorqueMax": 6000, - "engineSpeedMax": 75, - "engineInertia": 0.05, - "reverseGearRatio1": -1, - "gearRatio1": 1, - "gearRatio2": 1, - "gearRatio3": 1, - "gearRatio4": 1, - "gearRatio5": 1, - "gearRatio6": 1, + "engineTorqueMax": 300, + "engineSpeedMax": 6000, + "engineInertia": 0.3, + "reverseGearRatio1": -4, + "gearRatio1": 4, + "gearRatio2": 0, + "gearRatio3": 0, + "gearRatio4": 0, + "gearRatio5": 0, + "gearRatio6": 0, "backWheelOffsetX": -2, "frontWheelOffsetX": -2, "wheelOffsetY": 5, - "wheelOffsetZ": 6, + "wheelOffsetZ": 1, "wheelRadius": 7, "wheelWidth": 20, "brakeTorqueMax": 3000, - "handBrakeTorqueMax": 6000, + "handBrakeTorqueMax": 4000, "hasBackWheelDrive": true, "hasFrontWheelDrive": true, - "pitchRollAngleMax": 89 + "pitchRollAngleMax": 45, + "corneringForceMax": 3, + "suspensionTravel": 7, + "suspensionFrequency": 2, + "steerReturnSpeed": 180, + "suspensionDamping": 0.6, + "gearSwitchDuration": 0.2, + "gearShiftUpEngineSpeed": 5200, + "gearShiftDownEngineSpeed": 2500 }, { "isFolded": true, @@ -2048,7 +2056,7 @@ "massCenterOffsetZ": 0, "massOverride": 0, "density": 1, - "friction": 7, + "friction": 2, "restitution": 0, "linearDamping": 0.1, "angularDamping": 0.1, @@ -2788,7 +2796,7 @@ "parameters": [ "PlayerTank", "PhysicsCar3D", - "Steer_Joystick.StickForceX()/3" + "Steer_Joystick.StickForceX()" ] } ]