summaryrefslogtreecommitdiff
path: root/test/src/mode
diff options
context:
space:
mode:
authorFrederico Linhares <fred@linhares.blue>2024-03-23 19:05:26 -0300
committerFrederico Linhares <fred@linhares.blue>2024-03-23 19:12:24 -0300
commit8acb4a0aad7f4d1b2438010d487489a9641e30cb (patch)
tree50a0fc3094e1d5e29a1fbcc8d7f94ffa2561fa84 /test/src/mode
parentbf240d7eeaa89657462b705849fde56e54e237db (diff)
fixt Make skeletal mesh work properly
Diffstat (limited to 'test/src/mode')
-rw-r--r--test/src/mode/demo.rb12
1 files changed, 10 insertions, 2 deletions
diff --git a/test/src/mode/demo.rb b/test/src/mode/demo.rb
index a821d65..65ea52a 100644
--- a/test/src/mode/demo.rb
+++ b/test/src/mode/demo.rb
@@ -21,6 +21,7 @@ module Mode
def initialize()
texture = CandyGear::Texture.from_image("textures/color_texture.qoi");
mesh = CandyGear::StaticMesh.new("meshes/cube.cgmesh");
+ skeletal_mesh = CandyGear::SkeletalMesh.new("meshes/cuboid.cgmesh");
font = CandyGear::Font.new("/usr/share/fonts/TTF/HanaMinA.ttf", 30);
japanese_text = CandyGear::Texture.from_text(
font, "こんにちは世界!");
@@ -66,11 +67,17 @@ module Mode
mesh, texture, instance_positions[5], @instances_orientation)
]
+ skeletal_mesh_position = CandyGear::Vector3D.new(0.0, 0.0, 0.0);
+ skeletal_mesh_orientation = CandyGear::Orientation3D.new(0.0, 0.0, 0.0);
+ @skeletal_model = CandyGear::SkeletalModel.new(
+ skeletal_mesh, texture, skeletal_mesh_position,
+ skeletal_mesh_orientation);
+
sprite_3d_position = CandyGear::Vector3D.new(0.0, 0.0, 0.0);
@sprite_3d = CandyGear::Sprite3D.new(
@sprite, sprite_3d_position, 1.0, 1.0);
- @camera_position = CandyGear::Vector3D.new(0.0, 0.0, 0.0);
+ @camera_position = CandyGear::Vector3D.new(0.0, 0.0, 20.0);
@camera_orientation = CandyGear::Orientation3D.new(0.0, 0.0, 0.0);
color = CandyGear::Vector3D.new(0.12, 0.12, 0.18);
@@ -129,7 +136,8 @@ module Mode
@instances_orientation.rotate(0.0, BOX_ROTATION_SPEED, 0.0);
@rectangle.draw_rectangle(@view1, @color);
@instances.each {_1.draw()};
- @sprite_3d.draw();
+ @skeletal_model.draw();
+ # @sprite_3d.draw();
end
end
end