From 0d0868611389b8dded0c1dfef7a530a4b6e1f148 Mon Sep 17 00:00:00 2001 From: Frederico Linhares Date: Thu, 8 Sep 2022 16:53:46 -0300 Subject: feat Create Vector4D --- test/src/main.rb | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'test') diff --git a/test/src/main.rb b/test/src/main.rb index b153a50..f5c0676 100644 --- a/test/src/main.rb +++ b/test/src/main.rb @@ -18,8 +18,10 @@ TRANSLATION_SPEED = 0.5; def init() $texture = CandyGear::Texture.from_image("textures/color_texture.png"); - $sprite = CandyGear::Sprite.new($texture, 0, 0, 1.0, 1.0); $model = CandyGear::Model.new("models/cube.cgmodel", $texture); + $sprite = CandyGear::Sprite.new( + $texture, CandyGear::Vector4D.new(0, 0, 1.0, 1.0)); + $sprite_position = CandyGear::Vector4D.new(1.0, 1.0, 101.0, 101.0); $instances = [ CandyGear::Vector3D.new(5.0, 0.0, 0.0), @@ -33,7 +35,7 @@ def init() $camera_position = CandyGear::Vector3D.new(0.0, 0.0, 0.0); $camera_rotation = CandyGear::Rotation3D.new(0.0, 0.0, 0.0); - CandyGear.camera_position = $camera_position + CandyGear.camera_position = $camera_position; CandyGear.camera_rotation = $camera_rotation; end @@ -68,7 +70,7 @@ end def quit() = CandyGear.quit(); def tick() - $sprite.draw(1.0, 1.0, 101.0, 101.0); + $sprite.draw($sprite_position); $instances_rotation.rotate(0.0, BOX_ROTATION_SPEED); $instances.each do |i| $model.draw(i, $instances_rotation); -- cgit v1.2.3