|
2 | 2 | "author": "", |
3 | 3 | "category": "Camera", |
4 | 4 | "extensionNamespace": "", |
5 | | - "gdevelopVersion": ">=5.5.222", |
6 | 5 | "fullName": "Third person camera", |
| 6 | + "gdevelopVersion": ">=5.5.222", |
7 | 7 | "helpPath": "", |
8 | 8 | "iconUrl": "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4NCjwhLS0gR2VuZXJhdG9yOiBBZG9iZSBJbGx1c3RyYXRvciAyMy4wLjMsIFNWRyBFeHBvcnQgUGx1Zy1JbiAuIFNWRyBWZXJzaW9uOiA2LjAwIEJ1aWxkIDApICAtLT4NCjxzdmcgdmVyc2lvbj0iMS4xIiBpZD0iSWNvbnMiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4Ig0KCSB2aWV3Qm94PSIwIDAgMzIgMzIiIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDMyIDMyOyIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+DQo8c3R5bGUgdHlwZT0idGV4dC9jc3MiPg0KCS5zdDB7ZmlsbDpub25lO3N0cm9rZTojMDAwMDAwO3N0cm9rZS13aWR0aDoyO3N0cm9rZS1saW5lY2FwOnJvdW5kO3N0cm9rZS1saW5lam9pbjpyb3VuZDtzdHJva2UtbWl0ZXJsaW1pdDoxMDt9DQo8L3N0eWxlPg0KPHBvbHlnb24gY2xhc3M9InN0MCIgcG9pbnRzPSI3LDEwIDEsMTMgNywxNiAxMywxMyAiLz4NCjxwb2x5bGluZSBjbGFzcz0ic3QwIiBwb2ludHM9IjEsMTMgMSwyMCA3LDIzIDEzLDIwIDEzLDEzICIvPg0KPGxpbmUgY2xhc3M9InN0MCIgeDE9IjciIHkxPSIxNiIgeDI9IjciIHkyPSIyMyIvPg0KPGxpbmUgY2xhc3M9InN0MCIgeDE9IjMxIiB5MT0iMTYiIHgyPSIyMSIgeTI9IjgiLz4NCjxsaW5lIGNsYXNzPSJzdDAiIHgxPSIyMSIgeTE9IjI0IiB4Mj0iMzEiIHkyPSIxNiIvPg0KPHBhdGggY2xhc3M9InN0MCIgZD0iTTIyLjcsMjIuNkMyMCwyMS43LDE4LDE5LjEsMTgsMTZjMC0zLjEsMi01LjcsNC43LTYuNiIvPg0KPHBhdGggY2xhc3M9InN0MCIgZD0iTTE5LjgsMTEuM2MxLjQsMS4xLDIuMiwyLjgsMi4yLDQuN2MwLDEuOS0wLjksMy42LTIuMiw0LjciLz4NCjwvc3ZnPg0K", |
9 | 9 | "name": "ThirdPersonCamera", |
10 | 10 | "previewIconUrl": "https://asset-resources.gdevelop.io/public-resources/Icons/Line Hero Pack/Master/SVG/Virtual Reality/94e95d2c318e1f3dc7151a351024e13c574e1e44669c6696aa107d60230073f6_Virtual Reality_3d_vision_eye_vr.svg", |
11 | 11 | "shortDescription": "Move the camera to look at an object from a given distance.", |
12 | | - "version": "1.6.1", |
| 12 | + "version": "1.7.0", |
13 | 13 | "description": [ |
14 | 14 | "Move the camera to look at an object from a given distance with a rotation and an elevation angles.", |
15 | 15 | "", |
|
583 | 583 | "" |
584 | 584 | ] |
585 | 585 | }, |
| 586 | + { |
| 587 | + "type": { |
| 588 | + "value": "ThirdPersonCamera::ThirdPersonCamera::SetElevationHalfwayDuration" |
| 589 | + }, |
| 590 | + "parameters": [ |
| 591 | + "Object", |
| 592 | + "Behavior", |
| 593 | + "=", |
| 594 | + "ElevationHalfwayDuration", |
| 595 | + "" |
| 596 | + ] |
| 597 | + }, |
586 | 598 | { |
587 | 599 | "type": { |
588 | 600 | "value": "ThirdPersonCamera::ThirdPersonCamera::SetTranslationZHalfwayDuration" |
|
646 | 658 | }, |
647 | 659 | { |
648 | 660 | "type": { |
649 | | - "value": "SetCameraAngle" |
| 661 | + "value": "SetNumberVariable" |
650 | 662 | }, |
651 | 663 | "parameters": [ |
652 | | - "", |
| 664 | + "CameraZ", |
653 | 665 | "=", |
654 | | - "Object.Angle() + 90", |
655 | | - "Object.Layer()", |
656 | | - "0" |
| 666 | + "Object.Object3D::CenterZ()" |
657 | 667 | ] |
658 | 668 | }, |
659 | 669 | { |
660 | 670 | "type": { |
661 | | - "value": "SetNumberVariable" |
| 671 | + "value": "ThirdPersonCamera::ThirdPersonCamera::JumpToTargetedRotation" |
662 | 672 | }, |
663 | 673 | "parameters": [ |
664 | | - "CameraZ", |
665 | | - "=", |
666 | | - "Object.Object3D::CenterZ()" |
| 674 | + "Object", |
| 675 | + "Behavior", |
| 676 | + "" |
667 | 677 | ] |
668 | 678 | } |
669 | 679 | ] |
|
912 | 922 | } |
913 | 923 | ] |
914 | 924 | }, |
| 925 | + { |
| 926 | + "type": "BuiltinCommonInstructions::Standard", |
| 927 | + "conditions": [ |
| 928 | + { |
| 929 | + "type": { |
| 930 | + "value": "BooleanVariable" |
| 931 | + }, |
| 932 | + "parameters": [ |
| 933 | + "IsElevatingWithObject", |
| 934 | + "True", |
| 935 | + "" |
| 936 | + ] |
| 937 | + } |
| 938 | + ], |
| 939 | + "actions": [ |
| 940 | + { |
| 941 | + "type": { |
| 942 | + "value": "SetNumberVariable" |
| 943 | + }, |
| 944 | + "parameters": [ |
| 945 | + "TargetedElevationAngle", |
| 946 | + "=", |
| 947 | + "Object.Object3D::RotationY()" |
| 948 | + ] |
| 949 | + } |
| 950 | + ] |
| 951 | + }, |
915 | 952 | { |
916 | 953 | "type": "BuiltinCommonInstructions::Standard", |
917 | 954 | "conditions": [], |
|
921 | 958 | "value": "SetNumberVariable" |
922 | 959 | }, |
923 | 960 | "parameters": [ |
924 | | - "CameraAngle", |
| 961 | + "CameraRotationAngle", |
925 | 962 | "=", |
926 | 963 | "TargetedRotationAngle + 90 + RotationAngleOffset + AngleDifference(CameraAngle(Object.Layer()), TargetedRotationAngle + 90 + RotationAngleOffset) * exp(TimeDelta() * RotationLogSpeed)" |
927 | 964 | ] |
928 | 965 | }, |
| 966 | + { |
| 967 | + "type": { |
| 968 | + "value": "SetNumberVariable" |
| 969 | + }, |
| 970 | + "parameters": [ |
| 971 | + "CameraElevationAngle", |
| 972 | + "=", |
| 973 | + "TargetedElevationAngle + ElevationAngleOffset + AngleDifference(90 - Scene3D::CameraRotationX(Object.Layer()), TargetedElevationAngle + ElevationAngleOffset) * exp(TimeDelta() * ElevationLogSpeed)" |
| 974 | + ] |
| 975 | + }, |
929 | 976 | { |
930 | 977 | "type": { |
931 | 978 | "value": "ThirdPersonCamera::LookFromDistanceAtPosition3D" |
932 | 979 | }, |
933 | 980 | "parameters": [ |
934 | 981 | "", |
935 | | - "Object.CenterX() + ThirdPersonCamera::RotatedX(CameraAngle, OffsetX, -OffsetY)", |
936 | | - "Object.CenterY() + ThirdPersonCamera::RotatedY(CameraAngle, OffsetX, -OffsetY)", |
| 982 | + "Object.CenterX() + ThirdPersonCamera::RotatedX(CameraRotationAngle, OffsetX, -OffsetY)", |
| 983 | + "Object.CenterY() + ThirdPersonCamera::RotatedY(CameraRotationAngle, OffsetX, -OffsetY)", |
937 | 984 | "CameraZ + OffsetZ", |
938 | 985 | "Distance", |
939 | | - "CameraAngle", |
940 | | - "Object.Object3D::RotationY() + ElevationAngleOffset", |
| 986 | + "CameraRotationAngle", |
| 987 | + "CameraElevationAngle", |
941 | 988 | "", |
942 | 989 | "" |
943 | 990 | ] |
|
946 | 993 | "variables": [ |
947 | 994 | { |
948 | 995 | "folded": true, |
949 | | - "name": "CameraAngle", |
| 996 | + "name": "CameraRotationAngle", |
| 997 | + "type": "number", |
| 998 | + "value": 0 |
| 999 | + }, |
| 1000 | + { |
| 1001 | + "name": "CameraElevationAngle", |
950 | 1002 | "type": "number", |
951 | 1003 | "value": 0 |
952 | 1004 | } |
|
976 | 1028 | "fullName": "Rotate the camera all the way", |
977 | 1029 | "functionType": "Action", |
978 | 1030 | "name": "JumpToTargetedRotation", |
979 | | - "private": true, |
980 | 1031 | "sentence": "Rotate the camera all the way to the targeted angle of _PARAM0_", |
981 | 1032 | "events": [ |
982 | 1033 | { |
|
1006 | 1057 | } |
1007 | 1058 | ] |
1008 | 1059 | }, |
| 1060 | + { |
| 1061 | + "type": "BuiltinCommonInstructions::Standard", |
| 1062 | + "conditions": [ |
| 1063 | + { |
| 1064 | + "type": { |
| 1065 | + "value": "BooleanVariable" |
| 1066 | + }, |
| 1067 | + "parameters": [ |
| 1068 | + "IsElevatingWithObject", |
| 1069 | + "True", |
| 1070 | + "" |
| 1071 | + ] |
| 1072 | + } |
| 1073 | + ], |
| 1074 | + "actions": [ |
| 1075 | + { |
| 1076 | + "type": { |
| 1077 | + "value": "SetNumberVariable" |
| 1078 | + }, |
| 1079 | + "parameters": [ |
| 1080 | + "TargetedElevationAngle", |
| 1081 | + "=", |
| 1082 | + "Object.Object3D::RotationY()" |
| 1083 | + ] |
| 1084 | + } |
| 1085 | + ] |
| 1086 | + }, |
1009 | 1087 | { |
1010 | 1088 | "type": "BuiltinCommonInstructions::Standard", |
1011 | 1089 | "conditions": [], |
|
1251 | 1329 | ], |
1252 | 1330 | "objectGroups": [] |
1253 | 1331 | }, |
| 1332 | + { |
| 1333 | + "description": "the halfway time for elevation rotation of the object.", |
| 1334 | + "fullName": "Halfway time for elevation rotation", |
| 1335 | + "functionType": "ExpressionAndCondition", |
| 1336 | + "group": "Third person camera configuration", |
| 1337 | + "name": "ElevationHalfwayDuration", |
| 1338 | + "sentence": "the halfway time for elevation rotation", |
| 1339 | + "events": [ |
| 1340 | + { |
| 1341 | + "type": "BuiltinCommonInstructions::Standard", |
| 1342 | + "conditions": [], |
| 1343 | + "actions": [ |
| 1344 | + { |
| 1345 | + "type": { |
| 1346 | + "value": "SetReturnNumber" |
| 1347 | + }, |
| 1348 | + "parameters": [ |
| 1349 | + "ElevationHalfwayDuration" |
| 1350 | + ] |
| 1351 | + } |
| 1352 | + ] |
| 1353 | + } |
| 1354 | + ], |
| 1355 | + "expressionType": { |
| 1356 | + "type": "expression" |
| 1357 | + }, |
| 1358 | + "parameters": [ |
| 1359 | + { |
| 1360 | + "description": "Object", |
| 1361 | + "name": "Object", |
| 1362 | + "type": "object" |
| 1363 | + }, |
| 1364 | + { |
| 1365 | + "description": "Behavior", |
| 1366 | + "name": "Behavior", |
| 1367 | + "supplementaryInformation": "ThirdPersonCamera::ThirdPersonCamera", |
| 1368 | + "type": "behavior" |
| 1369 | + } |
| 1370 | + ], |
| 1371 | + "objectGroups": [] |
| 1372 | + }, |
| 1373 | + { |
| 1374 | + "fullName": "", |
| 1375 | + "functionType": "ActionWithOperator", |
| 1376 | + "getterName": "ElevationHalfwayDuration", |
| 1377 | + "name": "SetElevationHalfwayDuration", |
| 1378 | + "sentence": "", |
| 1379 | + "events": [ |
| 1380 | + { |
| 1381 | + "type": "BuiltinCommonInstructions::Comment", |
| 1382 | + "color": { |
| 1383 | + "b": 109, |
| 1384 | + "g": 230, |
| 1385 | + "r": 255, |
| 1386 | + "textB": 0, |
| 1387 | + "textG": 0, |
| 1388 | + "textR": 0 |
| 1389 | + }, |
| 1390 | + "comment": "ln((1 - speed)) = ln(1 / 2) / halfwatTime" |
| 1391 | + }, |
| 1392 | + { |
| 1393 | + "type": "BuiltinCommonInstructions::Standard", |
| 1394 | + "conditions": [], |
| 1395 | + "actions": [ |
| 1396 | + { |
| 1397 | + "type": { |
| 1398 | + "value": "SetNumberVariable" |
| 1399 | + }, |
| 1400 | + "parameters": [ |
| 1401 | + "ElevationHalfwayDuration", |
| 1402 | + "=", |
| 1403 | + "Value" |
| 1404 | + ] |
| 1405 | + }, |
| 1406 | + { |
| 1407 | + "type": { |
| 1408 | + "value": "SetNumberVariable" |
| 1409 | + }, |
| 1410 | + "parameters": [ |
| 1411 | + "ElevationLogSpeed", |
| 1412 | + "=", |
| 1413 | + "log(0.5) / Value" |
| 1414 | + ] |
| 1415 | + } |
| 1416 | + ] |
| 1417 | + } |
| 1418 | + ], |
| 1419 | + "parameters": [ |
| 1420 | + { |
| 1421 | + "description": "Object", |
| 1422 | + "name": "Object", |
| 1423 | + "type": "object" |
| 1424 | + }, |
| 1425 | + { |
| 1426 | + "description": "Behavior", |
| 1427 | + "name": "Behavior", |
| 1428 | + "supplementaryInformation": "ThirdPersonCamera::ThirdPersonCamera", |
| 1429 | + "type": "behavior" |
| 1430 | + } |
| 1431 | + ], |
| 1432 | + "objectGroups": [] |
| 1433 | + }, |
1254 | 1434 | { |
1255 | 1435 | "description": "the halfway time on Z axis of the object.", |
1256 | 1436 | "fullName": "Halfway time on Z axis", |
|
2190 | 2370 | "extraInformation": [], |
2191 | 2371 | "name": "RotationHalfwayDuration" |
2192 | 2372 | }, |
| 2373 | + { |
| 2374 | + "value": "0", |
| 2375 | + "type": "Number", |
| 2376 | + "unit": "Second", |
| 2377 | + "label": "Halfway time for elevation rotation", |
| 2378 | + "description": "", |
| 2379 | + "group": "Catch-up speed", |
| 2380 | + "extraInformation": [], |
| 2381 | + "name": "ElevationHalfwayDuration" |
| 2382 | + }, |
2193 | 2383 | { |
2194 | 2384 | "value": "0.125", |
2195 | 2385 | "type": "Number", |
|
2292 | 2482 | "hidden": true, |
2293 | 2483 | "name": "RotationLogSpeed" |
2294 | 2484 | }, |
| 2485 | + { |
| 2486 | + "value": "", |
| 2487 | + "type": "Number", |
| 2488 | + "label": "", |
| 2489 | + "description": "", |
| 2490 | + "group": "", |
| 2491 | + "extraInformation": [], |
| 2492 | + "hidden": true, |
| 2493 | + "name": "ElevationLogSpeed" |
| 2494 | + }, |
2295 | 2495 | { |
2296 | 2496 | "value": "", |
2297 | 2497 | "type": "Number", |
|
2342 | 2542 | "extraInformation": [], |
2343 | 2543 | "name": "IsRotatingWithObject" |
2344 | 2544 | }, |
| 2545 | + { |
| 2546 | + "value": "false", |
| 2547 | + "type": "Boolean", |
| 2548 | + "label": "Automatically rotate the camera with the object (elevation)", |
| 2549 | + "description": "", |
| 2550 | + "group": "", |
| 2551 | + "extraInformation": [], |
| 2552 | + "name": "IsElevatingWithObject" |
| 2553 | + }, |
2345 | 2554 | { |
2346 | 2555 | "value": "0", |
2347 | 2556 | "type": "Number", |
|
2352 | 2561 | "extraInformation": [], |
2353 | 2562 | "hidden": true, |
2354 | 2563 | "name": "TargetedRotationAngle" |
| 2564 | + }, |
| 2565 | + { |
| 2566 | + "value": "0", |
| 2567 | + "type": "Number", |
| 2568 | + "unit": "DegreeAngle", |
| 2569 | + "label": "Targeted camera rotation angle", |
| 2570 | + "description": "When this angle is set, the camera follow this value instead of the object angle.", |
| 2571 | + "group": "", |
| 2572 | + "extraInformation": [], |
| 2573 | + "hidden": true, |
| 2574 | + "name": "TargetedElevationAngle" |
2355 | 2575 | } |
2356 | 2576 | ], |
2357 | 2577 | "sharedPropertyDescriptors": [] |
|
0 commit comments