-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
28 changed files
with
2,034 additions
and
58 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
extends QSoftBodyNode | ||
|
||
|
||
# Called when the node enters the scene tree for the first time. | ||
func _ready() -> void: | ||
var mesh=get_mesh_at(0) | ||
if mesh!=null : | ||
for i in range(mesh.get_particle_count()): | ||
var pp=mesh.get_particle_at((i-1+mesh.get_particle_count())%mesh.get_particle_count() ) | ||
var p=mesh.get_particle_at(i) | ||
var np=mesh.get_particle_at( (i+1)%mesh.get_particle_count() ) | ||
var angleConstraint=QAngleConstraintObject.new() | ||
angleConstraint.configure_with_angle_of_local_positions(pp,p,np,0.0) | ||
angleConstraint.set_rigidity(0.5) | ||
mesh.add_angle_constraint(angleConstraint) | ||
|
||
|
||
pass # Replace with function body. | ||
|
||
|
||
# Called every frame. 'delta' is the elapsed time since the previous frame. | ||
func _process(delta: float) -> void: | ||
pass |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,109 @@ | ||
[gd_scene load_steps=4 format=3 uid="uid://b07dx1g015v5r"] | ||
|
||
[ext_resource type="Texture2D" uid="uid://ojuguaw1u74o" path="res://examples/8_pbd_bodies/sprites/godot_pixel_kenney.png" id="1_m1fsg"] | ||
|
||
[sub_resource type="Gradient" id="Gradient_5kq2g"] | ||
interpolation_mode = 2 | ||
offsets = PackedFloat32Array(0, 0.835648) | ||
colors = PackedColorArray(1, 1, 1, 1, 1, 1, 1, 0) | ||
|
||
[sub_resource type="GradientTexture2D" id="GradientTexture2D_f3c86"] | ||
gradient = SubResource("Gradient_5kq2g") | ||
width = 256 | ||
height = 256 | ||
fill = 1 | ||
fill_from = Vector2(0.5, 0.5) | ||
fill_to = Vector2(1, 1) | ||
|
||
[node name="Node2D" type="Node2D"] | ||
|
||
[node name="QWorldNode" type="QWorldNode" parent="."] | ||
gravity = Vector2(0, 0.1) | ||
debug_renderer = false | ||
enable_debug_mouse_interactions = true | ||
|
||
[node name="background" type="ColorRect" parent="."] | ||
offset_right = 1030.0 | ||
offset_bottom = 580.0 | ||
mouse_filter = 2 | ||
|
||
[node name="Floor" type="QRigidBodyNode" parent="."] | ||
mode = 1 | ||
layers = 2 | ||
position = Vector2(519, 555) | ||
|
||
[node name="QMeshRectNode" type="QMeshRectNode" parent="Floor"] | ||
rectangle_size = Vector2(2000, 300) | ||
enable_vector_rendering = true | ||
enable_stroke = true | ||
data_particle_positions = PackedVector2Array(-1000, -150, 1000, -150, 1000, 150, -1000, 150) | ||
data_particle_radius = PackedFloat32Array(0.5, 0.5, 0.5, 0.5) | ||
data_particle_is_internal = PackedByteArray(0, 0, 0, 0) | ||
data_particle_is_enabled = PackedByteArray(1, 1, 1, 1) | ||
data_particle_is_lazy = PackedByteArray(0, 0, 0, 0) | ||
data_springs = Array[PackedInt32Array]([PackedInt32Array(0, 1), PackedInt32Array(1, 2), PackedInt32Array(2, 3), PackedInt32Array(3, 0)]) | ||
data_internal_springs = Array[PackedInt32Array]([PackedInt32Array(0, 2), PackedInt32Array(1, 3)]) | ||
data_polygon = PackedInt32Array(0, 1, 2, 3) | ||
data_uv_maps = Array[PackedInt32Array]([PackedInt32Array(0, 1, 3), PackedInt32Array(1, 2, 3)]) | ||
|
||
[node name="Walls" type="QRigidBodyNode" parent="."] | ||
mode = 1 | ||
layers = 2 | ||
position = Vector2(64, -320) | ||
|
||
[node name="QMeshRectNode" type="QMeshRectNode" parent="Walls"] | ||
rectangle_size = Vector2(300, 2000) | ||
enable_vector_rendering = true | ||
enable_stroke = true | ||
data_particle_positions = PackedVector2Array(-150, -1000, 150, -1000, 150, 1000, -150, 1000) | ||
data_particle_radius = PackedFloat32Array(0.5, 0.5, 0.5, 0.5) | ||
data_particle_is_internal = PackedByteArray(0, 0, 0, 0) | ||
data_particle_is_enabled = PackedByteArray(1, 1, 1, 1) | ||
data_particle_is_lazy = PackedByteArray(0, 0, 0, 0) | ||
data_springs = Array[PackedInt32Array]([PackedInt32Array(0, 1), PackedInt32Array(1, 2), PackedInt32Array(2, 3), PackedInt32Array(3, 0)]) | ||
data_internal_springs = Array[PackedInt32Array]([PackedInt32Array(0, 2), PackedInt32Array(1, 3)]) | ||
data_polygon = PackedInt32Array(0, 1, 2, 3) | ||
data_uv_maps = Array[PackedInt32Array]([PackedInt32Array(0, 1, 3), PackedInt32Array(1, 2, 3)]) | ||
|
||
[node name="Walls2" type="QRigidBodyNode" parent="."] | ||
mode = 1 | ||
layers = 2 | ||
position = Vector2(896, -304) | ||
|
||
[node name="QMeshRectNode" type="QMeshRectNode" parent="Walls2"] | ||
rectangle_size = Vector2(300, 2000) | ||
enable_vector_rendering = true | ||
enable_stroke = true | ||
data_particle_positions = PackedVector2Array(-150, -1000, 150, -1000, 150, 1000, -150, 1000) | ||
data_particle_radius = PackedFloat32Array(0.5, 0.5, 0.5, 0.5) | ||
data_particle_is_internal = PackedByteArray(0, 0, 0, 0) | ||
data_particle_is_enabled = PackedByteArray(1, 1, 1, 1) | ||
data_particle_is_lazy = PackedByteArray(0, 0, 0, 0) | ||
data_springs = Array[PackedInt32Array]([PackedInt32Array(0, 1), PackedInt32Array(1, 2), PackedInt32Array(2, 3), PackedInt32Array(3, 0)]) | ||
data_internal_springs = Array[PackedInt32Array]([PackedInt32Array(0, 2), PackedInt32Array(1, 3)]) | ||
data_polygon = PackedInt32Array(0, 1, 2, 3) | ||
data_uv_maps = Array[PackedInt32Array]([PackedInt32Array(0, 1, 3), PackedInt32Array(1, 2, 3)]) | ||
|
||
[node name="QTexturedPBDBodyNode" type="QTexturedPBDBodyNode" parent="."] | ||
texture = ExtResource("1_m1fsg") | ||
texture_scale = 4.0 | ||
sfd_texture = SubResource("GradientTexture2D_f3c86") | ||
sfd_shader_alpha_threshold = 0.6 | ||
break_distance = 15.0 | ||
pixel_step_size = 2.0 | ||
rigidity = 0.1 | ||
self_collision = true | ||
shape_matching_rate = 0.1 | ||
position = Vector2(320, 304) | ||
|
||
[node name="QTexturedPBDBodyNode2" type="QTexturedPBDBodyNode" parent="."] | ||
texture = ExtResource("1_m1fsg") | ||
texture_scale = 4.0 | ||
sfd_texture = SubResource("GradientTexture2D_f3c86") | ||
sfd_shader_alpha_threshold = 0.6 | ||
break_distance = 15.0 | ||
pixel_step_size = 2.0 | ||
rigidity = 0.1 | ||
self_collision = true | ||
shape_matching_rate = 0.1 | ||
position = Vector2(336, -32) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
34 changes: 34 additions & 0 deletions
34
project/examples/8_pbd_bodies/sprites/godot_pixel_kenney.png.import
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
[remap] | ||
|
||
importer="texture" | ||
type="CompressedTexture2D" | ||
uid="uid://ojuguaw1u74o" | ||
path="res://.godot/imported/godot_pixel_kenney.png-5063dfda5bb9e63ab2298615b90515b8.ctex" | ||
metadata={ | ||
"vram_texture": false | ||
} | ||
|
||
[deps] | ||
|
||
source_file="res://examples/8_pbd_bodies/sprites/godot_pixel_kenney.png" | ||
dest_files=["res://.godot/imported/godot_pixel_kenney.png-5063dfda5bb9e63ab2298615b90515b8.ctex"] | ||
|
||
[params] | ||
|
||
compress/mode=0 | ||
compress/high_quality=false | ||
compress/lossy_quality=0.7 | ||
compress/hdr_compression=1 | ||
compress/normal_map=0 | ||
compress/channel_pack=0 | ||
mipmaps/generate=false | ||
mipmaps/limit=-1 | ||
roughness/mode=0 | ||
roughness/src_normal="" | ||
process/fix_alpha_border=true | ||
process/premult_alpha=false | ||
process/normal_map_invert_y=false | ||
process/hdr_as_srgb=false | ||
process/hdr_clamp_exposure=false | ||
process/size_limit=0 | ||
detect_3d/compress_to=1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +0,0 @@ | ||
[preset.0] | ||
|
||
name="Linux" | ||
platform="Linux" | ||
runnable=true | ||
advanced_options=false | ||
dedicated_server=false | ||
custom_features="" | ||
export_filter="all_resources" | ||
include_filter="" | ||
exclude_filter="" | ||
export_path="../../../../../../home/eray/Documents/qp_example_test.x86_64" | ||
encryption_include_filters="" | ||
encryption_exclude_filters="" | ||
encrypt_pck=false | ||
encrypt_directory=false | ||
script_export_mode=2 | ||
|
||
[preset.0.options] | ||
|
||
custom_template/debug="" | ||
custom_template/release="" | ||
debug/export_console_wrapper=1 | ||
binary_format/embed_pck=false | ||
texture_format/s3tc_bptc=true | ||
texture_format/etc2_astc=false | ||
binary_format/architecture="x86_64" | ||
ssh_remote_deploy/enabled=false | ||
ssh_remote_deploy/host="user@host_ip" | ||
ssh_remote_deploy/port="22" | ||
ssh_remote_deploy/extra_args_ssh="" | ||
ssh_remote_deploy/extra_args_scp="" | ||
ssh_remote_deploy/run_script="#!/usr/bin/env bash | ||
export DISPLAY=:0 | ||
unzip -o -q \"{temp_dir}/{archive_name}\" -d \"{temp_dir}\" | ||
\"{temp_dir}/{exe_name}\" {cmd_args}" | ||
ssh_remote_deploy/cleanup_script="#!/usr/bin/env bash | ||
kill $(pgrep -x -f \"{temp_dir}/{exe_name} {cmd_args}\") | ||
rm -rf \"{temp_dir}\"" | ||
Oops, something went wrong.