diff --git a/extensions/community/ThirdDistance.json b/extensions/community/ThirdDistance.json new file mode 100644 index 000000000..93c8c136c --- /dev/null +++ b/extensions/community/ThirdDistance.json @@ -0,0 +1,576 @@ +{ + "author": "", + "category": "General", + "extensionNamespace": "", + "fullName": "3D Distance", + "gdevelopVersion": "", + "helpPath": "", + "iconUrl": "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48IURPQ1RZUEUgc3ZnIFBVQkxJQyAiLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4iICJodHRwOi8vd3d3LnczLm9yZy9HcmFwaGljcy9TVkcvMS4xL0RURC9zdmcxMS5kdGQiPjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiBpZD0ibWRpLXNvY2lhbC1kaXN0YW5jZS0yLW1ldGVycyIgd2lkdGg9IjI0IiBoZWlnaHQ9IjI0IiB2aWV3Qm94PSIwIDAgMjQgMjQiPjxwYXRoIGQ9Ik02IDZDNy4xIDYgOCA1LjEgOCA0UzcuMSAyIDYgMiA0IDIuOSA0IDQgNC45IDYgNiA2TTEwIDkuNDNDMTAgOC42MiA5LjUgNy45IDguNzggNy41OEM3LjkzIDcuMjEgNyA3IDYgN1M0LjA3IDcuMjEgMy4yMiA3LjU4QzIuNSA3LjkgMiA4LjYyIDIgOS40M1YxMEgxMFY5LjQzTTE4IDZDMTkuMSA2IDIwIDUuMSAyMCA0UzE5LjEgMiAxOCAyIDE2IDIuOSAxNiA0IDE2LjkgNiAxOCA2TTIyIDkuNDNDMjIgOC42MiAyMS41IDcuOSAyMC43OCA3LjU4QzE5LjkzIDcuMjEgMTkgNyAxOCA3UzE2LjA3IDcuMjEgMTUuMjIgNy41OEMxNC41IDcuOSAxNCA4LjYyIDE0IDkuNDNWMTBIMjJWOS40M00xOSAxN1YxNUw1IDE1VjE3TDIgMTRMNSAxMVYxM0wxOSAxM1YxMUwyMiAxNEwxOSAxN005IDIwLjVWMjFIMTFWMjJIOFYyMC41QzggMTkuOTUgOC40NSAxOS41IDkgMTkuNUgxMFYxOUg4VjE4SDEwQzEwLjU1IDE4IDExIDE4LjQ1IDExIDE5VjE5LjVDMTEgMjAuMDUgMTAuNTUgMjAuNSAxMCAyMC41SDlNMTYgMTlWMjJIMTVWMTlIMTQuNVYyMUgxMy41VjE5SDEzVjIySDEyVjE5QzEyIDE4LjQ1IDEyLjQ1IDE4IDEzIDE4SDE1QzE1LjU1IDE4IDE2IDE4LjQ1IDE2IDE5WiIgLz48L3N2Zz4=", + "name": "ThirdDistance", + "previewIconUrl": "https://asset-resources.gdevelop.io/public-resources/Icons/3fbd850f05f0c0a3888a4c8a161de8277db55443d87e83ced32666622f4925ab_social-distance-2-meters.svg", + "shortDescription": "Calculate 3D Distance.", + "version": "1.0.0", + "description": [ + "First Version: 1.0.0", + "", + "", + "Coming Updates." + ], + "tags": [ + "3D" + ], + "authorIds": [ + "mu1pKMrGmTTX98LMxHYJ62GzFyJ2" + ], + "dependencies": [ + { + "exportName": "Distance_3D", + "name": "Verison1", + "type": "cordova", + "version": "1.0.0" + } + ], + "globalVariables": [], + "sceneVariables": [ + { + "name": "Dx", + "type": "number", + "value": 0 + }, + { + "name": "Dy", + "type": "number", + "value": 0 + }, + { + "name": "Dz", + "type": "number", + "value": 0 + } + ], + "eventsFunctions": [ + { + "description": "Is object is closer than to pos.", + "fullName": "If Distance 3D", + "functionType": "Condition", + "name": "Condition", + "sentence": "_PARAMx_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "Dx", + "=", + "Object1.CenterX()-Object2.CenterX()" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "Dy", + "=", + "Object1.CenterY()-Object2.CenterY()" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "Dz", + "=", + "Object1.Object3D::CenterZ()-Object2.Object3D::CenterZ()" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BuiltinCommonInstructions::CompareNumbers" + }, + "parameters": [ + "CloserThan", + ">", + "sqrt( Dx*Dx + Dy*Dy + Dz*Dz )" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object 1", + "name": "Object1", + "supplementaryInformation": "Scene3D::Cube3DObject", + "type": "objectList" + }, + { + "description": "Object 2", + "name": "Object2", + "supplementaryInformation": "Scene3D::Cube3DObject", + "type": "objectList" + }, + { + "description": "Closer Than", + "name": "CloserThan", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Distance of 3D objects.", + "fullName": "3D Distance (Obj - Obj)", + "functionType": "Expression", + "name": "Expression_Object", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "Dx", + "=", + "Object1.CenterX()-Object2.CenterX()" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "Dy", + "=", + "Object1.CenterY()-Object2.CenterY()" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "Dz", + "=", + "Object1.Object3D::CenterZ()-Object2.Object3D::CenterZ()" + ] + }, + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "sqrt( Dx*Dx + Dy*Dy + Dz*Dz )" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object1", + "name": "Object1", + "supplementaryInformation": "Scene3D::Cube3DObject", + "type": "objectList" + }, + { + "description": "Object2", + "name": "Object2", + "supplementaryInformation": "Scene3D::Cube3DObject", + "type": "objectList" + } + ], + "objectGroups": [] + }, + { + "description": "Distance of 3D objects.", + "fullName": "3D Distance Status (Obj - Obj)", + "functionType": "StringExpression", + "name": "Expression_StatusForObjToObj", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "Dx", + "=", + "Object1.CenterX()-Object2.CenterX()" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "Dy", + "=", + "Object1.CenterY()-Object2.CenterY()" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "Dz", + "=", + "Object1.Object3D::CenterZ()-Object2.Object3D::CenterZ()" + ] + }, + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "sqrt( Dx*Dx + Dy*Dy + Dz*Dz )" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BuiltinCommonInstructions::CompareNumbers" + }, + "parameters": [ + "sqrt( Dx*Dx + Dy*Dy + Dz*Dz )", + ">", + "StatusVeryFar" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnString" + }, + "parameters": [ + "\"Very Far\"" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BuiltinCommonInstructions::CompareNumbers" + }, + "parameters": [ + "sqrt( Dx*Dx + Dy*Dy + Dz*Dz )", + "<", + "StatusVeryFar" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnString" + }, + "parameters": [ + "\"Far\"" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BuiltinCommonInstructions::CompareNumbers" + }, + "parameters": [ + "sqrt( Dx*Dx + Dy*Dy + Dz*Dz )", + "<", + "StatusCloser" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnString" + }, + "parameters": [ + "\"Closer\"" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BuiltinCommonInstructions::CompareNumbers" + }, + "parameters": [ + "sqrt( Dx*Dx + Dy*Dy + Dz*Dz )", + "<", + "StatusVeryClose" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnString" + }, + "parameters": [ + "\"Very Close\"" + ] + } + ] + } + ], + "expressionType": { + "type": "string" + }, + "parameters": [ + { + "description": "Object1", + "name": "Object1", + "supplementaryInformation": "Scene3D::Cube3DObject", + "type": "objectList" + }, + { + "description": "Object2", + "name": "Object2", + "supplementaryInformation": "Scene3D::Cube3DObject", + "type": "objectList" + }, + { + "description": "Very close if less than (<)", + "name": "StatusVeryClose", + "type": "expression" + }, + { + "description": "Closer if less than (<)", + "name": "StatusCloser", + "type": "expression" + }, + { + "description": "Far if less than (<)", + "name": "StatusFar", + "type": "expression" + }, + { + "description": "Very Far if more than (>)", + "name": "StatusVeryFar", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Distance of 3D objects.", + "fullName": "3D Distance (Num - Num)", + "functionType": "Expression", + "name": "Expression_NumToNum", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "Dx", + "=", + "Pos1X-Pos2X" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "Dy", + "=", + "Pos1Y-Pos2Y" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "Dz", + "=", + "Pos1Z-Pos2Z" + ] + }, + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "sqrt( Dx*Dx + Dy*Dy + Dz*Dz )" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Pos 1 (x)", + "name": "Pos1X", + "type": "expression" + }, + { + "description": "Pos 1 (y)", + "name": "Pos1Y", + "type": "expression" + }, + { + "description": "Pos 1 (z)", + "name": "Pos1Z", + "type": "expression" + }, + { + "description": "Pos 2 (x)", + "name": "Pos2X", + "type": "expression" + }, + { + "description": "Pos 2 (y)", + "name": "Pos2Y", + "type": "expression" + }, + { + "description": "Pos 2 (z)", + "name": "Pos2Z", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Distance of 3D objects.", + "fullName": "3D Distance (Obj - Num)", + "functionType": "Expression", + "name": "Expression_ObjToNum", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "Dx", + "=", + "PosX - Object.CenterX()" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "Dy", + "=", + "PosY-Object.CenterY()" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "Dz", + "=", + "PosZ - Object.Object3D::CenterZ()" + ] + }, + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "sqrt( Dx*Dx + Dy*Dy + Dz*Dz )" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Pos X", + "name": "PosX", + "type": "expression" + }, + { + "description": "Pos Y", + "name": "PosY", + "type": "expression" + }, + { + "description": "Pos Z", + "name": "PosZ", + "type": "expression" + }, + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "Scene3D::Cube3DObject", + "type": "objectList" + } + ], + "objectGroups": [] + } + ], + "eventsBasedBehaviors": [], + "eventsBasedObjects": [] +} \ No newline at end of file