Skip to content

Commit

Permalink
Demo polished
Browse files Browse the repository at this point in the history
  • Loading branch information
thygrrr committed Feb 27, 2024
1 parent 1771d3c commit 8e7f1d7
Show file tree
Hide file tree
Showing 6 changed files with 175 additions and 151 deletions.
27 changes: 13 additions & 14 deletions examples/example-godot/BasicCubes/BasicCubes.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,10 @@ unique_name_in_owner = true
custom_minimum_size = Vector2(60, 500)
layout_mode = 2
theme = ExtResource("3_ym7v2")
min_value = 0.1
min_value = 0.01
max_value = 1.0
step = 0.01
value = 1.0
step = 0.001
value = 0.5
tick_count = 20
ticks_on_borders = true

Expand All @@ -116,25 +116,23 @@ size_flags_vertical = 8

[node name="HBoxContainer2" type="VBoxContainer" parent="Control/VBoxContainer/Panel"]
layout_mode = 1
anchors_preset = 3
anchor_left = 1.0
anchor_top = 1.0
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
offset_left = -39.0
offset_top = -164.0
offset_right = 118.0
offset_bottom = -114.0
grow_horizontal = 0
grow_vertical = 0
offset_left = -43.0
offset_top = -140.0
offset_right = 92.0
offset_bottom = -96.0
grow_horizontal = 2
grow_vertical = 2
rotation = 1.5708
mouse_filter = 2

[node name="SimulatedLabel" type="Label" parent="Control/VBoxContainer/Panel/HBoxContainer2"]
show_behind_parent = true
layout_mode = 2
size_flags_horizontal = 8
text = "Entities in Simulation"
text = "Entities Simulated"
label_settings = SubResource("LabelSettings_d0l4f")
horizontal_alignment = 2
vertical_alignment = 1
Expand All @@ -144,7 +142,7 @@ show_behind_parent = true
layout_mode = 2
size_flags_horizontal = 8
size_flags_vertical = 8
text = "Rendered"
text = "Entities Visible"
label_settings = SubResource("LabelSettings_d0l4f")
horizontal_alignment = 2
vertical_alignment = 1
Expand Down Expand Up @@ -220,4 +218,5 @@ mesh = SubResource("SphereMesh_s2td0")
environment = SubResource("Environment_q01bs")

[connection signal="value_changed" from="Control/VBoxContainer/SpawnController/VisibleSlider" to="ECS" method="_on_rendered_slider_value_changed"]
[connection signal="drag_ended" from="Control/VBoxContainer/SpawnController/SimulatedSlider" to="ECS" method="_on_simulated_slider_drag_ended"]
[connection signal="value_changed" from="Control/VBoxContainer/SpawnController/SimulatedSlider" to="ECS" method="_on_simulated_slider_value_changed"]
81 changes: 81 additions & 0 deletions examples/example-godot/BasicCubes/Matrix4X3.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
using System.Numerics;
using System.Runtime.InteropServices;

namespace examples.godot.BasicCubes;

[StructLayout(LayoutKind.Sequential, Pack = 4)]
public struct Matrix4X3
{
public float M00;
public float M01;
public float M02;
public float M03;

public float M10;
public float M11;
public float M12;
public float M13;

public float M20;
public float M21;
public float M22;
public float M23;


public Matrix4X3()
{
M00 = 1;
M01 = 0;
M02 = 0;
M03 = 0;
M10 = 0;
M11 = 1;
M12 = 0;
M13 = 0;
M20 = 0;
M21 = 0;
M22 = 1;
M23 = 0;
}


public Matrix4X3(Vector3 origin)
{
M00 = 1;
M01 = 0;
M02 = 0;
M03 = origin.X;
M10 = 0;
M11 = 1;
M12 = 0;
M13 = origin.Y;
M20 = 0;
M21 = 0;
M22 = 1;
M23 = origin.Z;
}


public Matrix4X3(Vector3 bX, Vector3 bY, Vector3 bZ, Vector3 origin)
{
M00 = bX.X;
M01 = bX.Y;
M02 = bX.Z;
M03 = origin.X;
M10 = bY.X;
M11 = bY.Y;
M12 = bY.Z;
M13 = origin.Y;
M20 = bZ.X;
M21 = bZ.Y;
M22 = bZ.Z;
M23 = origin.Z;
}


public override string ToString()
{
return $"Matrix4X3({M00}, {M01}, {M02}, {M03}, {M10}, {M11}, {M12}, {M13}, {M20}, {M21}, {M22}, {M23})";
}

}
Loading

0 comments on commit 8e7f1d7

Please sign in to comment.