commit fdf34f99c6ef950a659b6778e42cf504b68e655d Author: J3oss Date: Fri Jun 25 22:09:01 2021 +0200 Added first assets diff --git a/assets/meshes/Avocado.mesh b/assets/meshes/Avocado.mesh new file mode 100644 index 0000000..a2e454d Binary files /dev/null and b/assets/meshes/Avocado.mesh differ diff --git a/assets/meshes/Cube.mesh b/assets/meshes/Cube.mesh new file mode 100644 index 0000000..5b8828c Binary files /dev/null and b/assets/meshes/Cube.mesh differ diff --git a/assets/shaders/default.frag b/assets/shaders/default.frag new file mode 100644 index 0000000..d7837bb --- /dev/null +++ b/assets/shaders/default.frag @@ -0,0 +1,40 @@ +#version 450 +#extension GL_EXT_nonuniform_qualifier : require + +struct Material { + vec3 baseColor; + uint index; +}; + +struct Light { + vec3 color; + uint intensity; +}; + +struct Scene { + uint lightsCount; +}; + +vec3 directional_light = vec3(-1.0,-1.0,-1.0); + +layout(set = 0, binding = 0) uniform SceneData { + layout(align = 16) Scene mesh; +} SceneBuffers[]; + +layout(set = 0, binding = 1) uniform LightBuffer { + layout(align = 16) Light lights[]; +} LightsBuffers; + +// layout(set = 2, binding = 4) uniform sampler2D texSampler[]; + +layout(location = 0) in vec3 normal; +layout(location = 1) in vec3 color; +layout(location = 2) flat in Material material; + +layout(location = 0) out vec4 outColor; + +void main() { + float intensity = ((dot(normalize(normal), normalize(directional_light)) +1)/2.0)+0.05; + + outColor = vec4(color * intensity, 1.0); +} diff --git a/assets/shaders/default.vert b/assets/shaders/default.vert new file mode 100644 index 0000000..be17c40 --- /dev/null +++ b/assets/shaders/default.vert @@ -0,0 +1,75 @@ +#version 450 +#extension GL_EXT_nonuniform_qualifier : require + +struct Material { + vec3 baseColor; + uint index; +}; + +struct Vertex { + vec4 position; + vec4 normal; + vec4 color; + vec2 uv[2]; +}; + +struct Light { + vec3 color; + uint intensity; +}; + +struct Scene { + uint lightsCount; +}; + +struct Mesh { + uint asd; +}; + +layout( push_constant ) uniform constants +{ + mat4 render_matrix; + uint indexBufferIndex; + uint vertexBufferIndex; + uint materialBufferIndex; +} PushConstants; + +layout(set = 1, binding = 0) uniform CameraParam { + mat4 projection; + mat4 view; +} Camera; + +layout(set = 2, binding = 0) buffer MeshBuffer { + layout(align = 16) Mesh mesh; +} MeshBuffers[]; + +layout(set = 2, binding = 1) buffer VertexBuffer { + layout(align = 16) Vertex vertices[]; +} VertexBuffers[]; + +layout(set = 2, binding = 2) buffer IndexBuffer { + uint indices[]; +} IndexBuffers[]; + +layout(set = 2, binding = 3) buffer MaterialBuffer { + layout(align = 16) Material materials[]; +} MaterialBuffers; + +layout(set = 2, binding = 4) uniform sampler2D texSampler[]; + +layout(location = 0) out vec3 normal; +layout(location = 1) out vec3 color; +layout(location = 2) out Material material; + +void main() +{ + material = MaterialBuffers.materials[ PushConstants.materialBufferIndex ]; + + uint index = IndexBuffers[ PushConstants.indexBufferIndex ].indices[gl_VertexIndex]; + Vertex vertex = VertexBuffers[ PushConstants.vertexBufferIndex ].vertices[ index ]; + + color = texture(texSampler[0],vertex.uv[0]).xyz; + + normal = vertex.normal.xyz; + gl_Position = Camera.projection * Camera.view * PushConstants.render_matrix * vec4(vertex.position.xyz, 1.0); +} diff --git a/assets/textures/lost.tx b/assets/textures/lost.tx new file mode 100644 index 0000000..c333f63 Binary files /dev/null and b/assets/textures/lost.tx differ diff --git a/game.proj b/game.proj new file mode 100644 index 0000000..981cd34 --- /dev/null +++ b/game.proj @@ -0,0 +1,37 @@ +{ + "name": "dummy_game", + "engineVersion": "0.2", + "mounts": [ + { + "path": "./res", + "mountpoint": "res" + }, + { + "path": "./res/scripts", + "mountpoint": "scripts" + }, + { + "path": "./res/scenes", + "mountpoint": "scenes" + }, + { + "path": "./res/shaders", + "mountpoint": "shaders" + } + ], + "scenes": [ + { + "id": "MainScene", + "path": "scenes://MainScene.evsc" + }, + { + "id": "SideScene", + "path": "scenes://SideScene.evsc" + }, + { + "id": "TestScene", + "path": "scenes://TestScene.evsc" + }, + ], + "activeScene": "TestScene" +} diff --git a/scenes/MainScene.evsc b/scenes/MainScene.evsc new file mode 100644 index 0000000..6087ccf --- /dev/null +++ b/scenes/MainScene.evsc @@ -0,0 +1,303 @@ +{ + "id":"MainScene", + "nodes": [ + { + "id": "Camera", + "components": [ + { + "type": "TransformComponent", + "position": [0.0, -2.0, -11.0], + "rotation": [0.0, 0.0, 0.0], + "scale": [1.0, 1.0, 1.0] + }, + { + "type": "ScriptComponent", + "script_name": "MainCameraController", + "script_path": "scripts://MainScene/Camera.lua" + } + ], + "children": [ + { + "id": "RotationHelper", + "components": [ + { + "type": "TransformComponent", + "position": [0.0, 0.0, 0.0], + "rotation": [0.0, 0.0, 0.0], + "scale": [1.0, 1.0, 1.0] + }, + { + "type": "CameraComponent", + "view": "Perspective", + "fov": 90, + "near": 0.001, + "far": 1000, + "aspectRatio": 1.3333 + }, + { + "type": "ScriptComponent", + "script_name": "MainCameraRotationHelper", + "script_path": "scripts://MainScene/CameraHelper.lua" + } + ] + } + ] + }, + { + "id": "SideCamera", + "components": [ + { + "type": "TransformComponent", + "position": [25.0, 0.0, -15.0], + "rotation": [0.0, 90.0, 0.0], + "scale": [1.0, 1.0, 1.0] + }, + { + "type": "CameraComponent", + "view": "Perspective", + "fov": 90, + "near": 0.001, + "far": 1000, + "aspectRatio": 1.3333 + } + ] + }, + { + "id": "Player", + "components": [ + { + "type": "TransformComponent", + "position": [0.0, 0.0, -15.0], + "rotation": [0.0, 0.0, 0.0], + "scale": [1.0, 1.0, 1.0] + }, + { + "type": "RigidbodyComponent", + "rigidbodyType": "Dynamic", + "mass": 1.0, + "restitution": 1.0, + "collisionShape": { + "type": "Sphere", + "radius": 1.0 + } + }, + { + "type": "ScriptComponent", + "script_name": "MainPlayerController", + "script_path": "scripts://MainScene/Player.lua" + }, + { + "type": "RenderComponent", + "mesh": "project://Avocado.mesh", + "material": "WhiteMaterial" + } + ], + "children": [ + { + "id": "Child", + "components": [ + { + "type": "TransformComponent", + "position": [0.0, 5.0, -5.0], + "rotation": [0.0, 0.0, 0.0], + "scale": [1.0, 1.0, 1.0] + }, + { + "type": "RigidbodyComponent", + "rigidbodyType": "Kinematic", + "mass": 1.0, + "restitution": 1.0, + "collisionShape": { + "type": "Box", + "halfExtents": [1.0, 1.0, 1.0] + } + }, + { + "type": "CameraComponent", + "view": "Perspective", + "fov": 120, + "near": 0.001, + "far": 1000, + "aspectRatio": 1.3333 + }, + { + "type": "ScriptComponent", + "script_name": "MainChildController", + "script_path": "scripts://MainScene/Child.lua" + }, + { + "type": "RenderComponent", + "mesh": "project://Cube.mesh", + "material": "WhiteMaterial" + } + ] + } + ] + }, + { + "id": "Map", + "components": [ + { + "type": "TransformComponent", + "position": [0.0, 0.0, 0.0], + "rotation": [0.0, 0.0, 0.0], + "scale": [1.0, 1.0, 1.0] + } + ], + "children": [ + { + "id": "Ground", + "components": [ + { + "type": "TransformComponent", + "position": [0.0, -5.0, -15.0], + "rotation": [0.0, 0.0, 0.0], + "scale": [1.0, 1.0, 1.0] + }, + { + "type": "RigidbodyComponent", + "rigidbodyType": "Static", + "mass": 0.0, + "restitution": 0.0, + "collisionShape": { + "type": "Box", + "halfExtents": [10.0, 1.0, 10.0] + } + } + ] + }, + { + "id": "Ceiling", + "components": [ + { + "type": "TransformComponent", + "position": [0.0, 5.0, -15.0], + "rotation": [0.0, 0.0, 0.0], + "scale": [1.0, 1.0, 1.0] + }, + { + "type": "RigidbodyComponent", + "rigidbodyType": "Static", + "mass": 0.0, + "restitution": 0.0, + "collisionShape": { + "type": "Box", + "halfExtents": [10.0, 1.0, 10.0] + } + } + ] + }, + { + "id": "WallRight", + "components": [ + { + "type": "TransformComponent", + "position": [9.0, 0.0, -14.0], + "rotation": [0.0, 0.0, 0.0], + "scale": [1.0, 1.0, 1.0] + }, + { + "type": "RigidbodyComponent", + "rigidbodyType": "Static", + "mass": 0.0, + "restitution": 0.0, + "collisionShape": { + "type": "Box", + "halfExtents": [1.0, 4.0, 9.0] + } + }, + { + "type": "RenderComponent", + "mesh": "project://Avocado.mesh", + "material": "WhiteMaterial" + } + ] + }, + { + "id": "WallLeft", + "components": [ + { + "type": "TransformComponent", + "position": [-9.0, 0.0, -14.0], + "rotation": [0.0, 0.0, 0.0], + "scale": [1.0, 1.0, 1.0] + }, + { + "type": "RigidbodyComponent", + "rigidbodyType": "Static", + "mass": 0.0, + "restitution": 0.0, + "collisionShape": { + "type": "Box", + "halfExtents": [1.0, 4.0, 9.0] + } + } + ] + }, + { + "id": "WallBack", + "components": [ + { + "type": "TransformComponent", + "position": [0.0, 0.0, -24.0], + "rotation": [0.0, 0.0, 0.0], + "scale": [1.0, 1.0, 1.0] + }, + { + "type": "RigidbodyComponent", + "rigidbodyType": "Static", + "mass": 0.0, + "restitution": 0.0, + "collisionShape": { + "type": "Box", + "halfExtents": [10.0, 4.0, 1.0] + } + } + ] + } + ] + } + ], + "materials": [ + { + "id": "GreenMaterial", + "pipeline": "DefaultPipeline", + "baseColor": [0.0, 1.0, 0.0, 1.0], + "albedoTexture": "project://lost.tx", + }, + { + "id": "RedMaterial", + "pipeline": "DefaultPipeline", + "baseColor": [1.0, 0.0, 0.0, 1.0], + "albedoTexture": "project://lost.tx", + }, + { + "id": "BlueMaterial", + "pipeline": "DefaultPipeline", + "baseColor": [0.0, 0.0, 1.0, 1.0], + "albedoTexture": "project://lost.tx", + }, + { + "id": "WhiteMaterial", + "pipeline": "DefaultPipeline", + "baseColor": [1.0, 1.0, 1.0, 1.0], + "albedoTexture": "project://lost.tx", + }, + ], + "pipelines": [ + { + "id": "DefaultPipeline", + "shaderStages": [ + { + "type": "Vertex", + "shaderPath": "shaders://default.vert" + }, + { + "type": "Fragment", + "shaderPath": "shaders://default.frag" + } + ] + } + ], + "activeCamera": "Camera.RotationHelper" +} diff --git a/scenes/SideScene.evsc b/scenes/SideScene.evsc new file mode 100644 index 0000000..d005d6b --- /dev/null +++ b/scenes/SideScene.evsc @@ -0,0 +1,173 @@ +{ + "id":"SideScene", + "nodes": [ + { + "id": "Camera", + "components": [ + { + "type": "TransformComponent", + "position": [0.0, 0.0, 0.0], + "rotation": [0.0, 0.0, 0.0], + "scale": [1.0, 1.0, 1.0] + }, + { + "type": "CameraComponent", + "view": "Perspective", + "fov": 60, + "near": 0.001, + "far": 1000, + "aspectRatio": 1.3333 + }, + { + "type": "ScriptComponent", + "script_name": "SideCameraController", + "script_path": "scripts://SideScene/Camera.lua" + } + ] + }, + { + "id": "Player", + "components": [ + { + "type": "TransformComponent", + "position": [0.0, 0.0, -15.0], + "rotation": [0.0, 0.0, 0.0], + "scale": [1.0, 1.0, 1.0] + }, + { + "type": "RigidbodyComponent", + "rigidbodyType": "Dynamic", + "mass": 1.0, + "restitution": 1.0, + "collisionShape": { + "type": "Capsule", + "radius": 1.0, + "height": 2.0 + } + }, + { + "type": "ScriptComponent", + "script_name": "SidePlayerController", + "script_path": "scripts://SideScene/Player.lua" + } + ], + "children": [ + { + "id": "Child", + "components": [ + { + "type": "TransformComponent", + "position": [0.0, 5.0, -5.0], + "rotation": [0.0, 0.0, 0.0], + "scale": [1.0, 1.0, 1.0] + }, + { + "type": "RigidbodyComponent", + "rigidbodyType": "Kinematic", + "mass": 1.0, + "restitution": 1.0, + "collisionShape": { + "type": "Sphere", + "radius": 1.0 + } + }, + { + "type": "ScriptComponent", + "script_name": "SideChildController", + "script_path": "scripts://SideScene/Child.lua" + } + ] + } + ] + }, + { + "id": "Ceiling", + "components": [ + { + "type": "TransformComponent", + "position": [0.0, 15.0, -15.0], + "rotation": [0.0, 0.0, 0.0], + "scale": [1.0, 1.0, 1.0] + }, + { + "type": "RigidbodyComponent", + "rigidbodyType": "Ghost", + "mass": 0.0, + "restitution": 0.0, + "collisionShape": { + "type": "Box", + "halfExtents": [10.0, 10.0, 10.0] + } + }, + { + "type": "ScriptComponent", + "script_name": "SideGhostController", + "script_path": "scripts://SideScene/Ghost.lua" + } + ] + }, + { + "id": "Ground", + "components": [ + { + "type": "TransformComponent", + "position": [0.0, -15.0, -15.0], + "rotation": [0.0, 0.0, 0.0], + "scale": [1.0, 1.0, 1.0] + }, + { + "type": "RigidbodyComponent", + "rigidbodyType": "Static", + "mass": 0.0, + "restitution": 0.0, + "collisionShape": { + "type": "Sphere", + "radius": 10.0 + } + } + ] + } + ], + "materials": [ + { + "id": "GreenMaterial", + "pipeline": "DefaultPipeline", + "baseColor": [0.0, 1.0, 0.0, 1.0], + "albedoTexture": "project://lost.tx", + }, + { + "id": "RedMaterial", + "pipeline": "DefaultPipeline", + "baseColor": [1.0, 0.0, 0.0, 1.0], + "albedoTexture": "project://lost.tx", + }, + { + "id": "BlueMaterial", + "pipeline": "DefaultPipeline", + "baseColor": [0.0, 0.0, 1.0, 1.0], + "albedoTexture": "project://lost.tx", + }, + { + "id": "WhiteMaterial", + "pipeline": "DefaultPipeline", + "baseColor": [1.0, 1.0, 1.0, 1.0], + "albedoTexture": "project://lost.tx", + }, + ], + "pipelines": [ + { + "id": "DefaultPipeline", + "shaderStages": [ + { + "type": "Vertex", + "shaderPath": "shaders://default.vert" + }, + { + "type": "Fragment", + "shaderPath": "shaders://default.frag" + } + ] + } + ], + "activeCamera": "Camera" +} diff --git a/scenes/TestScene.evsc b/scenes/TestScene.evsc new file mode 100644 index 0000000..7a6ed66 --- /dev/null +++ b/scenes/TestScene.evsc @@ -0,0 +1,1799 @@ +{ + "id":"TestScene", + "nodes": [ + { + "id": "CameraTransformOverride", + "components": [ + { + "type": "TransformComponent", + "position": [0.0, 20.0, 7.0], + "rotation": [0.0, 0.0, 0.0], + "scale": [1.0, 1.0, 1.0] + } + ], + "children": [ + { + "id": "Camera", + "components": [ + { + "type": "TransformComponent", + "position": [0.0, 0.0, 0.0], + "rotation": [0.0, 0.0, 0.0], + "scale": [1.0, 1.0, 1.0] + }, + { + "type": "ScriptComponent", + "script_name": "MainCameraController", + "script_path": "scripts://TestScene/Camera.lua" + } + ], + "children": [ + { + "id": "RotationHelper", + "components": [ + { + "type": "TransformComponent", + "position": [0.0, 0.0, 0.0], + "rotation": [0.0, 0.0, 0.0], + "scale": [1.0, 1.0, 1.0] + }, + { + "type": "CameraComponent", + "view": "Perspective", + "fov": 90, + "near": 0.001, + "far": 1000, + "aspectRatio": 1.3333 + }, + { + "type": "ScriptComponent", + "script_name": "MainCameraRotationHelper", + "script_path": "scripts://TestScene/CameraHelper.lua" + } + ] + } + ] + }, + ] + } + { + "id": "SideCamera", + "components": [ + { + "type": "TransformComponent", + "position": [55.0, 0.0, -15.0], + "rotation": [0.0, 90.0, 0.0], + "scale": [1.0, 1.0, 1.0] + }, + { + "type": "CameraComponent", + "view": "Perspective", + "fov": 90, + "near": 0.001, + "far": 1000, + "aspectRatio": 1.3333 + } + ] + }, + { + "id": "Player", + "components": [ + { + "type": "TransformComponent", + "position": [0.0, 0.0, -15.0], + "rotation": [0.0, 0.0, 0.0], + "scale": [1.0, 1.0, 1.0] + }, + { + "type": "RigidbodyComponent", + "rigidbodyType": "Dynamic", + "mass": 0.3, + "restitution": 0.0, + "collisionShape": { + "type": "Box", + "halfExtents": [1.0, 1.0, 1.0] + } + }, + { + "type": "ScriptComponent", + "script_name": "MainPlayerController", + "script_path": "scripts://TestScene/Player.lua" + }, + ] + }, + { + "id": "Ball1", + "components": [ + { + "type": "TransformComponent", + "position": [0.0, 10.0, -15.0], + "rotation": [0.0, 0.0, 0.0], + "scale": [1.0, 1.0, 1.0] + }, + { + "type": "RigidbodyComponent", + "rigidbodyType": "Dynamic", + "mass": 1.0, + "restitution": 1.0, + "collisionShape": { + "type": "Sphere", + "radius": 1.0 + } + }, + { + "type": "RenderComponent", + "mesh": "project://Cube.mesh", + "material": "GreenMaterial" + } + ] + }, + { + "id": "Ball2", + "components": [ + { + "type": "TransformComponent", + "position": [0.0, 10.0, -15.0], + "rotation": [0.0, 0.0, 0.0], + "scale": [1.0, 1.0, 1.0] + }, + { + "type": "RigidbodyComponent", + "rigidbodyType": "Dynamic", + "mass": 1.0, + "restitution": 1.0, + "collisionShape": { + "type": "Sphere", + "radius": 1.0 + } + }, + { + "type": "RenderComponent", + "mesh": "project://Avocado.mesh", + "material": "GreenMaterial" + } + ] + }, + { + "id": "Ball3", + "components": [ + { + "type": "RenderComponent", + "mesh": "project://Avocado.mesh", + "material": "GreenMaterial" + }, + { + "type": "TransformComponent", + "position": [0.0, 10.0, -15.0], + "rotation": [0.0, 0.0, 0.0], + "scale": [1.0, 1.0, 1.0] + }, + { + "type": "RigidbodyComponent", + "rigidbodyType": "Dynamic", + "mass": 1.0, + "restitution": 1.0, + "collisionShape": { + "type": "Sphere", + "radius": 1.0 + } + } + ] + }, + { + "id": "Ball4", + "components": [ + { + "type": "RenderComponent", + "mesh": "project://Avocado.mesh", + "material": "GreenMaterial" + }, + { + "type": "TransformComponent", + "position": [0.0, 10.0, -15.0], + "rotation": [0.0, 0.0, 0.0], + "scale": [1.0, 1.0, 1.0] + }, + { + "type": "RigidbodyComponent", + "rigidbodyType": "Dynamic", + "mass": 1.0, + "restitution": 1.0, + "collisionShape": { + "type": "Sphere", + "radius": 1.0 + } + } + ] + }, + { + "id": "Ball5", + "components": [ + { + "type": "RenderComponent", + "mesh": "project://Avocado.mesh", + "material": "GreenMaterial" + }, + { + "type": "TransformComponent", + "position": [0.0, 10.0, -15.0], + "rotation": [0.0, 0.0, 0.0], + "scale": [1.0, 1.0, 1.0] + }, + { + "type": "RigidbodyComponent", + "rigidbodyType": "Dynamic", + "mass": 1.0, + "restitution": 1.0, + "collisionShape": { + "type": "Sphere", + "radius": 1.0 + } + } + ] + }, + { + "id": "Ball6", + "components": [ + { + "type": "RenderComponent", + "mesh": "project://Avocado.mesh", + "material": "GreenMaterial" + }, + { + "type": "TransformComponent", + "position": [0.0, 10.0, -15.0], + "rotation": [0.0, 0.0, 0.0], + "scale": [1.0, 1.0, 1.0] + }, + { + "type": "RigidbodyComponent", + "rigidbodyType": "Dynamic", + "mass": 1.0, + "restitution": 1.0, + "collisionShape": { + "type": "Sphere", + "radius": 1.0 + } + } + ] + }, + { + "id": "Ball7", + "components": [ + { + "type": "RenderComponent", + "mesh": "project://Avocado.mesh", + "material": "GreenMaterial" + }, + { + "type": "TransformComponent", + "position": [0.0, 10.0, -15.0], + "rotation": [0.0, 0.0, 0.0], + "scale": [1.0, 1.0, 1.0] + }, + { + "type": "RigidbodyComponent", + "rigidbodyType": "Dynamic", + "mass": 1.0, + "restitution": 1.0, + "collisionShape": { + "type": "Sphere", + "radius": 1.0 + } + } + ] + }, + { + "id": "Ball9", + "components": [ + { + "type": "RenderComponent", + "mesh": "project://Avocado.mesh", + "material": "GreenMaterial" + }, + { + "type": "TransformComponent", + "position": [0.0, 10.0, -15.0], + "rotation": [0.0, 0.0, 0.0], + "scale": [1.0, 1.0, 1.0] + }, + { + "type": "RigidbodyComponent", + "rigidbodyType": "Dynamic", + "mass": 1.0, + "restitution": 1.0, + "collisionShape": { + "type": "Sphere", + "radius": 1.0 + } + } + ] + }, + { + "id": "Ball10", + "components": [ + { + "type": "RenderComponent", + "mesh": "project://Avocado.mesh", + "material": "GreenMaterial" + }, + { + "type": "TransformComponent", + "position": [0.0, 10.0, -15.0], + "rotation": [0.0, 0.0, 0.0], + "scale": [1.0, 1.0, 1.0] + }, + { + "type": "RigidbodyComponent", + "rigidbodyType": "Dynamic", + "mass": 1.0, + "restitution": 1.0, + "collisionShape": { + "type": "Sphere", + "radius": 1.0 + } + } + ] + }, + { + "id": "Ball11", + "components": [ + { + "type": "RenderComponent", + "mesh": "project://Avocado.mesh", + "material": "GreenMaterial" + }, + { + "type": "TransformComponent", + "position": [0.0, 10.0, -15.0], + "rotation": [0.0, 0.0, 0.0], + "scale": [1.0, 1.0, 1.0] + }, + { + "type": "RigidbodyComponent", + "rigidbodyType": "Dynamic", + "mass": 1.0, + "restitution": 1.0, + "collisionShape": { + "type": "Sphere", + "radius": 1.0 + } + } + ] + }, + { + "id": "Ball12", + "components": [ + { + "type": "RenderComponent", + "mesh": "project://Avocado.mesh", + "material": "GreenMaterial" + }, + { + "type": "TransformComponent", + "position": [0.0, 10.0, -15.0], + "rotation": [0.0, 0.0, 0.0], + "scale": [1.0, 1.0, 1.0] + }, + { + "type": "RigidbodyComponent", + "rigidbodyType": "Dynamic", + "mass": 1.0, + "restitution": 1.0, + "collisionShape": { + "type": "Sphere", + "radius": 1.0 + } + } + ] + }, + { + "id": "Ball13", + "components": [ + { + "type": "RenderComponent", + "mesh": "project://Avocado.mesh", + "material": "GreenMaterial" + }, + { + "type": "TransformComponent", + "position": [0.0, 10.0, -15.0], + "rotation": [0.0, 0.0, 0.0], + "scale": [1.0, 1.0, 1.0] + }, + { + "type": "RigidbodyComponent", + "rigidbodyType": "Dynamic", + "mass": 1.0, + "restitution": 1.0, + "collisionShape": { + "type": "Sphere", + "radius": 1.0 + } + } + ] + }, + { + "id": "Ball14", + "components": [ + { + "type": "RenderComponent", + "mesh": "project://Avocado.mesh", + "material": "GreenMaterial" + }, + { + "type": "TransformComponent", + "position": [0.0, 10.0, -15.0], + "rotation": [0.0, 0.0, 0.0], + "scale": [1.0, 1.0, 1.0] + }, + { + "type": "RigidbodyComponent", + "rigidbodyType": "Dynamic", + "mass": 1.0, + "restitution": 1.0, + "collisionShape": { + "type": "Sphere", + "radius": 1.0 + } + } + ] + }, + { + "id": "Ball15", + "components": [ + { + "type": "RenderComponent", + "mesh": "project://Avocado.mesh", + "material": "GreenMaterial" + }, + { + "type": "TransformComponent", + "position": [0.0, 10.0, -15.0], + "rotation": [0.0, 0.0, 0.0], + "scale": [1.0, 1.0, 1.0] + }, + { + "type": "RigidbodyComponent", + "rigidbodyType": "Dynamic", + "mass": 1.0, + "restitution": 1.0, + "collisionShape": { + "type": "Sphere", + "radius": 1.0 + } + } + ] + }, + { + "id": "Ball16", + "components": [ + { + "type": "RenderComponent", + "mesh": "project://Avocado.mesh", + "material": "GreenMaterial" + }, + { + "type": "TransformComponent", + "position": [0.0, 10.0, -15.0], + "rotation": [0.0, 0.0, 0.0], + "scale": [1.0, 1.0, 1.0] + }, + { + "type": "RigidbodyComponent", + "rigidbodyType": "Dynamic", + "mass": 1.0, + "restitution": 1.0, + "collisionShape": { + "type": "Sphere", + "radius": 1.0 + } + } + ] + }, + { + "id": "Ball17", + "components": [ + { + "type": "RenderComponent", + "mesh": "project://Avocado.mesh", + "material": "GreenMaterial" + }, + { + "type": "TransformComponent", + "position": [0.0, 10.0, -15.0], + "rotation": [0.0, 0.0, 0.0], + "scale": [1.0, 1.0, 1.0] + }, + { + "type": "RigidbodyComponent", + "rigidbodyType": "Dynamic", + "mass": 1.0, + "restitution": 1.0, + "collisionShape": { + "type": "Sphere", + "radius": 1.0 + } + } + ] + }, + { + "id": "Ball18", + "components": [ + { + "type": "RenderComponent", + "mesh": "project://Avocado.mesh", + "material": "GreenMaterial" + }, + { + "type": "TransformComponent", + "position": [0.0, 10.0, -15.0], + "rotation": [0.0, 0.0, 0.0], + "scale": [1.0, 1.0, 1.0] + }, + { + "type": "RigidbodyComponent", + "rigidbodyType": "Dynamic", + "mass": 1.0, + "restitution": 1.0, + "collisionShape": { + "type": "Sphere", + "radius": 1.0 + } + } + ] + }, + { + "id": "Ball19", + "components": [ + { + "type": "RenderComponent", + "mesh": "project://Avocado.mesh", + "material": "GreenMaterial" + }, + { + "type": "TransformComponent", + "position": [0.0, 10.0, -15.0], + "rotation": [0.0, 0.0, 0.0], + "scale": [1.0, 1.0, 1.0] + }, + { + "type": "RigidbodyComponent", + "rigidbodyType": "Dynamic", + "mass": 1.0, + "restitution": 1.0, + "collisionShape": { + "type": "Sphere", + "radius": 1.0 + } + } + ] + }, + { + "id": "Ball21", + "components": [ + { + "type": "RenderComponent", + "mesh": "project://Avocado.mesh", + "material": "GreenMaterial" + }, + { + "type": "TransformComponent", + "position": [0.0, 10.0, -15.0], + "rotation": [0.0, 0.0, 0.0], + "scale": [1.0, 1.0, 1.0] + }, + { + "type": "RigidbodyComponent", + "rigidbodyType": "Dynamic", + "mass": 1.0, + "restitution": 1.0, + "collisionShape": { + "type": "Sphere", + "radius": 1.0 + } + } + ] + }, + { + "id": "Ball22", + "components": [ + { + "type": "RenderComponent", + "mesh": "project://Avocado.mesh", + "material": "GreenMaterial" + }, + { + "type": "TransformComponent", + "position": [0.0, 10.0, -15.0], + "rotation": [0.0, 0.0, 0.0], + "scale": [1.0, 1.0, 1.0] + }, + { + "type": "RigidbodyComponent", + "rigidbodyType": "Dynamic", + "mass": 1.0, + "restitution": 1.0, + "collisionShape": { + "type": "Sphere", + "radius": 1.0 + } + } + ] + }, + { + "id": "Ball23", + "components": [ + { + "type": "RenderComponent", + "mesh": "project://Avocado.mesh", + "material": "GreenMaterial" + }, + { + "type": "TransformComponent", + "position": [0.0, 10.0, -15.0], + "rotation": [0.0, 0.0, 0.0], + "scale": [1.0, 1.0, 1.0] + }, + { + "type": "RigidbodyComponent", + "rigidbodyType": "Dynamic", + "mass": 1.0, + "restitution": 1.0, + "collisionShape": { + "type": "Sphere", + "radius": 1.0 + } + } + ] + }, + { + "id": "Ball24", + "components": [ + { + "type": "RenderComponent", + "mesh": "project://Avocado.mesh", + "material": "WhiteMaterial" + }, + { + "type": "TransformComponent", + "position": [0.0, 10.0, -15.0], + "rotation": [0.0, 0.0, 0.0], + "scale": [1.0, 1.0, 1.0] + }, + { + "type": "RigidbodyComponent", + "rigidbodyType": "Dynamic", + "mass": 1.0, + "restitution": 1.0, + "collisionShape": { + "type": "Sphere", + "radius": 1.0 + } + } + ] + }, + { + "id": "Ball25", + "components": [ + { + "type": "RenderComponent", + "mesh": "project://Avocado.mesh", + "material": "WhiteMaterial" + }, + { + "type": "TransformComponent", + "position": [0.0, 10.0, -15.0], + "rotation": [0.0, 0.0, 0.0], + "scale": [1.0, 1.0, 1.0] + }, + { + "type": "RigidbodyComponent", + "rigidbodyType": "Dynamic", + "mass": 1.0, + "restitution": 1.0, + "collisionShape": { + "type": "Sphere", + "radius": 1.0 + } + } + ] + }, + { + "id": "Ball26", + "components": [ + { + "type": "RenderComponent", + "mesh": "project://Avocado.mesh", + "material": "WhiteMaterial" + }, + { + "type": "TransformComponent", + "position": [0.0, 10.0, -15.0], + "rotation": [0.0, 0.0, 0.0], + "scale": [1.0, 1.0, 1.0] + }, + { + "type": "RigidbodyComponent", + "rigidbodyType": "Dynamic", + "mass": 1.0, + "restitution": 1.0, + "collisionShape": { + "type": "Sphere", + "radius": 1.0 + } + } + ] + }, + { + "id": "Ball27", + "components": [ + { + "type": "RenderComponent", + "mesh": "project://Avocado.mesh", + "material": "WhiteMaterial" + }, + { + "type": "TransformComponent", + "position": [0.0, 10.0, -15.0], + "rotation": [0.0, 0.0, 0.0], + "scale": [1.0, 1.0, 1.0] + }, + { + "type": "RigidbodyComponent", + "rigidbodyType": "Dynamic", + "mass": 1.0, + "restitution": 1.0, + "collisionShape": { + "type": "Sphere", + "radius": 1.0 + } + } + ] + }, + { + "id": "Ball28", + "components": [ + { + "type": "RenderComponent", + "mesh": "project://Avocado.mesh", + "material": "WhiteMaterial" + }, + { + "type": "TransformComponent", + "position": [0.0, 10.0, -15.0], + "rotation": [0.0, 0.0, 0.0], + "scale": [1.0, 1.0, 1.0] + }, + { + "type": "RigidbodyComponent", + "rigidbodyType": "Dynamic", + "mass": 1.0, + "restitution": 1.0, + "collisionShape": { + "type": "Sphere", + "radius": 1.0 + } + } + ] + }, + { + "id": "Ball29", + "components": [ + { + "type": "RenderComponent", + "mesh": "project://Avocado.mesh", + "material": "WhiteMaterial" + }, + { + "type": "TransformComponent", + "position": [0.0, 10.0, -15.0], + "rotation": [0.0, 0.0, 0.0], + "scale": [1.0, 1.0, 1.0] + }, + { + "type": "RigidbodyComponent", + "rigidbodyType": "Dynamic", + "mass": 1.0, + "restitution": 1.0, + "collisionShape": { + "type": "Sphere", + "radius": 1.0 + } + } + ] + }, + { + "id": "Ball30", + "components": [ + { + "type": "RenderComponent", + "mesh": "project://Avocado.mesh", + "material": "WhiteMaterial" + }, + { + "type": "TransformComponent", + "position": [0.0, 10.0, -15.0], + "rotation": [0.0, 0.0, 0.0], + "scale": [1.0, 1.0, 1.0] + }, + { + "type": "RigidbodyComponent", + "rigidbodyType": "Dynamic", + "mass": 1.0, + "restitution": 1.0, + "collisionShape": { + "type": "Sphere", + "radius": 1.0 + } + } + ] + }, + { + "id": "Ball31", + "components": [ + { + "type": "RenderComponent", + "mesh": "project://Avocado.mesh", + "material": "WhiteMaterial" + }, + { + "type": "TransformComponent", + "position": [0.0, 10.0, -15.0], + "rotation": [0.0, 0.0, 0.0], + "scale": [1.0, 1.0, 1.0] + }, + { + "type": "RigidbodyComponent", + "rigidbodyType": "Dynamic", + "mass": 1.0, + "restitution": 1.0, + "collisionShape": { + "type": "Sphere", + "radius": 1.0 + } + } + ] + }, + { + "id": "Ball32", + "components": [ + { + "type": "RenderComponent", + "mesh": "project://Avocado.mesh", + "material": "WhiteMaterial" + }, + { + "type": "TransformComponent", + "position": [0.0, 10.0, -15.0], + "rotation": [0.0, 0.0, 0.0], + "scale": [1.0, 1.0, 1.0] + }, + { + "type": "RigidbodyComponent", + "rigidbodyType": "Dynamic", + "mass": 1.0, + "restitution": 1.0, + "collisionShape": { + "type": "Sphere", + "radius": 1.0 + } + } + ] + }, + { + "id": "Ball33", + "components": [ + { + "type": "RenderComponent", + "mesh": "project://Avocado.mesh", + "material": "WhiteMaterial" + }, + { + "type": "TransformComponent", + "position": [0.0, 10.0, -15.0], + "rotation": [0.0, 0.0, 0.0], + "scale": [1.0, 1.0, 1.0] + }, + { + "type": "RigidbodyComponent", + "rigidbodyType": "Dynamic", + "mass": 1.0, + "restitution": 1.0, + "collisionShape": { + "type": "Sphere", + "radius": 1.0 + } + } + ] + }, + { + "id": "Ball34", + "components": [ + { + "type": "RenderComponent", + "mesh": "project://Avocado.mesh", + "material": "WhiteMaterial" + }, + { + "type": "TransformComponent", + "position": [0.0, 10.0, -15.0], + "rotation": [0.0, 0.0, 0.0], + "scale": [1.0, 1.0, 1.0] + }, + { + "type": "RigidbodyComponent", + "rigidbodyType": "Dynamic", + "mass": 1.0, + "restitution": 1.0, + "collisionShape": { + "type": "Sphere", + "radius": 1.0 + } + } + ] + }, + { + "id": "Ball35", + "components": [ + { + "type": "RenderComponent", + "mesh": "project://Avocado.mesh", + "material": "WhiteMaterial" + }, + { + "type": "TransformComponent", + "position": [0.0, 10.0, -15.0], + "rotation": [0.0, 0.0, 0.0], + "scale": [1.0, 1.0, 1.0] + }, + { + "type": "RigidbodyComponent", + "rigidbodyType": "Dynamic", + "mass": 1.0, + "restitution": 1.0, + "collisionShape": { + "type": "Sphere", + "radius": 1.0 + } + } + ] + }, + { + "id": "Ball36", + "components": [ + { + "type": "RenderComponent", + "mesh": "project://Avocado.mesh", + "material": "WhiteMaterial" + }, + { + "type": "TransformComponent", + "position": [0.0, 10.0, -15.0], + "rotation": [0.0, 0.0, 0.0], + "scale": [1.0, 1.0, 1.0] + }, + { + "type": "RigidbodyComponent", + "rigidbodyType": "Dynamic", + "mass": 1.0, + "restitution": 1.0, + "collisionShape": { + "type": "Sphere", + "radius": 1.0 + } + } + ] + }, + { + "id": "Ball37", + "components": [ + { + "type": "RenderComponent", + "mesh": "project://Avocado.mesh", + "material": "WhiteMaterial" + }, + { + "type": "TransformComponent", + "position": [0.0, 10.0, -15.0], + "rotation": [0.0, 0.0, 0.0], + "scale": [1.0, 1.0, 1.0] + }, + { + "type": "RigidbodyComponent", + "rigidbodyType": "Dynamic", + "mass": 1.0, + "restitution": 1.0, + "collisionShape": { + "type": "Sphere", + "radius": 1.0 + } + } + ] + }, + { + "id": "Ball38", + "components": [ + { + "type": "RenderComponent", + "mesh": "project://Avocado.mesh", + "material": "WhiteMaterial" + }, + { + "type": "TransformComponent", + "position": [0.0, 10.0, -15.0], + "rotation": [0.0, 0.0, 0.0], + "scale": [1.0, 1.0, 1.0] + }, + { + "type": "RigidbodyComponent", + "rigidbodyType": "Dynamic", + "mass": 1.0, + "restitution": 1.0, + "collisionShape": { + "type": "Sphere", + "radius": 1.0 + } + } + ] + }, + { + "id": "Ball39", + "components": [ + { + "type": "RenderComponent", + "mesh": "project://Avocado.mesh", + "material": "WhiteMaterial" + }, + { + "type": "TransformComponent", + "position": [0.0, 10.0, -15.0], + "rotation": [0.0, 0.0, 0.0], + "scale": [1.0, 1.0, 1.0] + }, + { + "type": "RigidbodyComponent", + "rigidbodyType": "Dynamic", + "mass": 1.0, + "restitution": 1.0, + "collisionShape": { + "type": "Sphere", + "radius": 1.0 + } + } + ] + }, + { + "id": "Ball40", + "components": [ + { + "type": "RenderComponent", + "mesh": "project://Avocado.mesh", + "material": "WhiteMaterial" + }, + { + "type": "TransformComponent", + "position": [0.0, 10.0, -15.0], + "rotation": [0.0, 0.0, 0.0], + "scale": [1.0, 1.0, 1.0] + }, + { + "type": "RigidbodyComponent", + "rigidbodyType": "Dynamic", + "mass": 1.0, + "restitution": 1.0, + "collisionShape": { + "type": "Sphere", + "radius": 1.0 + } + } + ] + }, + { + "id": "Ball41", + "components": [ + { + "type": "RenderComponent", + "mesh": "project://Avocado.mesh", + "material": "WhiteMaterial" + }, + { + "type": "TransformComponent", + "position": [0.0, 10.0, -15.0], + "rotation": [0.0, 0.0, 0.0], + "scale": [1.0, 1.0, 1.0] + }, + { + "type": "RigidbodyComponent", + "rigidbodyType": "Dynamic", + "mass": 1.0, + "restitution": 1.0, + "collisionShape": { + "type": "Sphere", + "radius": 1.0 + } + } + ] + }, + { + "id": "Ball42", + "components": [ + { + "type": "RenderComponent", + "mesh": "project://Avocado.mesh", + "material": "WhiteMaterial" + }, + { + "type": "TransformComponent", + "position": [0.0, 10.0, -15.0], + "rotation": [0.0, 0.0, 0.0], + "scale": [1.0, 1.0, 1.0] + }, + { + "type": "RigidbodyComponent", + "rigidbodyType": "Dynamic", + "mass": 1.0, + "restitution": 1.0, + "collisionShape": { + "type": "Sphere", + "radius": 1.0 + } + } + ] + }, + { + "id": "Ball43", + "components": [ + { + "type": "RenderComponent", + "mesh": "project://Avocado.mesh", + "material": "WhiteMaterial" + }, + { + "type": "TransformComponent", + "position": [0.0, 10.0, -15.0], + "rotation": [0.0, 0.0, 0.0], + "scale": [1.0, 1.0, 1.0] + }, + { + "type": "RigidbodyComponent", + "rigidbodyType": "Dynamic", + "mass": 1.0, + "restitution": 1.0, + "collisionShape": { + "type": "Sphere", + "radius": 1.0 + } + } + ] + }, + { + "id": "Ball44", + "components": [ + { + "type": "RenderComponent", + "mesh": "project://Avocado.mesh", + "material": "WhiteMaterial" + }, + { + "type": "TransformComponent", + "position": [0.0, 10.0, -15.0], + "rotation": [0.0, 0.0, 0.0], + "scale": [1.0, 1.0, 1.0] + }, + { + "type": "RigidbodyComponent", + "rigidbodyType": "Dynamic", + "mass": 1.0, + "restitution": 1.0, + "collisionShape": { + "type": "Sphere", + "radius": 1.0 + } + } + ] + }, + { + "id": "Ball45", + "components": [ + { + "type": "RenderComponent", + "mesh": "project://Avocado.mesh", + "material": "WhiteMaterial" + }, + { + "type": "TransformComponent", + "position": [0.0, 10.0, -15.0], + "rotation": [0.0, 0.0, 0.0], + "scale": [1.0, 1.0, 1.0] + }, + { + "type": "RigidbodyComponent", + "rigidbodyType": "Dynamic", + "mass": 1.0, + "restitution": 1.0, + "collisionShape": { + "type": "Sphere", + "radius": 1.0 + } + } + ] + }, + { + "id": "Ball46", + "components": [ + { + "type": "RenderComponent", + "mesh": "project://Avocado.mesh", + "material": "WhiteMaterial" + }, + { + "type": "TransformComponent", + "position": [0.0, 10.0, -15.0], + "rotation": [0.0, 0.0, 0.0], + "scale": [1.0, 1.0, 1.0] + }, + { + "type": "RigidbodyComponent", + "rigidbodyType": "Dynamic", + "mass": 1.0, + "restitution": 1.0, + "collisionShape": { + "type": "Sphere", + "radius": 1.0 + } + } + ] + }, + { + "id": "Ball47", + "components": [ + { + "type": "RenderComponent", + "mesh": "project://Avocado.mesh", + "material": "WhiteMaterial" + }, + { + "type": "TransformComponent", + "position": [0.0, 10.0, -15.0], + "rotation": [0.0, 0.0, 0.0], + "scale": [1.0, 1.0, 1.0] + }, + { + "type": "RigidbodyComponent", + "rigidbodyType": "Dynamic", + "mass": 1.0, + "restitution": 1.0, + "collisionShape": { + "type": "Sphere", + "radius": 1.0 + } + } + ] + }, + { + "id": "Ball48", + "components": [ + { + "type": "RenderComponent", + "mesh": "project://Avocado.mesh", + "material": "WhiteMaterial" + }, + { + "type": "TransformComponent", + "position": [0.0, 10.0, -15.0], + "rotation": [0.0, 0.0, 0.0], + "scale": [1.0, 1.0, 1.0] + }, + { + "type": "RigidbodyComponent", + "rigidbodyType": "Dynamic", + "mass": 1.0, + "restitution": 1.0, + "collisionShape": { + "type": "Sphere", + "radius": 1.0 + } + } + ] + }, + { + "id": "Ball49", + "components": [ + { + "type": "RenderComponent", + "mesh": "project://Avocado.mesh", + "material": "WhiteMaterial" + }, + { + "type": "TransformComponent", + "position": [0.0, 10.0, -15.0], + "rotation": [0.0, 0.0, 0.0], + "scale": [1.0, 1.0, 1.0] + }, + { + "type": "RigidbodyComponent", + "rigidbodyType": "Dynamic", + "mass": 1.0, + "restitution": 1.0, + "collisionShape": { + "type": "Sphere", + "radius": 1.0 + } + } + ] + }, + { + "id": "Ball50", + "components": [ + { + "type": "RenderComponent", + "mesh": "project://Avocado.mesh", + "material": "WhiteMaterial" + }, + { + "type": "TransformComponent", + "position": [0.0, 10.0, -15.0], + "rotation": [0.0, 0.0, 0.0], + "scale": [1.0, 1.0, 1.0] + }, + { + "type": "RigidbodyComponent", + "rigidbodyType": "Dynamic", + "mass": 1.0, + "restitution": 1.0, + "collisionShape": { + "type": "Sphere", + "radius": 1.0 + } + } + ] + }, + { + "id": "Ball51", + "components": [ + { + "type": "RenderComponent", + "mesh": "project://Avocado.mesh", + "material": "WhiteMaterial" + }, + { + "type": "TransformComponent", + "position": [0.0, 10.0, -15.0], + "rotation": [0.0, 0.0, 0.0], + "scale": [1.0, 1.0, 1.0] + }, + { + "type": "RigidbodyComponent", + "rigidbodyType": "Dynamic", + "mass": 1.0, + "restitution": 1.0, + "collisionShape": { + "type": "Sphere", + "radius": 1.0 + } + } + ] + }, + { + "id": "Ball52", + "components": [ + { + "type": "RenderComponent", + "mesh": "project://Avocado.mesh", + "material": "WhiteMaterial" + }, + { + "type": "TransformComponent", + "position": [0.0, 10.0, -15.0], + "rotation": [0.0, 0.0, 0.0], + "scale": [1.0, 1.0, 1.0] + }, + { + "type": "RigidbodyComponent", + "rigidbodyType": "Dynamic", + "mass": 1.0, + "restitution": 1.0, + "collisionShape": { + "type": "Sphere", + "radius": 1.0 + } + } + ] + }, + { + "id": "Ball53", + "components": [ + { + "type": "RenderComponent", + "mesh": "project://Avocado.mesh", + "material": "WhiteMaterial" + }, + { + "type": "TransformComponent", + "position": [0.0, 10.0, -15.0], + "rotation": [0.0, 0.0, 0.0], + "scale": [1.0, 1.0, 1.0] + }, + { + "type": "RigidbodyComponent", + "rigidbodyType": "Dynamic", + "mass": 1.0, + "restitution": 1.0, + "collisionShape": { + "type": "Sphere", + "radius": 1.0 + } + } + ] + }, + { + "id": "Ball54", + "components": [ + { + "type": "RenderComponent", + "mesh": "project://Avocado.mesh", + "material": "WhiteMaterial" + }, + { + "type": "TransformComponent", + "position": [0.0, 10.0, -15.0], + "rotation": [0.0, 0.0, 0.0], + "scale": [1.0, 1.0, 1.0] + }, + { + "type": "RigidbodyComponent", + "rigidbodyType": "Dynamic", + "mass": 1.0, + "restitution": 1.0, + "collisionShape": { + "type": "Sphere", + "radius": 1.0 + } + } + ] + }, + { + "id": "Ball55", + "components": [ + { + "type": "RenderComponent", + "mesh": "project://Avocado.mesh", + "material": "WhiteMaterial" + }, + { + "type": "TransformComponent", + "position": [0.0, 10.0, -15.0], + "rotation": [0.0, 0.0, 0.0], + "scale": [1.0, 1.0, 1.0] + }, + { + "type": "RigidbodyComponent", + "rigidbodyType": "Dynamic", + "mass": 1.0, + "restitution": 1.0, + "collisionShape": { + "type": "Sphere", + "radius": 1.0 + } + } + ] + }, + { + "id": "Ball56", + "components": [ + { + "type": "RenderComponent", + "mesh": "project://Avocado.mesh", + "material": "WhiteMaterial" + }, + { + "type": "TransformComponent", + "position": [0.0, 10.0, -15.0], + "rotation": [0.0, 0.0, 0.0], + "scale": [1.0, 1.0, 1.0] + }, + { + "type": "RigidbodyComponent", + "rigidbodyType": "Dynamic", + "mass": 1.0, + "restitution": 1.0, + "collisionShape": { + "type": "Sphere", + "radius": 1.0 + } + } + ] + }, + { + "id": "Ball57", + "components": [ + { + "type": "RenderComponent", + "mesh": "project://Avocado.mesh", + "material": "WhiteMaterial" + }, + { + "type": "TransformComponent", + "position": [0.0, 10.0, -15.0], + "rotation": [0.0, 0.0, 0.0], + "scale": [1.0, 1.0, 1.0] + }, + { + "type": "RigidbodyComponent", + "rigidbodyType": "Dynamic", + "mass": 1.0, + "restitution": 1.0, + "collisionShape": { + "type": "Sphere", + "radius": 1.0 + } + } + ] + }, + { + "id": "Ball58", + "components": [ + { + "type": "RenderComponent", + "mesh": "project://Avocado.mesh", + "material": "WhiteMaterial" + }, + { + "type": "TransformComponent", + "position": [0.0, 10.0, -15.0], + "rotation": [0.0, 0.0, 0.0], + "scale": [1.0, 1.0, 1.0] + }, + { + "type": "RigidbodyComponent", + "rigidbodyType": "Dynamic", + "mass": 1.0, + "restitution": 1.0, + "collisionShape": { + "type": "Sphere", + "radius": 1.0 + } + } + ] + }, + { + "id": "Ball59", + "components": [ + { + "type": "RenderComponent", + "mesh": "project://Avocado.mesh", + "material": "WhiteMaterial" + }, + { + "type": "TransformComponent", + "position": [0.0, 10.0, -15.0], + "rotation": [0.0, 0.0, 0.0], + "scale": [1.0, 1.0, 1.0] + }, + { + "type": "RigidbodyComponent", + "rigidbodyType": "Dynamic", + "mass": 1.0, + "restitution": 1.0, + "collisionShape": { + "type": "Sphere", + "radius": 1.0 + } + } + ] + }, + { + "id": "Ball60", + "components": [ + { + "type": "RenderComponent", + "mesh": "project://Avocado.mesh", + "material": "WhiteMaterial" + }, + { + "type": "TransformComponent", + "position": [0.0, 10.0, -15.0], + "rotation": [0.0, 0.0, 0.0], + "scale": [1.0, 1.0, 1.0] + }, + { + "type": "RigidbodyComponent", + "rigidbodyType": "Dynamic", + "mass": 1.0, + "restitution": 1.0, + "collisionShape": { + "type": "Sphere", + "radius": 1.0 + } + } + ] + }, + { + "id": "Ball61", + "components": [ + { + "type": "RenderComponent", + "mesh": "project://Avocado.mesh", + "material": "WhiteMaterial" + }, + { + "type": "TransformComponent", + "position": [0.0, 10.0, -15.0], + "rotation": [0.0, 0.0, 0.0], + "scale": [1.0, 1.0, 1.0] + }, + { + "type": "RigidbodyComponent", + "rigidbodyType": "Dynamic", + "mass": 1.0, + "restitution": 1.0, + "collisionShape": { + "type": "Sphere", + "radius": 1.0 + } + } + ] + }, + { + "id": "Map", + "components": [ + { + "type": "TransformComponent", + "position": [0.0, 0.0, 0.0], + "rotation": [0.0, 0.0, 0.0], + "scale": [1.0, 1.0, 1.0] + } + ], + "children": [ + { + "id": "Ground", + "components": [ + { + "type": "TransformComponent", + "position": [0.0, -5.0, -15.0], + "rotation": [0.0, 0.0, 0.0], + "scale": [1.0, 1.0, 1.0] + }, + { + "type": "RigidbodyComponent", + "rigidbodyType": "Static", + "mass": 0.0, + "restitution": 1.0, + "collisionShape": { + "type": "Box", + "halfExtents": [100.0, 1.0, 100.0] + } + } + ] + }, + { + "id": "WallRight", + "components": [ + { + "type": "TransformComponent", + "position": [99.0, 0.0, -14.0], + "rotation": [0.0, 0.0, 0.0], + "scale": [1.0, 1.0, 1.0] + }, + { + "type": "RigidbodyComponent", + "rigidbodyType": "Static", + "mass": 0.0, + "restitution": 0.0, + "collisionShape": { + "type": "Box", + "halfExtents": [1.0, 4.0, 99.0] + } + } + ] + }, + { + "id": "WallLeft", + "components": [ + { + "type": "TransformComponent", + "position": [-99.0, 0.0, -14.0], + "rotation": [0.0, 0.0, 0.0], + "scale": [1.0, 1.0, 1.0] + }, + { + "type": "RigidbodyComponent", + "rigidbodyType": "Static", + "mass": 0.0, + "restitution": 0.0, + "collisionShape": { + "type": "Box", + "halfExtents": [1.0, 4.0, 99.0] + } + } + ] + }, + { + "id": "WallFront", + "components": [ + { + "type": "TransformComponent", + "position": [0.0, 0.0, 84.0], + "rotation": [0.0, 0.0, 0.0], + "scale": [1.0, 1.0, 1.0] + }, + { + "type": "RigidbodyComponent", + "rigidbodyType": "Static", + "mass": 0.0, + "restitution": 0.0, + "collisionShape": { + "type": "Box", + "halfExtents": [98.0, 4.0, 1.0] + } + } + ] + }, + { + "id": "WallBack", + "components": [ + { + "type": "TransformComponent", + "position": [0.0, 0.0, -114.0], + "rotation": [0.0, 0.0, 0.0], + "scale": [1.0, 1.0, 1.0] + }, + { + "type": "RigidbodyComponent", + "rigidbodyType": "Static", + "mass": 0.0, + "restitution": 0.0, + "collisionShape": { + "type": "Box", + "halfExtents": [100.0, 4.0, 1.0] + } + } + ] + } + ] + } + ], + "materials": [ + { + "id": "GreenMaterial", + "pipeline": "DefaultPipeline", + "baseColor": [0.0, 1.0, 0.0, 1.0], + "albedoTexture": "project://lost.tx", + }, + { + "id": "RedMaterial", + "pipeline": "DefaultPipeline", + "baseColor": [1.0, 0.0, 0.0, 1.0], + "albedoTexture": "project://lost.tx", + }, + { + "id": "BlueMaterial", + "pipeline": "DefaultPipeline", + "baseColor": [0.0, 0.0, 1.0, 1.0], + "albedoTexture": "project://lost.tx", + }, + { + "id": "WhiteMaterial", + "pipeline": "DefaultPipeline", + "baseColor": [1.0, 1.0, 1.0, 1.0], + "albedoTexture": "project://lost.tx", + }, + ], + "pipelines": [ + { + "id": "DefaultPipeline", + "shaderStages": [ + { + "type": "Vertex", + "shaderPath": "shaders://default.vert" + }, + { + "type": "Fragment", + "shaderPath": "shaders://default.frag" + } + ] + } + ], + "activeCamera": "CameraTransformOverride.Camera.RotationHelper", +} diff --git a/scripts/MainScene/Camera.lua b/scripts/MainScene/Camera.lua new file mode 100644 index 0000000..8ff3834 --- /dev/null +++ b/scripts/MainScene/Camera.lua @@ -0,0 +1,45 @@ +this.on_init = function() + this.speed = 0.1 + this.original_position = this.position + this.angles = Vec3:new() + this.mouse_sens = 0.01 +end + +this.on_update = function() + local deltaMouseMovement = Input.getDeltaMousePos() + this.angles.y = this.angles.y - deltaMouseMovement.x * this.mouse_sens + this.eulerAngles = this.angles + + helper = this:getChild('RotationHelper') + + if Input.getKeyJustPressed(Input.KeyCode.Enter) then + gotoScene('SideScene') + end + if Input.getKeyJustPressed(Input.KeyCode.T) then + gotoScene('TestScene') + end + + + local pos = this.position + if Input.getKeyDown(Input.KeyCode.Up) then + pos = pos + helper.forward * this.speed + end + if Input.getKeyDown(Input.KeyCode.Down) then + pos = pos - helper.forward * this.speed + end + if Input.getKeyDown(Input.KeyCode.Right) then + pos = pos + helper.right * this.speed + end + if Input.getKeyDown(Input.KeyCode.Left) then + pos = pos - helper.right * this.speed + end + + if Input.getMouseButtonJustPressed(0) then + hit = rayCast(this.worldPosition, helper.forward, 300) + if(hit.hasHit) then + hit.object.position = hit.object.position + Vec3:new(0, 0, -15) + end + end + + this.position = pos +end diff --git a/scripts/MainScene/CameraHelper.lua b/scripts/MainScene/CameraHelper.lua new file mode 100644 index 0000000..41266f0 --- /dev/null +++ b/scripts/MainScene/CameraHelper.lua @@ -0,0 +1,10 @@ +this.on_init = function() + this.angles = Vec3:new() + this.mouse_sens = 0.01 +end + +this.on_update = function() + local deltaMouseMovement = Input.getDeltaMousePos() + this.angles.x = this.angles.x - deltaMouseMovement.y * this.mouse_sens + this.eulerAngles = this.angles +end diff --git a/scripts/MainScene/Child.lua b/scripts/MainScene/Child.lua new file mode 100644 index 0000000..2c4a2cf --- /dev/null +++ b/scripts/MainScene/Child.lua @@ -0,0 +1,14 @@ +this.on_init = function () + this.custom_eulerangles = Vec3:new() + this.custom_angularvelocity = Vec3:new(0, 0.01, 0) +end + +this.on_fixedupdate = function () + if Input.getKeyDown(Input.KeyCode.Left) then + this.custom_eulerangles:add(Vec3:new(0,0.01,0)) + end + if Input.getKeyDown(Input.KeyCode.Right) then + this.custom_eulerangles:sub(Vec3:new(0,0.01,0)) + end + this.eulerAngles = this.custom_eulerangles +end diff --git a/scripts/MainScene/Player.lua b/scripts/MainScene/Player.lua new file mode 100644 index 0000000..90782f6 --- /dev/null +++ b/scripts/MainScene/Player.lua @@ -0,0 +1,22 @@ +-- this.on_collisionenter = function(other) + -- other.position = other.position + Vec3:new(3.2, 0, 0) +-- end + +this.on_update = function () + rb = this:getComponent(Rigidbody) + if Input.getKeyDown(Input.KeyCode.Space) then + rb:addForce(Vec3:new(0, 100, 0)) + end + if Input.getKeyDown(Input.KeyCode.D) then + rb:addForce(Vec3:new(10, 0, 0)) + end + if Input.getKeyDown(Input.KeyCode.A) then + rb:addForce(Vec3:new(-10, 0, 0)) + end + if Input.getKeyDown(Input.KeyCode.W) then + rb:addForce(Vec3:new(0, 0, -10)) + end + if Input.getKeyDown(Input.KeyCode.S) then + rb:addForce(Vec3:new(0, 0, 10)) + end +end diff --git a/scripts/SideScene/Camera.lua b/scripts/SideScene/Camera.lua new file mode 100644 index 0000000..906993d --- /dev/null +++ b/scripts/SideScene/Camera.lua @@ -0,0 +1,33 @@ +this.on_init = function() + this.speed = 0.1 + this.original_position = this.position + this.cursor_locked = false +end + +this.on_fixedupdate = function() + if Input.getKeyJustPressed(Input.KeyCode.Enter) then + gotoScene('MainScene') + end + + if Input.getKeyDown(Input.KeyCode.L) then + if this.cursor_locked then + Input.unlockCursor() + else + Input.lockCursor() + end + this.cursor_locked = not this.cursor_locked + end + + if Input.getKeyDown(Input.KeyCode.Up) then + this.position = this.position - Vec3:new(0, 0, 1) * this.speed + end + if Input.getKeyDown(Input.KeyCode.Down) then + this.position = this.position + Vec3:new(0, 0, 1) * this.speed + end + if Input.getKeyDown(Input.KeyCode.Right) then + this.position = this.position + Vec3:new(1, 0, 0) * this.speed + end + if Input.getKeyDown(Input.KeyCode.Left) then + this.position = this.position - Vec3:new(1, 0, 0) * this.speed + end +end diff --git a/scripts/SideScene/Child.lua b/scripts/SideScene/Child.lua new file mode 100644 index 0000000..2c4a2cf --- /dev/null +++ b/scripts/SideScene/Child.lua @@ -0,0 +1,14 @@ +this.on_init = function () + this.custom_eulerangles = Vec3:new() + this.custom_angularvelocity = Vec3:new(0, 0.01, 0) +end + +this.on_fixedupdate = function () + if Input.getKeyDown(Input.KeyCode.Left) then + this.custom_eulerangles:add(Vec3:new(0,0.01,0)) + end + if Input.getKeyDown(Input.KeyCode.Right) then + this.custom_eulerangles:sub(Vec3:new(0,0.01,0)) + end + this.eulerAngles = this.custom_eulerangles +end diff --git a/scripts/SideScene/Ghost.lua b/scripts/SideScene/Ghost.lua new file mode 100644 index 0000000..82e4f30 --- /dev/null +++ b/scripts/SideScene/Ghost.lua @@ -0,0 +1,8 @@ +this.on_collisionenter = function(other) + print(other.name) +end + +this.on_update = function () + local player = getObject('Player.Child') + this.position = player.position + Vec3:new(0, 10, 0) +end diff --git a/scripts/SideScene/Player.lua b/scripts/SideScene/Player.lua new file mode 100644 index 0000000..0588187 --- /dev/null +++ b/scripts/SideScene/Player.lua @@ -0,0 +1,25 @@ +-- this.on_collisionenter = function(other) + -- other.position = other.position + Vec3:new(3.2, 0, 0) +-- end +this.on_init = function() + -- print(this:getChild('Child').position:to_string()) +end + +this.on_update = function () + rb = this:getComponent(Rigidbody) + if Input.getKeyDown(Input.KeyCode.Space) then + rb:addForce(Vec3:new(0, 100, 0)) + end + if Input.getKeyDown(Input.KeyCode.D) then + rb:addForce(Vec3:new(10, 0, 0)) + end + if Input.getKeyDown(Input.KeyCode.A) then + rb:addForce(Vec3:new(-10, 0, 0)) + end + if Input.getKeyDown(Input.KeyCode.W) then + rb:addForce(Vec3:new(0, 0, -10)) + end + if Input.getKeyDown(Input.KeyCode.S) then + rb:addForce(Vec3:new(0, 0, 10)) + end +end diff --git a/scripts/TestScene/Camera.lua b/scripts/TestScene/Camera.lua new file mode 100644 index 0000000..61abb3d --- /dev/null +++ b/scripts/TestScene/Camera.lua @@ -0,0 +1,66 @@ +this.on_init = function() + this.speed = 2.1 + this.original_position = this.position + this.angles = Vec3:new() + this.mouse_sens = 0.01 + this.cursor_locked = false +end + +this.toggleCursor = function() + if this.cursor_locked then + Input.unlockCursor() + else + Input.lockCursor() + end + this.cursor_locked = not this.cursor_locked +end + +this.on_update = function() + local deltaMouseMovement = Input.getDeltaMousePos() + this.angles.y = this.angles.y - deltaMouseMovement.x * this.mouse_sens + this.eulerAngles = this.angles + + helper = this:getChild('RotationHelper') + + if Input.getKeyJustPressed(Input.KeyCode.Enter) then + gotoScene('SideScene') + end + + local pos = this.position + if Input.getKeyDown(Input.KeyCode.Up) then + pos = pos + helper.forward * this.speed + end + if Input.getKeyDown(Input.KeyCode.Down) then + pos = pos - helper.forward * this.speed + end + if Input.getKeyDown(Input.KeyCode.Right) then + pos = pos + helper.right * this.speed + end + if Input.getKeyDown(Input.KeyCode.Left) then + pos = pos - helper.right * this.speed + end + + local mb0 = Input.getMouseButtonJustPressed(0) + local mb1 = Input.getMouseButtonJustPressed(1) + local mb2 = Input.getMouseButtonJustPressed(2) + + if mb0 or mb1 then + hit = rayCast(this.worldPosition, helper.forward, 300) + if(hit.hasHit) then + local hitForce = 1000 + rb = hit.object:getComponent(Rigidbody) + if mb0 then + rb:addForce(hit.hitNormal * -hitForce) + elseif mb1 then + rb:addForce(hit.hitNormal * hitForce) + end + end + end + + if mb2 then + this.toggleCursor() + end + + this.position = pos +end + diff --git a/scripts/TestScene/CameraHelper.lua b/scripts/TestScene/CameraHelper.lua new file mode 100644 index 0000000..41266f0 --- /dev/null +++ b/scripts/TestScene/CameraHelper.lua @@ -0,0 +1,10 @@ +this.on_init = function() + this.angles = Vec3:new() + this.mouse_sens = 0.01 +end + +this.on_update = function() + local deltaMouseMovement = Input.getDeltaMousePos() + this.angles.x = this.angles.x - deltaMouseMovement.y * this.mouse_sens + this.eulerAngles = this.angles +end diff --git a/scripts/TestScene/Child.lua b/scripts/TestScene/Child.lua new file mode 100644 index 0000000..2c4a2cf --- /dev/null +++ b/scripts/TestScene/Child.lua @@ -0,0 +1,14 @@ +this.on_init = function () + this.custom_eulerangles = Vec3:new() + this.custom_angularvelocity = Vec3:new(0, 0.01, 0) +end + +this.on_fixedupdate = function () + if Input.getKeyDown(Input.KeyCode.Left) then + this.custom_eulerangles:add(Vec3:new(0,0.01,0)) + end + if Input.getKeyDown(Input.KeyCode.Right) then + this.custom_eulerangles:sub(Vec3:new(0,0.01,0)) + end + this.eulerAngles = this.custom_eulerangles +end diff --git a/scripts/TestScene/Player.lua b/scripts/TestScene/Player.lua new file mode 100644 index 0000000..90782f6 --- /dev/null +++ b/scripts/TestScene/Player.lua @@ -0,0 +1,22 @@ +-- this.on_collisionenter = function(other) + -- other.position = other.position + Vec3:new(3.2, 0, 0) +-- end + +this.on_update = function () + rb = this:getComponent(Rigidbody) + if Input.getKeyDown(Input.KeyCode.Space) then + rb:addForce(Vec3:new(0, 100, 0)) + end + if Input.getKeyDown(Input.KeyCode.D) then + rb:addForce(Vec3:new(10, 0, 0)) + end + if Input.getKeyDown(Input.KeyCode.A) then + rb:addForce(Vec3:new(-10, 0, 0)) + end + if Input.getKeyDown(Input.KeyCode.W) then + rb:addForce(Vec3:new(0, 0, -10)) + end + if Input.getKeyDown(Input.KeyCode.S) then + rb:addForce(Vec3:new(0, 0, 10)) + end +end