├── .gitignore ├── 3.2_collision_polygon_2d.png ├── LICENSE.md ├── Main.tscn ├── README.md ├── RigidBody2D.tscn ├── StaticBody2D.gd ├── StaticBody2D.tscn ├── ball.png ├── ball.png.import ├── convert_to_2d_mesh.png ├── convert_to_2d_mesh.png.import ├── create_2d_mesh.png ├── create_2d_mesh.png.import ├── default_env.tres ├── icon.png ├── icon.png.import ├── project.godot ├── shape.png └── shape.png.import /.gitignore: -------------------------------------------------------------------------------- 1 | .import 2 | *.*~ -------------------------------------------------------------------------------- /3.2_collision_polygon_2d.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xrayez/godot-mesh-instance-collision-2d/9c85a8656cf32e0f0470b04996d6bdee946a3bd8/3.2_collision_polygon_2d.png -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 Andrii Doroshenko 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 6 | 7 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 8 | 9 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /Main.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=3 format=2] 2 | 3 | [ext_resource path="res://RigidBody2D.tscn" type="PackedScene" id=1] 4 | [ext_resource path="res://StaticBody2D.tscn" type="PackedScene" id=2] 5 | 6 | [node name="Main" type="Node2D"] 7 | 8 | [node name="RigidBody2D" parent="." instance=ExtResource( 1 )] 9 | position = Vector2( -161.963, -181.889 ) 10 | 11 | [node name="StaticBody2D" parent="." instance=ExtResource( 2 )] 12 | 13 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Create collision shapes from sprites in Godot 3.1 2 | 3 | *Notice: this will not work in 3.0!* 4 | 5 | *Notice 2: this is probably outdated with the new features added in 3.2:* 6 | 7 | ![Create CollisionPolygon2D](3.2_collision_polygon_2d.png) 8 | 9 | ## Instructions on how to create MeshInstance from Sprite 10 | 11 | 1. Create a sprite and assign its texture. 12 | v 13 | 2. Select the node sprite, at the top panel of the viewport click "Sprite". 14 | 15 | 3. In the popup menu, press "Convert to 2D Mesh". 16 | 17 | ![Convert to 2D Mesh](convert_to_2d_mesh.png) 18 | 19 | 4. In the window dialog, press "Create 2D Mesh" button. 20 | 21 | ![Convert to 2D Mesh](create_2d_mesh.png) 22 | 23 | 5. Study StaticBody2D.gd for further explanations. 24 | 25 | The created `MeshInstance` can be used to retrieve its faces consisting of 26 | triangles which can be added to collision body dynamically. -------------------------------------------------------------------------------- /RigidBody2D.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=3 format=2] 2 | 3 | [ext_resource path="res://ball.png" type="Texture" id=1] 4 | 5 | [sub_resource type="CircleShape2D" id=1] 6 | 7 | custom_solver_bias = 0.0 8 | radius = 24.0 9 | 10 | [node name="RigidBody2D" type="RigidBody2D"] 11 | input_pickable = false 12 | collision_layer = 1 13 | collision_mask = 1 14 | mode = 0 15 | mass = 1.0 16 | gravity_scale = 1.0 17 | custom_integrator = false 18 | continuous_cd = 0 19 | contacts_reported = 0 20 | contact_monitor = false 21 | sleeping = false 22 | can_sleep = true 23 | linear_velocity = Vector2( 0, 0 ) 24 | linear_damp = -1.0 25 | angular_velocity = 0.0 26 | angular_damp = -1.0 27 | 28 | [node name="CollisionShape2D" type="CollisionShape2D" parent="."] 29 | shape = SubResource( 1 ) 30 | _sections_unfolded = [ "shape" ] 31 | 32 | [node name="Sprite" type="Sprite" parent="."] 33 | texture = ExtResource( 1 ) 34 | 35 | -------------------------------------------------------------------------------- /StaticBody2D.gd: -------------------------------------------------------------------------------- 1 | extends StaticBody2D 2 | 3 | 4 | func _ready(): 5 | # Get triangles points from mesh 6 | var points = $MeshInstance.mesh.get_faces() 7 | 8 | var idx = 0 9 | var shapes = [] 10 | 11 | while idx < points.size(): 12 | 13 | # Each three vertices represent one triangle 14 | # Converts automatically from Vector3 to Vector2! 15 | var tri_points = PoolVector2Array([points[idx], points[idx + 1], points[idx + 2]]) 16 | 17 | # Create an actual triangle shape 18 | var tri_shape = ConvexPolygonShape2D.new() 19 | tri_shape.points = tri_points 20 | shapes.push_back(tri_shape) 21 | 22 | idx += 3 23 | 24 | for sh in shapes: 25 | # Add created shapes to this collision body 26 | # `0` indicates the first shape owner which is `CollisionShape2D` 27 | shape_owner_add_shape(0, sh) 28 | -------------------------------------------------------------------------------- /StaticBody2D.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=4 format=2] 2 | 3 | [ext_resource path="res://StaticBody2D.gd" type="Script" id=1] 4 | [ext_resource path="res://shape.png" type="Texture" id=2] 5 | 6 | [sub_resource type="ArrayMesh" id=1] 7 | 8 | blend_shape_mode = 1 9 | custom_aabb = AABB( 0, 0, 0, 0, 0, 0 ) 10 | surfaces/0 = { 11 | "aabb": AABB( -236.1, -115.5, 0, 463.5, 202.6, 0 ), 12 | "array_data": PoolByteArray( 154, 25, 82, 67, 51, 51, 227, 194, 205, 12, 105, 63, 102, 102, 102, 61, 154, 25, 89, 67, 51, 51, 223, 194, 205, 140, 108, 63, 51, 51, 131, 61, 154, 25, 89, 67, 102, 102, 219, 194, 205, 140, 108, 63, 102, 102, 146, 61, 154, 25, 98, 67, 154, 153, 199, 194, 205, 12, 113, 63, 154, 153, 225, 61, 154, 25, 98, 67, 0, 0, 190, 194, 205, 12, 113, 63, 0, 0, 4, 62, 102, 102, 99, 67, 205, 204, 169, 194, 51, 179, 113, 63, 102, 102, 44, 62, 52, 179, 97, 67, 205, 204, 169, 194, 154, 217, 112, 63, 102, 102, 44, 62, 52, 179, 88, 67, 154, 153, 15, 194, 154, 89, 108, 63, 51, 51, 184, 62, 0, 128, 87, 67, 154, 153, 15, 194, 0, 192, 107, 63, 51, 51, 184, 62, 0, 128, 78, 67, 208, 204, 188, 192, 0, 64, 103, 63, 51, 51, 244, 62, 204, 76, 77, 67, 208, 204, 188, 192, 102, 166, 102, 63, 51, 51, 244, 62, 204, 76, 60, 67, 208, 204, 224, 65, 102, 38, 94, 63, 154, 25, 28, 63, 0, 0, 59, 67, 208, 204, 224, 65, 0, 128, 93, 63, 154, 25, 28, 63, 0, 0, 35, 67, 104, 102, 96, 66, 0, 128, 81, 63, 154, 25, 56, 63, 204, 204, 32, 67, 104, 102, 96, 66, 102, 102, 80, 63, 154, 25, 56, 63, 52, 179, 15, 67, 52, 51, 138, 66, 154, 217, 71, 63, 154, 25, 69, 63, 102, 102, 12, 67, 52, 51, 138, 66, 51, 51, 70, 63, 154, 25, 69, 63, 0, 0, 235, 66, 52, 51, 162, 66, 0, 192, 58, 63, 154, 25, 81, 63, 52, 51, 226, 66, 52, 51, 162, 66, 205, 140, 56, 63, 154, 25, 81, 63, 152, 153, 178, 66, 52, 51, 174, 66, 102, 166, 44, 63, 154, 25, 87, 63, 152, 153, 27, 66, 52, 51, 174, 66, 51, 115, 19, 63, 154, 25, 87, 63, 152, 153, 27, 66, 204, 204, 171, 66, 51, 115, 19, 63, 102, 230, 85, 63, 160, 153, 1, 193, 204, 204, 163, 66, 102, 230, 247, 62, 102, 230, 81, 63, 160, 153, 1, 193, 52, 51, 161, 66, 102, 230, 247, 62, 154, 153, 80, 63, 52, 51, 130, 194, 52, 51, 133, 66, 102, 230, 190, 62, 154, 153, 66, 63, 52, 51, 130, 194, 0, 0, 131, 66, 102, 230, 190, 62, 0, 128, 65, 63, 52, 51, 224, 194, 0, 0, 66, 66, 102, 230, 143, 62, 0, 128, 48, 63, 52, 51, 224, 194, 204, 204, 60, 66, 102, 230, 143, 62, 51, 51, 47, 63, 154, 25, 38, 195, 152, 153, 137, 65, 205, 204, 51, 62, 51, 51, 17, 63, 154, 25, 38, 195, 96, 102, 126, 65, 205, 204, 51, 62, 102, 230, 15, 63, 154, 25, 75, 195, 204, 204, 144, 193, 154, 153, 211, 61, 205, 204, 219, 62, 154, 25, 75, 195, 104, 102, 162, 193, 154, 153, 211, 61, 102, 102, 215, 62, 154, 25, 87, 195, 52, 51, 13, 194, 154, 153, 163, 61, 102, 102, 185, 62, 154, 25, 87, 195, 102, 102, 22, 194, 154, 153, 163, 61, 205, 204, 180, 62, 154, 25, 102, 195, 0, 0, 133, 194, 51, 51, 79, 61, 0, 0, 118, 62, 154, 25, 102, 195, 154, 153, 139, 194, 51, 51, 79, 61, 205, 204, 104, 62, 154, 25, 108, 195, 51, 51, 171, 194, 51, 51, 31, 61, 154, 153, 41, 62, 154, 25, 108, 195, 51, 51, 198, 194, 51, 51, 31, 61, 51, 51, 231, 61, 51, 51, 106, 195, 51, 51, 198, 194, 102, 102, 46, 61, 51, 51, 231, 61, 51, 51, 99, 195, 51, 51, 222, 194, 102, 102, 102, 61, 51, 51, 135, 61, 0, 128, 96, 195, 51, 51, 222, 194, 0, 0, 124, 61, 51, 51, 135, 61, 154, 25, 92, 195, 154, 153, 226, 194, 154, 153, 143, 61, 51, 51, 107, 61, 154, 25, 92, 195, 102, 102, 230, 194, 154, 153, 143, 61, 205, 204, 76, 61, 102, 230, 73, 195, 205, 204, 227, 194, 102, 102, 216, 61, 154, 153, 97, 61, 102, 230, 73, 195, 51, 51, 224, 194, 102, 102, 216, 61, 102, 102, 126, 61, 102, 230, 64, 195, 51, 51, 212, 194, 102, 102, 252, 61, 51, 51, 175, 61, 102, 230, 64, 195, 154, 153, 206, 194, 102, 102, 252, 61, 154, 153, 197, 61, 154, 153, 51, 195, 51, 51, 140, 194, 205, 204, 24, 62, 154, 153, 103, 62, 205, 204, 50, 195, 51, 51, 140, 194, 102, 102, 26, 62, 154, 153, 103, 62, 205, 204, 36, 195, 102, 102, 56, 194, 102, 102, 54, 62, 205, 204, 163, 62, 0, 0, 36, 195, 102, 102, 56, 194, 0, 0, 56, 62, 205, 204, 163, 62, 0, 0, 24, 195, 102, 102, 0, 194, 0, 0, 80, 62, 205, 204, 191, 62, 205, 76, 22, 195, 102, 102, 0, 194, 102, 102, 83, 62, 205, 204, 191, 62, 154, 153, 248, 194, 152, 153, 65, 193, 51, 179, 131, 62, 205, 204, 231, 62, 0, 0, 245, 194, 152, 153, 65, 193, 0, 128, 133, 62, 205, 204, 231, 62, 0, 0, 185, 194, 192, 204, 156, 64, 0, 128, 163, 62, 102, 230, 4, 63, 52, 51, 179, 194, 192, 204, 156, 64, 102, 102, 166, 62, 102, 230, 4, 63, 204, 204, 74, 194, 48, 51, 167, 65, 205, 76, 205, 62, 102, 230, 20, 63, 204, 204, 58, 194, 48, 51, 167, 65, 205, 76, 209, 62, 102, 230, 20, 63, 0, 51, 19, 64, 152, 153, 11, 66, 102, 38, 1, 63, 102, 230, 34, 63, 64, 51, 51, 65, 152, 153, 11, 66, 154, 153, 5, 63, 102, 230, 34, 63, 48, 51, 21, 66, 152, 153, 27, 66, 102, 166, 18, 63, 102, 230, 38, 63, 204, 204, 177, 66, 152, 153, 27, 66, 51, 115, 44, 63, 102, 230, 38, 63, 204, 204, 217, 66, 152, 153, 5, 66, 51, 115, 54, 63, 102, 102, 33, 63, 204, 204, 217, 66, 204, 204, 2, 66, 51, 115, 54, 63, 51, 179, 32, 63, 204, 204, 253, 66, 152, 153, 189, 65, 51, 115, 63, 63, 51, 179, 23, 63, 204, 204, 253, 66, 208, 204, 184, 65, 51, 115, 63, 63, 154, 25, 23, 63, 102, 230, 19, 67, 192, 204, 76, 64, 51, 243, 73, 63, 51, 51, 3, 63, 102, 230, 19, 67, 0, 0, 192, 63, 51, 243, 73, 63, 0, 128, 1, 63, 102, 230, 36, 67, 52, 51, 243, 193, 51, 115, 82, 63, 51, 51, 195, 62, 102, 230, 36, 67, 204, 204, 4, 194, 51, 115, 82, 63, 154, 153, 189, 62, 204, 76, 52, 67, 51, 51, 202, 194, 102, 38, 90, 63, 51, 51, 215, 61, 0, 0, 54, 67, 51, 51, 202, 194, 0, 0, 91, 63, 51, 51, 215, 61, 102, 230, 61, 67, 51, 51, 224, 194, 51, 243, 94, 63, 102, 102, 126, 61, 0, 0, 65, 67, 51, 51, 224, 194, 0, 128, 96, 63, 102, 102, 126, 61, 154, 25, 82, 67, 0, 0, 231, 194, 205, 12, 105, 63, 0, 0, 72, 61 ), 13 | "array_index_data": PoolByteArray( 0, 0, 1, 0, 2, 0, 2, 0, 3, 0, 4, 0, 4, 0, 5, 0, 6, 0, 6, 0, 7, 0, 8, 0, 8, 0, 9, 0, 10, 0, 10, 0, 11, 0, 12, 0, 12, 0, 13, 0, 14, 0, 14, 0, 15, 0, 16, 0, 16, 0, 17, 0, 18, 0, 18, 0, 19, 0, 20, 0, 21, 0, 22, 0, 23, 0, 23, 0, 24, 0, 25, 0, 25, 0, 26, 0, 27, 0, 27, 0, 28, 0, 29, 0, 29, 0, 30, 0, 31, 0, 31, 0, 32, 0, 33, 0, 33, 0, 34, 0, 35, 0, 35, 0, 36, 0, 37, 0, 38, 0, 39, 0, 40, 0, 41, 0, 42, 0, 43, 0, 44, 0, 45, 0, 46, 0, 47, 0, 48, 0, 49, 0, 49, 0, 50, 0, 51, 0, 51, 0, 52, 0, 53, 0, 53, 0, 54, 0, 55, 0, 55, 0, 56, 0, 57, 0, 57, 0, 58, 0, 59, 0, 59, 0, 60, 0, 61, 0, 63, 0, 64, 0, 65, 0, 65, 0, 66, 0, 67, 0, 67, 0, 68, 0, 69, 0, 69, 0, 70, 0, 71, 0, 72, 0, 73, 0, 74, 0, 74, 0, 75, 0, 0, 0, 0, 0, 2, 0, 4, 0, 4, 0, 6, 0, 8, 0, 8, 0, 10, 0, 12, 0, 12, 0, 14, 0, 16, 0, 16, 0, 18, 0, 20, 0, 21, 0, 23, 0, 25, 0, 25, 0, 27, 0, 29, 0, 29, 0, 31, 0, 33, 0, 33, 0, 35, 0, 37, 0, 38, 0, 40, 0, 41, 0, 41, 0, 43, 0, 44, 0, 44, 0, 46, 0, 47, 0, 69, 0, 71, 0, 72, 0, 72, 0, 74, 0, 0, 0, 0, 0, 4, 0, 8, 0, 8, 0, 12, 0, 16, 0, 16, 0, 20, 0, 21, 0, 21, 0, 25, 0, 29, 0, 29, 0, 33, 0, 37, 0, 38, 0, 41, 0, 44, 0, 69, 0, 72, 0, 0, 0, 0, 0, 8, 0, 16, 0, 16, 0, 21, 0, 29, 0, 29, 0, 37, 0, 38, 0, 38, 0, 44, 0, 47, 0, 67, 0, 69, 0, 0, 0, 29, 0, 38, 0, 47, 0, 67, 0, 0, 0, 16, 0, 29, 0, 47, 0, 49, 0, 65, 0, 67, 0, 16, 0, 29, 0, 49, 0, 51, 0, 63, 0, 65, 0, 16, 0, 29, 0, 51, 0, 53, 0, 62, 0, 63, 0, 16, 0, 29, 0, 53, 0, 55, 0, 61, 0, 62, 0, 16, 0, 29, 0, 55, 0, 57, 0, 59, 0, 61, 0, 16, 0, 29, 0, 57, 0, 59, 0, 59, 0, 16, 0, 29, 0 ), 14 | "blend_shape_data": [ ], 15 | "format": 262417, 16 | "index_count": 222, 17 | "primitive": 4, 18 | "skeleton_aabb": [ ], 19 | "vertex_count": 76 20 | } 21 | 22 | [node name="StaticBody2D" type="StaticBody2D"] 23 | input_pickable = false 24 | collision_layer = 1 25 | collision_mask = 1 26 | constant_linear_velocity = Vector2( 0, 0 ) 27 | constant_angular_velocity = 0.0 28 | script = ExtResource( 1 ) 29 | 30 | [node name="Camera2D" type="Camera2D" parent="."] 31 | anchor_mode = 1 32 | rotating = false 33 | current = true 34 | zoom = Vector2( 1, 1 ) 35 | limit_left = -10000000 36 | limit_top = -10000000 37 | limit_right = 10000000 38 | limit_bottom = 10000000 39 | limit_smoothed = false 40 | drag_margin_h_enabled = true 41 | drag_margin_v_enabled = true 42 | smoothing_enabled = false 43 | smoothing_speed = 5.0 44 | offset_v = 0.0 45 | offset_h = 0.0 46 | drag_margin_left = 0.2 47 | drag_margin_top = 0.2 48 | drag_margin_right = 0.2 49 | drag_margin_bottom = 0.2 50 | editor_draw_screen = true 51 | editor_draw_limits = false 52 | editor_draw_drag_margin = false 53 | 54 | [node name="CollisionShape2D" type="CollisionShape2D" parent="."] 55 | 56 | [node name="MeshInstance" type="MeshInstance2D" parent="."] 57 | editor/display_folded = true 58 | mesh = SubResource( 1 ) 59 | texture = ExtResource( 2 ) 60 | 61 | [node name="Sprite" type="Sprite" parent="MeshInstance"] 62 | texture = ExtResource( 2 ) 63 | 64 | -------------------------------------------------------------------------------- /ball.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xrayez/godot-mesh-instance-collision-2d/9c85a8656cf32e0f0470b04996d6bdee946a3bd8/ball.png -------------------------------------------------------------------------------- /ball.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="StreamTexture" 5 | path="res://.import/ball.png-9a4ca347acb7532f6ae347744a6b04f7.stex" 6 | 7 | [deps] 8 | 9 | source_file="res://ball.png" 10 | dest_files=[ "res://.import/ball.png-9a4ca347acb7532f6ae347744a6b04f7.stex" ] 11 | 12 | [params] 13 | 14 | compress/mode=0 15 | compress/lossy_quality=0.7 16 | compress/hdr_mode=0 17 | compress/bptc_ldr=0 18 | compress/normal_map=0 19 | flags/repeat=0 20 | flags/filter=true 21 | flags/mipmaps=false 22 | flags/anisotropic=false 23 | flags/srgb=2 24 | process/fix_alpha_border=true 25 | process/premult_alpha=false 26 | process/HDR_as_SRGB=false 27 | process/invert_color=false 28 | stream=false 29 | size_limit=0 30 | detect_3d=true 31 | svg/scale=1.0 32 | -------------------------------------------------------------------------------- /convert_to_2d_mesh.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xrayez/godot-mesh-instance-collision-2d/9c85a8656cf32e0f0470b04996d6bdee946a3bd8/convert_to_2d_mesh.png -------------------------------------------------------------------------------- /convert_to_2d_mesh.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="StreamTexture" 5 | path="res://.import/convert_to_2d_mesh.png-0459bfaf3c5af52b55075fca8755a029.stex" 6 | 7 | [deps] 8 | 9 | source_file="res://convert_to_2d_mesh.png" 10 | dest_files=[ "res://.import/convert_to_2d_mesh.png-0459bfaf3c5af52b55075fca8755a029.stex" ] 11 | 12 | [params] 13 | 14 | compress/mode=0 15 | compress/lossy_quality=0.7 16 | compress/hdr_mode=0 17 | compress/bptc_ldr=0 18 | compress/normal_map=0 19 | flags/repeat=0 20 | flags/filter=true 21 | flags/mipmaps=false 22 | flags/anisotropic=false 23 | flags/srgb=2 24 | process/fix_alpha_border=true 25 | process/premult_alpha=false 26 | process/HDR_as_SRGB=false 27 | process/invert_color=false 28 | stream=false 29 | size_limit=0 30 | detect_3d=true 31 | svg/scale=1.0 32 | -------------------------------------------------------------------------------- /create_2d_mesh.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xrayez/godot-mesh-instance-collision-2d/9c85a8656cf32e0f0470b04996d6bdee946a3bd8/create_2d_mesh.png -------------------------------------------------------------------------------- /create_2d_mesh.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="StreamTexture" 5 | path="res://.import/create_2d_mesh.png-85597f95eef7c7a00d6d6894766408e5.stex" 6 | 7 | [deps] 8 | 9 | source_file="res://create_2d_mesh.png" 10 | dest_files=[ "res://.import/create_2d_mesh.png-85597f95eef7c7a00d6d6894766408e5.stex" ] 11 | 12 | [params] 13 | 14 | compress/mode=0 15 | compress/lossy_quality=0.7 16 | compress/hdr_mode=0 17 | compress/bptc_ldr=0 18 | compress/normal_map=0 19 | flags/repeat=0 20 | flags/filter=true 21 | flags/mipmaps=false 22 | flags/anisotropic=false 23 | flags/srgb=2 24 | process/fix_alpha_border=true 25 | process/premult_alpha=false 26 | process/HDR_as_SRGB=false 27 | process/invert_color=false 28 | stream=false 29 | size_limit=0 30 | detect_3d=true 31 | svg/scale=1.0 32 | -------------------------------------------------------------------------------- /default_env.tres: -------------------------------------------------------------------------------- 1 | [gd_resource type="Environment" load_steps=2 format=2] 2 | 3 | [sub_resource type="ProceduralSky" id=1] 4 | 5 | radiance_size = 4 6 | sky_top_color = Color( 0.647059, 0.839216, 0.945098, 1 ) 7 | sky_horizon_color = Color( 0.839216, 0.917647, 0.980392, 1 ) 8 | sky_curve = 0.09 9 | sky_energy = 1.0 10 | ground_bottom_color = Color( 0.156863, 0.184314, 0.211765, 1 ) 11 | ground_horizon_color = Color( 0.423529, 0.396078, 0.372549, 1 ) 12 | ground_curve = 0.02 13 | ground_energy = 1.0 14 | sun_color = Color( 1, 1, 1, 1 ) 15 | sun_latitude = 35.0 16 | sun_longitude = 0.0 17 | sun_angle_min = 1.0 18 | sun_angle_max = 100.0 19 | sun_curve = 0.05 20 | sun_energy = 16.0 21 | texture_size = 2 22 | 23 | [resource] 24 | 25 | background_mode = 2 26 | background_sky = SubResource( 1 ) 27 | background_sky_custom_fov = 0.0 28 | background_color = Color( 0, 0, 0, 1 ) 29 | background_energy = 1.0 30 | background_canvas_max_layer = 0 31 | ambient_light_color = Color( 0, 0, 0, 1 ) 32 | ambient_light_energy = 1.0 33 | ambient_light_sky_contribution = 1.0 34 | fog_enabled = false 35 | fog_color = Color( 0.5, 0.6, 0.7, 1 ) 36 | fog_sun_color = Color( 1, 0.9, 0.7, 1 ) 37 | fog_sun_amount = 0.0 38 | fog_depth_enabled = true 39 | fog_depth_begin = 10.0 40 | fog_depth_curve = 1.0 41 | fog_transmit_enabled = false 42 | fog_transmit_curve = 1.0 43 | fog_height_enabled = false 44 | fog_height_min = 0.0 45 | fog_height_max = 100.0 46 | fog_height_curve = 1.0 47 | tonemap_mode = 0 48 | tonemap_exposure = 1.0 49 | tonemap_white = 1.0 50 | auto_exposure_enabled = false 51 | auto_exposure_scale = 0.4 52 | auto_exposure_min_luma = 0.05 53 | auto_exposure_max_luma = 8.0 54 | auto_exposure_speed = 0.5 55 | ss_reflections_enabled = false 56 | ss_reflections_max_steps = 64 57 | ss_reflections_fade_in = 0.15 58 | ss_reflections_fade_out = 2.0 59 | ss_reflections_depth_tolerance = 0.2 60 | ss_reflections_roughness = true 61 | ssao_enabled = false 62 | ssao_radius = 1.0 63 | ssao_intensity = 1.0 64 | ssao_radius2 = 0.0 65 | ssao_intensity2 = 1.0 66 | ssao_bias = 0.01 67 | ssao_light_affect = 0.0 68 | ssao_ao_channel_affect = 0.0 69 | ssao_color = Color( 0, 0, 0, 1 ) 70 | ssao_quality = 0 71 | ssao_blur = 3 72 | ssao_edge_sharpness = 4.0 73 | dof_blur_far_enabled = false 74 | dof_blur_far_distance = 10.0 75 | dof_blur_far_transition = 5.0 76 | dof_blur_far_amount = 0.1 77 | dof_blur_far_quality = 1 78 | dof_blur_near_enabled = false 79 | dof_blur_near_distance = 2.0 80 | dof_blur_near_transition = 1.0 81 | dof_blur_near_amount = 0.1 82 | dof_blur_near_quality = 1 83 | glow_enabled = false 84 | glow_levels/1 = false 85 | glow_levels/2 = false 86 | glow_levels/3 = true 87 | glow_levels/4 = false 88 | glow_levels/5 = true 89 | glow_levels/6 = false 90 | glow_levels/7 = false 91 | glow_intensity = 0.8 92 | glow_strength = 1.0 93 | glow_bloom = 0.0 94 | glow_blend_mode = 2 95 | glow_hdr_threshold = 1.0 96 | glow_hdr_scale = 2.0 97 | glow_bicubic_upscale = false 98 | adjustment_enabled = false 99 | adjustment_brightness = 1.0 100 | adjustment_contrast = 1.0 101 | adjustment_saturation = 1.0 102 | 103 | -------------------------------------------------------------------------------- /icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xrayez/godot-mesh-instance-collision-2d/9c85a8656cf32e0f0470b04996d6bdee946a3bd8/icon.png -------------------------------------------------------------------------------- /icon.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="StreamTexture" 5 | path="res://.import/icon.png-487276ed1e3a0c39cad0279d744ee560.stex" 6 | 7 | [deps] 8 | 9 | source_file="res://icon.png" 10 | dest_files=[ "res://.import/icon.png-487276ed1e3a0c39cad0279d744ee560.stex" ] 11 | 12 | [params] 13 | 14 | compress/mode=0 15 | compress/lossy_quality=0.7 16 | compress/hdr_mode=0 17 | compress/bptc_ldr=0 18 | compress/normal_map=0 19 | flags/repeat=0 20 | flags/filter=true 21 | flags/mipmaps=false 22 | flags/anisotropic=false 23 | flags/srgb=2 24 | process/fix_alpha_border=true 25 | process/premult_alpha=false 26 | process/HDR_as_SRGB=false 27 | process/invert_color=false 28 | stream=false 29 | size_limit=0 30 | detect_3d=true 31 | svg/scale=1.0 32 | -------------------------------------------------------------------------------- /project.godot: -------------------------------------------------------------------------------- 1 | ; Engine configuration file. 2 | ; It's best edited using the editor UI and not directly, 3 | ; since the parameters that go here are not all obvious. 4 | ; 5 | ; Format: 6 | ; [section] ; section goes between [] 7 | ; param=value ; assign values to parameters 8 | 9 | config_version=4 10 | 11 | _global_script_classes=[ ] 12 | _global_script_class_icons={ 13 | 14 | } 15 | 16 | [application] 17 | 18 | config/name="Testing" 19 | run/main_scene="res://Main.tscn" 20 | config/icon="res://icon.png" 21 | 22 | [physics] 23 | 24 | 2d/default_gravity=700 25 | 26 | [rendering] 27 | 28 | environment/default_clear_color=Color( 0, 0, 0, 1 ) 29 | environment/default_environment="res://default_env.tres" 30 | -------------------------------------------------------------------------------- /shape.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xrayez/godot-mesh-instance-collision-2d/9c85a8656cf32e0f0470b04996d6bdee946a3bd8/shape.png -------------------------------------------------------------------------------- /shape.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="StreamTexture" 5 | path="res://.import/shape.png-f70fda8f1aaa6928af592a1f70334323.stex" 6 | 7 | [deps] 8 | 9 | source_file="res://shape.png" 10 | dest_files=[ "res://.import/shape.png-f70fda8f1aaa6928af592a1f70334323.stex" ] 11 | 12 | [params] 13 | 14 | compress/mode=0 15 | compress/lossy_quality=0.7 16 | compress/hdr_mode=0 17 | compress/bptc_ldr=0 18 | compress/normal_map=0 19 | flags/repeat=0 20 | flags/filter=true 21 | flags/mipmaps=false 22 | flags/anisotropic=false 23 | flags/srgb=2 24 | process/fix_alpha_border=true 25 | process/premult_alpha=false 26 | process/HDR_as_SRGB=false 27 | process/invert_color=false 28 | stream=false 29 | size_limit=0 30 | detect_3d=true 31 | svg/scale=1.0 32 | --------------------------------------------------------------------------------