Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
122 changes: 82 additions & 40 deletions examples/3d-endless-terrain/3d-endless-terrain.json
Original file line number Diff line number Diff line change
Expand Up @@ -8498,8 +8498,8 @@
"iconUrl": "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4NCjwhLS0gR2VuZXJhdG9yOiBBZG9iZSBJbGx1c3RyYXRvciAyMy4wLjMsIFNWRyBFeHBvcnQgUGx1Zy1JbiAuIFNWRyBWZXJzaW9uOiA2LjAwIEJ1aWxkIDApICAtLT4NCjxzdmcgdmVyc2lvbj0iMS4xIiBpZD0iSWNvbnMiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4Ig0KCSB2aWV3Qm94PSIwIDAgMzIgMzIiIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDMyIDMyOyIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+DQo8c3R5bGUgdHlwZT0idGV4dC9jc3MiPg0KCS5zdDB7ZmlsbDpub25lO3N0cm9rZTojMDAwMDAwO3N0cm9rZS13aWR0aDoyO3N0cm9rZS1saW5lY2FwOnJvdW5kO3N0cm9rZS1saW5lam9pbjpyb3VuZDtzdHJva2UtbWl0ZXJsaW1pdDoxMDt9DQo8L3N0eWxlPg0KPHBvbHlsaW5lIGNsYXNzPSJzdDAiIHBvaW50cz0iMTksMTkgMjQsMTkgMjQsMjQgIi8+DQo8cG9seWxpbmUgY2xhc3M9InN0MCIgcG9pbnRzPSI2LDIzIDExLDIzIDExLDE4ICIvPg0KPHBhdGggY2xhc3M9InN0MCIgZD0iTTI0LDE5LjRjLTAuNywwLjgtMS40LDEuNi0yLjIsMi40Yy03LDctMTUuMywxMC4yLTE4LjUsN3MtMC4xLTExLjUsNy0xOC41czE1LjMtMTAuMiwxOC41LTcNCgljMS40LDEuNCwxLjYsMy42LDAuOCw2LjMiLz4NCjxwYXRoIGNsYXNzPSJzdDAiIGQ9Ik0xMSwyMi41Yy0wLjMtMC4yLTAuNS0wLjUtMC44LTAuOGMtNy03LTEwLjItMTUuMy03LTE4LjVzMTEuNS0wLjEsMTguNSw3czEwLjIsMTUuMyw3LDE4LjUNCgljLTEuNywxLjctNC44LDEuNi04LjQsMC4xIi8+DQo8L3N2Zz4NCg==",
"name": "MousePointerLock",
"previewIconUrl": "https://resources.gdevelop-app.com/assets/Icons/Line Hero Pack/Master/SVG/Virtual Reality/Virtual Reality_360_rotate_vr_movement.svg",
"shortDescription": "This behavior removes the limit on the distance the mouse can move and hides the cursor.",
"version": "0.3.0",
"shortDescription": "Lock and hide mouse pointer for unlimited movement (e.g., FPS mouse look).",
"version": "0.3.2",
"description": [
"This behavior removes the limit on the distance the mouse can move and hides the cursor.",
"",
Expand Down Expand Up @@ -8547,7 +8547,7 @@
{
"name": "TouchSpeedFactor",
"type": "number",
"value": 4
"value": 2
}
],
"eventsFunctions": [
Expand Down Expand Up @@ -8795,16 +8795,46 @@
]
},
{
"type": "BuiltinCommonInstructions::JsCode",
"inlineCode": [
"const { handler } = gdjs._MousePointerLockExtension;\r",
"\r",
"handler.requestPointerLock();\r",
""
"type": "BuiltinCommonInstructions::Comment",
"color": {
"b": 109,
"g": 230,
"r": 255,
"textB": 0,
"textG": 0,
"textR": 0
},
"comment": "Fingers are followed instead of locking the pointer, because mobile browsers give tiny pointer movements."
},
{
"type": "BuiltinCommonInstructions::Standard",
"conditions": [
{
"type": {
"value": "NumberVariable"
},
"parameters": [
"TouchId",
"<",
"2"
]
}
],
"parameterObjects": "",
"useStrict": true,
"eventsSheetExpanded": false
"actions": [],
"events": [
{
"type": "BuiltinCommonInstructions::JsCode",
"inlineCode": [
"const { handler } = gdjs._MousePointerLockExtension;\r",
"\r",
"handler.requestPointerLock();\r",
""
],
"parameterObjects": "",
"useStrict": true,
"eventsSheetExpanded": false
}
]
}
],
"parameters": [],
Expand Down Expand Up @@ -8951,7 +8981,7 @@
"functionType": "Condition",
"name": "isEmulatingPointerLock",
"private": true,
"sentence": "The mouse pointer is lock is emulated",
"sentence": "The mouse pointer lock is emulated",
"events": [
{
"type": "BuiltinCommonInstructions::Standard",
Expand Down Expand Up @@ -8987,6 +9017,31 @@
]
}
]
},
{
"type": "BuiltinCommonInstructions::Standard",
"conditions": [
{
"type": {
"value": "NumberVariable"
},
"parameters": [
"TouchId",
">=",
"2"
]
}
],
"actions": [
{
"type": {
"value": "SetReturnBoolean"
},
"parameters": [
"True"
]
}
]
}
],
"parameters": [],
Expand Down Expand Up @@ -9293,6 +9348,18 @@
},
"comment": "TODO It's probably a bad idea to rotate the object around Y."
},
{
"type": "BuiltinCommonInstructions::Comment",
"color": {
"b": 109,
"g": 230,
"r": 255,
"textB": 0,
"textG": 0,
"textR": 0
},
"comment": "Both rotations are relative to the screen height because the field of view is vertical. This way, the speed doesn't change with the screen ratio."
},
{
"type": "BuiltinCommonInstructions::Standard",
"conditions": [
Expand All @@ -9314,7 +9381,7 @@
"parameters": [
"Object",
"+",
"MousePointerLock::MovementX() * HorizontalSpeed / SceneWindowWidth()"
"MousePointerLock::MovementX() * HorizontalSpeed / (SceneWindowHeight() * 16 / 9)"
]
},
{
Expand Down Expand Up @@ -9957,32 +10024,7 @@
"name": "ShouldLock"
}
],
"propertiesFolderStructure": {
"folderName": "__ROOT",
"children": [
{
"propertyName": "Object3D"
},
{
"propertyName": "HorizontalSpeed"
},
{
"propertyName": "VerticalSpeed"
},
{
"propertyName": "VerticalAngleMin"
},
{
"propertyName": "VerticalAngleMax"
},
{
"propertyName": "OffsetZ"
},
{
"propertyName": "ShouldLock"
}
]
}
"sharedPropertyDescriptors": []
}
],
"eventsBasedObjects": []
Expand Down
122 changes: 82 additions & 40 deletions examples/3d-first-person/3d-first-person.json
Original file line number Diff line number Diff line change
Expand Up @@ -3356,8 +3356,8 @@
"iconUrl": "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4NCjwhLS0gR2VuZXJhdG9yOiBBZG9iZSBJbGx1c3RyYXRvciAyMy4wLjMsIFNWRyBFeHBvcnQgUGx1Zy1JbiAuIFNWRyBWZXJzaW9uOiA2LjAwIEJ1aWxkIDApICAtLT4NCjxzdmcgdmVyc2lvbj0iMS4xIiBpZD0iSWNvbnMiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4Ig0KCSB2aWV3Qm94PSIwIDAgMzIgMzIiIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDMyIDMyOyIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+DQo8c3R5bGUgdHlwZT0idGV4dC9jc3MiPg0KCS5zdDB7ZmlsbDpub25lO3N0cm9rZTojMDAwMDAwO3N0cm9rZS13aWR0aDoyO3N0cm9rZS1saW5lY2FwOnJvdW5kO3N0cm9rZS1saW5lam9pbjpyb3VuZDtzdHJva2UtbWl0ZXJsaW1pdDoxMDt9DQo8L3N0eWxlPg0KPHBvbHlsaW5lIGNsYXNzPSJzdDAiIHBvaW50cz0iMTksMTkgMjQsMTkgMjQsMjQgIi8+DQo8cG9seWxpbmUgY2xhc3M9InN0MCIgcG9pbnRzPSI2LDIzIDExLDIzIDExLDE4ICIvPg0KPHBhdGggY2xhc3M9InN0MCIgZD0iTTI0LDE5LjRjLTAuNywwLjgtMS40LDEuNi0yLjIsMi40Yy03LDctMTUuMywxMC4yLTE4LjUsN3MtMC4xLTExLjUsNy0xOC41czE1LjMtMTAuMiwxOC41LTcNCgljMS40LDEuNCwxLjYsMy42LDAuOCw2LjMiLz4NCjxwYXRoIGNsYXNzPSJzdDAiIGQ9Ik0xMSwyMi41Yy0wLjMtMC4yLTAuNS0wLjUtMC44LTAuOGMtNy03LTEwLjItMTUuMy03LTE4LjVzMTEuNS0wLjEsMTguNSw3czEwLjIsMTUuMyw3LDE4LjUNCgljLTEuNywxLjctNC44LDEuNi04LjQsMC4xIi8+DQo8L3N2Zz4NCg==",
"name": "MousePointerLock",
"previewIconUrl": "https://resources.gdevelop-app.com/assets/Icons/Line Hero Pack/Master/SVG/Virtual Reality/Virtual Reality_360_rotate_vr_movement.svg",
"shortDescription": "This behavior removes the limit on the distance the mouse can move and hides the cursor.",
"version": "0.3.0",
"shortDescription": "Lock and hide mouse pointer for unlimited movement (e.g., FPS mouse look).",
"version": "0.3.2",
"description": [
"This behavior removes the limit on the distance the mouse can move and hides the cursor.",
"",
Expand Down Expand Up @@ -3405,7 +3405,7 @@
{
"name": "TouchSpeedFactor",
"type": "number",
"value": 4
"value": 2
}
],
"eventsFunctions": [
Expand Down Expand Up @@ -3653,16 +3653,46 @@
]
},
{
"type": "BuiltinCommonInstructions::JsCode",
"inlineCode": [
"const { handler } = gdjs._MousePointerLockExtension;\r",
"\r",
"handler.requestPointerLock();\r",
""
"type": "BuiltinCommonInstructions::Comment",
"color": {
"b": 109,
"g": 230,
"r": 255,
"textB": 0,
"textG": 0,
"textR": 0
},
"comment": "Fingers are followed instead of locking the pointer, because mobile browsers give tiny pointer movements."
},
{
"type": "BuiltinCommonInstructions::Standard",
"conditions": [
{
"type": {
"value": "NumberVariable"
},
"parameters": [
"TouchId",
"<",
"2"
]
}
],
"parameterObjects": "",
"useStrict": true,
"eventsSheetExpanded": false
"actions": [],
"events": [
{
"type": "BuiltinCommonInstructions::JsCode",
"inlineCode": [
"const { handler } = gdjs._MousePointerLockExtension;\r",
"\r",
"handler.requestPointerLock();\r",
""
],
"parameterObjects": "",
"useStrict": true,
"eventsSheetExpanded": false
}
]
}
],
"parameters": [],
Expand Down Expand Up @@ -3809,7 +3839,7 @@
"functionType": "Condition",
"name": "isEmulatingPointerLock",
"private": true,
"sentence": "The mouse pointer is lock is emulated",
"sentence": "The mouse pointer lock is emulated",
"events": [
{
"type": "BuiltinCommonInstructions::Standard",
Expand Down Expand Up @@ -3845,6 +3875,31 @@
]
}
]
},
{
"type": "BuiltinCommonInstructions::Standard",
"conditions": [
{
"type": {
"value": "NumberVariable"
},
"parameters": [
"TouchId",
">=",
"2"
]
}
],
"actions": [
{
"type": {
"value": "SetReturnBoolean"
},
"parameters": [
"True"
]
}
]
}
],
"parameters": [],
Expand Down Expand Up @@ -4151,6 +4206,18 @@
},
"comment": "TODO It's probably a bad idea to rotate the object around Y."
},
{
"type": "BuiltinCommonInstructions::Comment",
"color": {
"b": 109,
"g": 230,
"r": 255,
"textB": 0,
"textG": 0,
"textR": 0
},
"comment": "Both rotations are relative to the screen height because the field of view is vertical. This way, the speed doesn't change with the screen ratio."
},
{
"type": "BuiltinCommonInstructions::Standard",
"conditions": [
Expand All @@ -4172,7 +4239,7 @@
"parameters": [
"Object",
"+",
"MousePointerLock::MovementX() * HorizontalSpeed / SceneWindowWidth()"
"MousePointerLock::MovementX() * HorizontalSpeed / (SceneWindowHeight() * 16 / 9)"
]
},
{
Expand Down Expand Up @@ -4815,32 +4882,7 @@
"name": "ShouldLock"
}
],
"propertiesFolderStructure": {
"folderName": "__ROOT",
"children": [
{
"propertyName": "Object3D"
},
{
"propertyName": "HorizontalSpeed"
},
{
"propertyName": "VerticalSpeed"
},
{
"propertyName": "VerticalAngleMin"
},
{
"propertyName": "VerticalAngleMax"
},
{
"propertyName": "OffsetZ"
},
{
"propertyName": "ShouldLock"
}
]
}
"sharedPropertyDescriptors": []
}
],
"eventsBasedObjects": []
Expand Down
Loading
Loading