ソースを参照

vector definitions

David Golembiowski 5 年 前
コミット
c6f2196f60
1 ファイル変更29 行追加0 行削除
  1. 29 0
      port/assimp_rs/src/structs/vec.rs

+ 29 - 0
port/assimp_rs/src/structs/vec.rs

@@ -0,0 +1,29 @@
+struct Vector2d {
+    x: f32,
+    y: f32
+}
+
+struct Vector3d {
+    x: f32,
+    y: f32,
+    z: f32
+}
+
+impl Vector2d {
+    pub fn new(x_f32: f32, y_f32: f32) -> Vector2d {
+        Vector2d {
+            x: x_f32,
+            y: y_f32
+        }
+    }
+}
+
+impl Vector3d {
+    pub fn new(x_f32: f32, y_f32: f32, z_f32: f32) -> Vector3d {
+        Vector3d {
+            x: x_f32,
+            y: y_f32,
+            z: z_f32
+        }
+    }
+}