summaryrefslogtreecommitdiff
path: root/test/src
diff options
context:
space:
mode:
authorFrederico Linhares <fred@linhares.blue>2022-09-08 16:53:46 -0300
committerFrederico Linhares <fred@linhares.blue>2022-09-08 16:53:46 -0300
commit0d0868611389b8dded0c1dfef7a530a4b6e1f148 (patch)
treed2d684c8eeae0b1947af803426068596281a48ea /test/src
parent900120ca393fd2eb49ca8c63bcd9b4e0c0aab1a2 (diff)
feat Create Vector4D
Diffstat (limited to 'test/src')
-rw-r--r--test/src/main.rb8
1 files changed, 5 insertions, 3 deletions
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);