From 058f98a63658dc1a2579826ba167fd61bed1e21f Mon Sep 17 00:00:00 2001 From: sanine Date: Fri, 4 Mar 2022 10:47:15 -0600 Subject: add assimp submodule --- src/mesh/assimp-master/port/assimp_rs/Cargo.lock | 6 ++ src/mesh/assimp-master/port/assimp_rs/Cargo.toml | 9 +++ .../assimp-master/port/assimp_rs/src/camera/mod.rs | 1 + .../assimp-master/port/assimp_rs/src/core/mod.rs | 0 .../assimp-master/port/assimp_rs/src/errors/mod.rs | 0 .../port/assimp_rs/src/formats/mod.rs | 0 src/mesh/assimp-master/port/assimp_rs/src/lib.rs | 17 ++++++ .../port/assimp_rs/src/material/mod.rs | 0 .../port/assimp_rs/src/postprocess/mod.rs | 0 .../assimp-master/port/assimp_rs/src/shims/mod.rs | 0 .../assimp-master/port/assimp_rs/src/socket/mod.rs | 0 .../port/assimp_rs/src/structs/anim/anim.rs | 44 +++++++++++++++ .../port/assimp_rs/src/structs/anim/mod.rs | 6 ++ .../port/assimp_rs/src/structs/blob/blob.rs | 0 .../port/assimp_rs/src/structs/blob/mod.rs | 2 + .../port/assimp_rs/src/structs/bone/bone.rs | 0 .../port/assimp_rs/src/structs/bone/mod.rs | 2 + .../port/assimp_rs/src/structs/camera/camera.rs | 0 .../port/assimp_rs/src/structs/camera/mod.rs | 2 + .../port/assimp_rs/src/structs/color/color.rs | 27 +++++++++ .../port/assimp_rs/src/structs/color/mod.rs | 5 ++ .../port/assimp_rs/src/structs/face/face.rs | 0 .../port/assimp_rs/src/structs/face/mod.rs | 2 + .../port/assimp_rs/src/structs/key/key.rs | 0 .../port/assimp_rs/src/structs/key/mod.rs | 2 + .../port/assimp_rs/src/structs/light/light.rs | 0 .../port/assimp_rs/src/structs/light/mod.rs | 2 + .../assimp_rs/src/structs/material/material.rs | 0 .../port/assimp_rs/src/structs/material/mod.rs | 2 + .../port/assimp_rs/src/structs/matrix/matrix.rs | 64 ++++++++++++++++++++++ .../port/assimp_rs/src/structs/matrix/mod.rs | 4 ++ .../port/assimp_rs/src/structs/memory/memory.rs | 35 ++++++++++++ .../port/assimp_rs/src/structs/memory/mod.rs | 2 + .../port/assimp_rs/src/structs/mesh/mesh.rs | 0 .../port/assimp_rs/src/structs/mesh/mod.rs | 3 + .../port/assimp_rs/src/structs/meta/meta.rs | 0 .../port/assimp_rs/src/structs/meta/mod.rs | 2 + .../port/assimp_rs/src/structs/mod.rs | 61 +++++++++++++++++++++ .../port/assimp_rs/src/structs/node/mod.rs | 2 + .../port/assimp_rs/src/structs/node/node.rs | 0 .../port/assimp_rs/src/structs/plane/mod.rs | 2 + .../port/assimp_rs/src/structs/plane/plane.rs | 23 ++++++++ .../port/assimp_rs/src/structs/quaternion/mod.rs | 3 + .../assimp_rs/src/structs/quaternion/quaternion.rs | 7 +++ .../port/assimp_rs/src/structs/ray/mod.rs | 2 + .../port/assimp_rs/src/structs/ray/ray.rs | 0 .../port/assimp_rs/src/structs/scene/mod.rs | 2 + .../port/assimp_rs/src/structs/scene/scene.rs | 0 .../port/assimp_rs/src/structs/string/mod.rs | 3 + .../port/assimp_rs/src/structs/string/string.rs | 41 ++++++++++++++ .../port/assimp_rs/src/structs/texture/mod.rs | 3 + .../port/assimp_rs/src/structs/texture/texture.rs | 19 +++++++ .../port/assimp_rs/src/structs/transform/mod.rs | 2 + .../assimp_rs/src/structs/transform/transform.rs | 0 .../port/assimp_rs/src/structs/vec/mod.rs | 2 + .../port/assimp_rs/src/structs/vec/vec.rs | 48 ++++++++++++++++ .../port/assimp_rs/src/structs/vertex/mod.rs | 2 + .../port/assimp_rs/src/structs/vertex/vertex.rs | 0 58 files changed, 461 insertions(+) create mode 100644 src/mesh/assimp-master/port/assimp_rs/Cargo.lock create mode 100644 src/mesh/assimp-master/port/assimp_rs/Cargo.toml create mode 100644 src/mesh/assimp-master/port/assimp_rs/src/camera/mod.rs create mode 100644 src/mesh/assimp-master/port/assimp_rs/src/core/mod.rs create mode 100644 src/mesh/assimp-master/port/assimp_rs/src/errors/mod.rs create mode 100644 src/mesh/assimp-master/port/assimp_rs/src/formats/mod.rs create mode 100644 src/mesh/assimp-master/port/assimp_rs/src/lib.rs create mode 100644 src/mesh/assimp-master/port/assimp_rs/src/material/mod.rs create mode 100644 src/mesh/assimp-master/port/assimp_rs/src/postprocess/mod.rs create mode 100644 src/mesh/assimp-master/port/assimp_rs/src/shims/mod.rs create mode 100644 src/mesh/assimp-master/port/assimp_rs/src/socket/mod.rs create mode 100644 src/mesh/assimp-master/port/assimp_rs/src/structs/anim/anim.rs create mode 100644 src/mesh/assimp-master/port/assimp_rs/src/structs/anim/mod.rs create mode 100644 src/mesh/assimp-master/port/assimp_rs/src/structs/blob/blob.rs create mode 100644 src/mesh/assimp-master/port/assimp_rs/src/structs/blob/mod.rs create mode 100644 src/mesh/assimp-master/port/assimp_rs/src/structs/bone/bone.rs create mode 100644 src/mesh/assimp-master/port/assimp_rs/src/structs/bone/mod.rs create mode 100644 src/mesh/assimp-master/port/assimp_rs/src/structs/camera/camera.rs create mode 100644 src/mesh/assimp-master/port/assimp_rs/src/structs/camera/mod.rs create mode 100644 src/mesh/assimp-master/port/assimp_rs/src/structs/color/color.rs create mode 100644 src/mesh/assimp-master/port/assimp_rs/src/structs/color/mod.rs create mode 100644 src/mesh/assimp-master/port/assimp_rs/src/structs/face/face.rs create mode 100644 src/mesh/assimp-master/port/assimp_rs/src/structs/face/mod.rs create mode 100644 src/mesh/assimp-master/port/assimp_rs/src/structs/key/key.rs create mode 100644 src/mesh/assimp-master/port/assimp_rs/src/structs/key/mod.rs create mode 100644 src/mesh/assimp-master/port/assimp_rs/src/structs/light/light.rs create mode 100644 src/mesh/assimp-master/port/assimp_rs/src/structs/light/mod.rs create mode 100644 src/mesh/assimp-master/port/assimp_rs/src/structs/material/material.rs create mode 100644 src/mesh/assimp-master/port/assimp_rs/src/structs/material/mod.rs create mode 100644 src/mesh/assimp-master/port/assimp_rs/src/structs/matrix/matrix.rs create mode 100644 src/mesh/assimp-master/port/assimp_rs/src/structs/matrix/mod.rs create mode 100644 src/mesh/assimp-master/port/assimp_rs/src/structs/memory/memory.rs create mode 100644 src/mesh/assimp-master/port/assimp_rs/src/structs/memory/mod.rs create mode 100644 src/mesh/assimp-master/port/assimp_rs/src/structs/mesh/mesh.rs create mode 100644 src/mesh/assimp-master/port/assimp_rs/src/structs/mesh/mod.rs create mode 100644 src/mesh/assimp-master/port/assimp_rs/src/structs/meta/meta.rs create mode 100644 src/mesh/assimp-master/port/assimp_rs/src/structs/meta/mod.rs create mode 100644 src/mesh/assimp-master/port/assimp_rs/src/structs/mod.rs create mode 100644 src/mesh/assimp-master/port/assimp_rs/src/structs/node/mod.rs create mode 100644 src/mesh/assimp-master/port/assimp_rs/src/structs/node/node.rs create mode 100644 src/mesh/assimp-master/port/assimp_rs/src/structs/plane/mod.rs create mode 100644 src/mesh/assimp-master/port/assimp_rs/src/structs/plane/plane.rs create mode 100644 src/mesh/assimp-master/port/assimp_rs/src/structs/quaternion/mod.rs create mode 100644 src/mesh/assimp-master/port/assimp_rs/src/structs/quaternion/quaternion.rs create mode 100644 src/mesh/assimp-master/port/assimp_rs/src/structs/ray/mod.rs create mode 100644 src/mesh/assimp-master/port/assimp_rs/src/structs/ray/ray.rs create mode 100644 src/mesh/assimp-master/port/assimp_rs/src/structs/scene/mod.rs create mode 100644 src/mesh/assimp-master/port/assimp_rs/src/structs/scene/scene.rs create mode 100644 src/mesh/assimp-master/port/assimp_rs/src/structs/string/mod.rs create mode 100644 src/mesh/assimp-master/port/assimp_rs/src/structs/string/string.rs create mode 100644 src/mesh/assimp-master/port/assimp_rs/src/structs/texture/mod.rs create mode 100644 src/mesh/assimp-master/port/assimp_rs/src/structs/texture/texture.rs create mode 100644 src/mesh/assimp-master/port/assimp_rs/src/structs/transform/mod.rs create mode 100644 src/mesh/assimp-master/port/assimp_rs/src/structs/transform/transform.rs create mode 100644 src/mesh/assimp-master/port/assimp_rs/src/structs/vec/mod.rs create mode 100644 src/mesh/assimp-master/port/assimp_rs/src/structs/vec/vec.rs create mode 100644 src/mesh/assimp-master/port/assimp_rs/src/structs/vertex/mod.rs create mode 100644 src/mesh/assimp-master/port/assimp_rs/src/structs/vertex/vertex.rs (limited to 'src/mesh/assimp-master/port/assimp_rs') diff --git a/src/mesh/assimp-master/port/assimp_rs/Cargo.lock b/src/mesh/assimp-master/port/assimp_rs/Cargo.lock new file mode 100644 index 0000000..4f571f3 --- /dev/null +++ b/src/mesh/assimp-master/port/assimp_rs/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "assimp_rs" +version = "0.1.0" + diff --git a/src/mesh/assimp-master/port/assimp_rs/Cargo.toml b/src/mesh/assimp-master/port/assimp_rs/Cargo.toml new file mode 100644 index 0000000..073a2b2 --- /dev/null +++ b/src/mesh/assimp-master/port/assimp_rs/Cargo.toml @@ -0,0 +1,9 @@ +[package] +name = "assimp_rs" +version = "0.1.0" +authors = ["David Golembiowski "] +edition = "2018" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] diff --git a/src/mesh/assimp-master/port/assimp_rs/src/camera/mod.rs b/src/mesh/assimp-master/port/assimp_rs/src/camera/mod.rs new file mode 100644 index 0000000..26ca118 --- /dev/null +++ b/src/mesh/assimp-master/port/assimp_rs/src/camera/mod.rs @@ -0,0 +1 @@ +pub use self::structs::{Camera}; diff --git a/src/mesh/assimp-master/port/assimp_rs/src/core/mod.rs b/src/mesh/assimp-master/port/assimp_rs/src/core/mod.rs new file mode 100644 index 0000000..e69de29 diff --git a/src/mesh/assimp-master/port/assimp_rs/src/errors/mod.rs b/src/mesh/assimp-master/port/assimp_rs/src/errors/mod.rs new file mode 100644 index 0000000..e69de29 diff --git a/src/mesh/assimp-master/port/assimp_rs/src/formats/mod.rs b/src/mesh/assimp-master/port/assimp_rs/src/formats/mod.rs new file mode 100644 index 0000000..e69de29 diff --git a/src/mesh/assimp-master/port/assimp_rs/src/lib.rs b/src/mesh/assimp-master/port/assimp_rs/src/lib.rs new file mode 100644 index 0000000..dbb6488 --- /dev/null +++ b/src/mesh/assimp-master/port/assimp_rs/src/lib.rs @@ -0,0 +1,17 @@ +pub mod camera; +pub mod core; +pub mod errors; +pub mod formats; +pub mod material; +pub mod postprocess; +pub mod shims; +pub mod socket; +pub mod structs; + +#[cfg(test)] +mod tests { + #[test] + fn it_works() { + assert_eq!(true, true); + } +} diff --git a/src/mesh/assimp-master/port/assimp_rs/src/material/mod.rs b/src/mesh/assimp-master/port/assimp_rs/src/material/mod.rs new file mode 100644 index 0000000..e69de29 diff --git a/src/mesh/assimp-master/port/assimp_rs/src/postprocess/mod.rs b/src/mesh/assimp-master/port/assimp_rs/src/postprocess/mod.rs new file mode 100644 index 0000000..e69de29 diff --git a/src/mesh/assimp-master/port/assimp_rs/src/shims/mod.rs b/src/mesh/assimp-master/port/assimp_rs/src/shims/mod.rs new file mode 100644 index 0000000..e69de29 diff --git a/src/mesh/assimp-master/port/assimp_rs/src/socket/mod.rs b/src/mesh/assimp-master/port/assimp_rs/src/socket/mod.rs new file mode 100644 index 0000000..e69de29 diff --git a/src/mesh/assimp-master/port/assimp_rs/src/structs/anim/anim.rs b/src/mesh/assimp-master/port/assimp_rs/src/structs/anim/anim.rs new file mode 100644 index 0000000..5374151 --- /dev/null +++ b/src/mesh/assimp-master/port/assimp_rs/src/structs/anim/anim.rs @@ -0,0 +1,44 @@ +pub struct Animation<'mA, 'mMA, 'nA> { + /* The name of the animation. If the modeling package this data was + * exported from does support only a single animation channel, this + * name is usually empty (length is zero). + */ + m_name: Option, + // Duration of the animation in ticks + m_duration: f64, + // Ticks per second. Zero (0.000... ticks/second) if not + // specified in the imported file + m_ticks_per_second: Option, + /* Number of bone animation channels. + Each channel affects a single node. + */ + m_num_channels: u64, + /* Node animation channels. Each channel + affects a single node. + ?? -> The array is m_num_channels in size. + (maybe refine to a derivative type of usize?) + */ + m_channels: &'nA NodeAnim, + /* Number of mesh animation channels. Each + channel affects a single mesh and defines + vertex-based animation. + */ + m_num_mesh_channels: u64, + /* The mesh animation channels. Each channel + affects a single mesh. + The array is m_num_mesh_channels in size + (maybe refine to a derivative of usize?) + */ + m_mesh_channels: &'mA MeshAnim, + /* The number of mesh animation channels. Each channel + affects a single mesh and defines some morphing animation. + */ + m_num_morph_mesh_channels: u64, + /* The morph mesh animation channels. Each channel affects a single mesh. + The array is mNumMorphMeshChannels in size. + */ + m_morph_mesh_channels: &'mMA MeshMorphAnim +} +pub struct NodeAnim {} +pub struct MeshAnim {} +pub struct MeshMorphAnim {} diff --git a/src/mesh/assimp-master/port/assimp_rs/src/structs/anim/mod.rs b/src/mesh/assimp-master/port/assimp_rs/src/structs/anim/mod.rs new file mode 100644 index 0000000..a0d4b7d --- /dev/null +++ b/src/mesh/assimp-master/port/assimp_rs/src/structs/anim/mod.rs @@ -0,0 +1,6 @@ +mod anim; +pub use self::anim::{ + Animation, + NodeAnim, + MeshAnim, + MeshMorphAnim}; diff --git a/src/mesh/assimp-master/port/assimp_rs/src/structs/blob/blob.rs b/src/mesh/assimp-master/port/assimp_rs/src/structs/blob/blob.rs new file mode 100644 index 0000000..e69de29 diff --git a/src/mesh/assimp-master/port/assimp_rs/src/structs/blob/mod.rs b/src/mesh/assimp-master/port/assimp_rs/src/structs/blob/mod.rs new file mode 100644 index 0000000..ad7612c --- /dev/null +++ b/src/mesh/assimp-master/port/assimp_rs/src/structs/blob/mod.rs @@ -0,0 +1,2 @@ +mod blob; + diff --git a/src/mesh/assimp-master/port/assimp_rs/src/structs/bone/bone.rs b/src/mesh/assimp-master/port/assimp_rs/src/structs/bone/bone.rs new file mode 100644 index 0000000..e69de29 diff --git a/src/mesh/assimp-master/port/assimp_rs/src/structs/bone/mod.rs b/src/mesh/assimp-master/port/assimp_rs/src/structs/bone/mod.rs new file mode 100644 index 0000000..758a15a --- /dev/null +++ b/src/mesh/assimp-master/port/assimp_rs/src/structs/bone/mod.rs @@ -0,0 +1,2 @@ +mod bone; + diff --git a/src/mesh/assimp-master/port/assimp_rs/src/structs/camera/camera.rs b/src/mesh/assimp-master/port/assimp_rs/src/structs/camera/camera.rs new file mode 100644 index 0000000..e69de29 diff --git a/src/mesh/assimp-master/port/assimp_rs/src/structs/camera/mod.rs b/src/mesh/assimp-master/port/assimp_rs/src/structs/camera/mod.rs new file mode 100644 index 0000000..d4d79d0 --- /dev/null +++ b/src/mesh/assimp-master/port/assimp_rs/src/structs/camera/mod.rs @@ -0,0 +1,2 @@ +mod camera; + diff --git a/src/mesh/assimp-master/port/assimp_rs/src/structs/color/color.rs b/src/mesh/assimp-master/port/assimp_rs/src/structs/color/color.rs new file mode 100644 index 0000000..0b5fc64 --- /dev/null +++ b/src/mesh/assimp-master/port/assimp_rs/src/structs/color/color.rs @@ -0,0 +1,27 @@ +#[derive(Clone, Debug, Copy)] +struct Color3D { + r: f32, + g: f32, + b: f32 +} + +impl Color3D { + pub fn new(r_f32: f32, g_f32: f32, b_f32: f32) -> Color3D { + Color3D {r: r_f32, g: g_f32, b: b_f32 } + } +} + +#[derive(Clone, Debug, Copy)] +struct Color4D { + r: f32, + g: f32, + b: f32, + a: f32 +} + +impl Color4D { + pub fn new(r_f32: f32, g_f32: f32, b_f32: f32, a_f32: f32) -> Color4D { + Color4D {r: r_f32, g: g_f32, b: b_f32, a: a_f32 } + } +} + diff --git a/src/mesh/assimp-master/port/assimp_rs/src/structs/color/mod.rs b/src/mesh/assimp-master/port/assimp_rs/src/structs/color/mod.rs new file mode 100644 index 0000000..d88527e --- /dev/null +++ b/src/mesh/assimp-master/port/assimp_rs/src/structs/color/mod.rs @@ -0,0 +1,5 @@ +mod color; +pub use self::color::{ + Color3D, + Color4D +}; diff --git a/src/mesh/assimp-master/port/assimp_rs/src/structs/face/face.rs b/src/mesh/assimp-master/port/assimp_rs/src/structs/face/face.rs new file mode 100644 index 0000000..e69de29 diff --git a/src/mesh/assimp-master/port/assimp_rs/src/structs/face/mod.rs b/src/mesh/assimp-master/port/assimp_rs/src/structs/face/mod.rs new file mode 100644 index 0000000..ae5aa5b --- /dev/null +++ b/src/mesh/assimp-master/port/assimp_rs/src/structs/face/mod.rs @@ -0,0 +1,2 @@ +mod face; + diff --git a/src/mesh/assimp-master/port/assimp_rs/src/structs/key/key.rs b/src/mesh/assimp-master/port/assimp_rs/src/structs/key/key.rs new file mode 100644 index 0000000..e69de29 diff --git a/src/mesh/assimp-master/port/assimp_rs/src/structs/key/mod.rs b/src/mesh/assimp-master/port/assimp_rs/src/structs/key/mod.rs new file mode 100644 index 0000000..b23779d --- /dev/null +++ b/src/mesh/assimp-master/port/assimp_rs/src/structs/key/mod.rs @@ -0,0 +1,2 @@ +mod key; + diff --git a/src/mesh/assimp-master/port/assimp_rs/src/structs/light/light.rs b/src/mesh/assimp-master/port/assimp_rs/src/structs/light/light.rs new file mode 100644 index 0000000..e69de29 diff --git a/src/mesh/assimp-master/port/assimp_rs/src/structs/light/mod.rs b/src/mesh/assimp-master/port/assimp_rs/src/structs/light/mod.rs new file mode 100644 index 0000000..a68b519 --- /dev/null +++ b/src/mesh/assimp-master/port/assimp_rs/src/structs/light/mod.rs @@ -0,0 +1,2 @@ +mod light; + diff --git a/src/mesh/assimp-master/port/assimp_rs/src/structs/material/material.rs b/src/mesh/assimp-master/port/assimp_rs/src/structs/material/material.rs new file mode 100644 index 0000000..e69de29 diff --git a/src/mesh/assimp-master/port/assimp_rs/src/structs/material/mod.rs b/src/mesh/assimp-master/port/assimp_rs/src/structs/material/mod.rs new file mode 100644 index 0000000..54de8b3 --- /dev/null +++ b/src/mesh/assimp-master/port/assimp_rs/src/structs/material/mod.rs @@ -0,0 +1,2 @@ +mod material; + diff --git a/src/mesh/assimp-master/port/assimp_rs/src/structs/matrix/matrix.rs b/src/mesh/assimp-master/port/assimp_rs/src/structs/matrix/matrix.rs new file mode 100644 index 0000000..4673b2d --- /dev/null +++ b/src/mesh/assimp-master/port/assimp_rs/src/structs/matrix/matrix.rs @@ -0,0 +1,64 @@ +#[derive(Clone, Debug, Copy)] +struct Matrix3x3 { + a1: f32, + a2: f32, + a3: f32, + b1: f32, + b2: f32, + b3: f32, + c1: f32, + c2: f32, + c3: f32 +} + +#[derive(Clone, Debug, Copy)] +struct Matrix4x4 { + a1: f32, + a2: f32, + a3: f32, + a4: f32, + b1: f32, + b2: f32, + b3: f32, + b4: f32, + c1: f32, + c2: f32, + c3: f32, + c4: f32, + d1: f32, + d2: f32, + d3: f32, + d4: f32 +} + +impl Matrix3x3 { + pub fn new( + a1_f32: f32, a2_f32: f32, a3_f32: f32, + b1_f32: f32, b2_f32: f32, b3_f32: f32, + c1_f32: f32, c2_f32: f32, c3_f32: f32 + ) -> Matrix3x3 { + Matrix3x3 { + a1: a1_f32, a2: a2_f32, a3: a3_f32, + b1: b1_f32, b2: b2_f32, b3: b3_f32, + c1: c1_f32, c2: c2_f32, c3: c3_f32 + } + } +} + +impl Matrix4x4 { + pub fn new( + a1_f32: f32, a2_f32: f32, a3_f32: f32, a4_f32: f32, + b1_f32: f32, b2_f32: f32, b3_f32: f32, b4_f32: f32, + c1_f32: f32, c2_f32: f32, c3_f32: f32, c4_f32: f32, + d1_f32: f32, d2_f32: f32, d3_f32: f32, d4_f32: f32 + ) -> Matrix4x4 { + Matrix4x4 { + a1: a1_f32, a2: a2_f32, a3: a3_f32, a4: a4_f32, + b1: b1_f32, b2: b2_f32, b3: b3_f32, b4: b4_f32, + c1: c1_f32, c2: c2_f32, c3: c3_f32, c4: c4_f32, + d1: d1_f32, d2: d2_f32, d3: d3_f32, d4: d4_f32 + } + } +} + + diff --git a/src/mesh/assimp-master/port/assimp_rs/src/structs/matrix/mod.rs b/src/mesh/assimp-master/port/assimp_rs/src/structs/matrix/mod.rs new file mode 100644 index 0000000..b0fb1e1 --- /dev/null +++ b/src/mesh/assimp-master/port/assimp_rs/src/structs/matrix/mod.rs @@ -0,0 +1,4 @@ +mod matrix; +pub use self::matrix::{ + Matrix3x3, + Matrix4x4}; diff --git a/src/mesh/assimp-master/port/assimp_rs/src/structs/memory/memory.rs b/src/mesh/assimp-master/port/assimp_rs/src/structs/memory/memory.rs new file mode 100644 index 0000000..c076f17 --- /dev/null +++ b/src/mesh/assimp-master/port/assimp_rs/src/structs/memory/memory.rs @@ -0,0 +1,35 @@ +#[derive(Clone, Debug, Copy)] +struct MemoryInfo { + textures: u32, + materials: u32, + meshes: u32, + nodes: u32, + animations: u32, + cameras: u32, + lights: u32, + total: u32 +} + +impl MemoryInfo { + pub fn new( + textures_uint: u32, + materials_uint: u32, + meshes_uint: u32, + nodes_uint: u32, + animations_uint: u32, + cameras_uint: u32, + lights_uint: u32, + total_uint: u32) -> MemoryInfo { + + MemoryInfo { + textures: textures_uint, + materials: materials_uint, + meshes: meshes_uint, + nodes: nodes_uint, + animations: animations_uint, + cameras: cameras_uint, + lights: lights_uint, + total: total_uint + } + } +} diff --git a/src/mesh/assimp-master/port/assimp_rs/src/structs/memory/mod.rs b/src/mesh/assimp-master/port/assimp_rs/src/structs/memory/mod.rs new file mode 100644 index 0000000..8c8c31c --- /dev/null +++ b/src/mesh/assimp-master/port/assimp_rs/src/structs/memory/mod.rs @@ -0,0 +1,2 @@ +mod memory; +pub use self::memory::MemoryInfo; diff --git a/src/mesh/assimp-master/port/assimp_rs/src/structs/mesh/mesh.rs b/src/mesh/assimp-master/port/assimp_rs/src/structs/mesh/mesh.rs new file mode 100644 index 0000000..e69de29 diff --git a/src/mesh/assimp-master/port/assimp_rs/src/structs/mesh/mod.rs b/src/mesh/assimp-master/port/assimp_rs/src/structs/mesh/mod.rs new file mode 100644 index 0000000..1c3ef65 --- /dev/null +++ b/src/mesh/assimp-master/port/assimp_rs/src/structs/mesh/mod.rs @@ -0,0 +1,3 @@ +mod mesh; + + diff --git a/src/mesh/assimp-master/port/assimp_rs/src/structs/meta/meta.rs b/src/mesh/assimp-master/port/assimp_rs/src/structs/meta/meta.rs new file mode 100644 index 0000000..e69de29 diff --git a/src/mesh/assimp-master/port/assimp_rs/src/structs/meta/mod.rs b/src/mesh/assimp-master/port/assimp_rs/src/structs/meta/mod.rs new file mode 100644 index 0000000..0452947 --- /dev/null +++ b/src/mesh/assimp-master/port/assimp_rs/src/structs/meta/mod.rs @@ -0,0 +1,2 @@ +mod meta; + diff --git a/src/mesh/assimp-master/port/assimp_rs/src/structs/mod.rs b/src/mesh/assimp-master/port/assimp_rs/src/structs/mod.rs new file mode 100644 index 0000000..fd90876 --- /dev/null +++ b/src/mesh/assimp-master/port/assimp_rs/src/structs/mod.rs @@ -0,0 +1,61 @@ +mod anim; +/* Animation + * NodeAnim + * MeshAnim + * MeshMorphAnim + */ +mod blob; +/* ExportDataBlob + */ +mod vec; +/* Vector2d + * Vector3d + * */ +mod matrix; +/* Matrix3by3 + * Matrix4by4 + */ +mod camera; +/* Camera */ +mod color; +/* Color3d + * Color4d + */ +mod key; +/* MeshKey + * MeshMorphKey + * QuatKey + * VectorKey + */ +mod texel; +mod plane; +mod string; +/* String + */ +mod material; +/* Material + * MaterialPropery + * MaterialPropertyString + */ +mod mem; +mod quaternion; +mod face; +mod vertex_weight; +mod mesh; +/* Mesh + */ +mod meta; +/* Metadata + * MetadataEntry + */ +mod node; +/* Node + * */ +mod light; +mod texture; +mod ray; +mod transform; +/* UVTransform */ +mod bone; +mod scene; +/* Scene */ diff --git a/src/mesh/assimp-master/port/assimp_rs/src/structs/node/mod.rs b/src/mesh/assimp-master/port/assimp_rs/src/structs/node/mod.rs new file mode 100644 index 0000000..c1fc34c --- /dev/null +++ b/src/mesh/assimp-master/port/assimp_rs/src/structs/node/mod.rs @@ -0,0 +1,2 @@ +mod node; + diff --git a/src/mesh/assimp-master/port/assimp_rs/src/structs/node/node.rs b/src/mesh/assimp-master/port/assimp_rs/src/structs/node/node.rs new file mode 100644 index 0000000..e69de29 diff --git a/src/mesh/assimp-master/port/assimp_rs/src/structs/plane/mod.rs b/src/mesh/assimp-master/port/assimp_rs/src/structs/plane/mod.rs new file mode 100644 index 0000000..c73a8ed --- /dev/null +++ b/src/mesh/assimp-master/port/assimp_rs/src/structs/plane/mod.rs @@ -0,0 +1,2 @@ +mod plane; + diff --git a/src/mesh/assimp-master/port/assimp_rs/src/structs/plane/plane.rs b/src/mesh/assimp-master/port/assimp_rs/src/structs/plane/plane.rs new file mode 100644 index 0000000..2b0b744 --- /dev/null +++ b/src/mesh/assimp-master/port/assimp_rs/src/structs/plane/plane.rs @@ -0,0 +1,23 @@ +#[derive(Clone, Debug, Copy)] +struct Plane { + a: f32, + b: f32, + c: f32, + d: f32 +} + +impl Plane { + pub fn new( + a_f32: f32, + b_f32: f32, + c_f32: f32, + d_f32: f32 + ) -> Plane { + Plane { + a: a_f32, + b: b_f32, + c: b_f32, + d: d_f32 + } + } +} diff --git a/src/mesh/assimp-master/port/assimp_rs/src/structs/quaternion/mod.rs b/src/mesh/assimp-master/port/assimp_rs/src/structs/quaternion/mod.rs new file mode 100644 index 0000000..bb2c061 --- /dev/null +++ b/src/mesh/assimp-master/port/assimp_rs/src/structs/quaternion/mod.rs @@ -0,0 +1,3 @@ +mod quaternion; + +pub use self::quaternion::Quaternion; diff --git a/src/mesh/assimp-master/port/assimp_rs/src/structs/quaternion/quaternion.rs b/src/mesh/assimp-master/port/assimp_rs/src/structs/quaternion/quaternion.rs new file mode 100644 index 0000000..970f5cc --- /dev/null +++ b/src/mesh/assimp-master/port/assimp_rs/src/structs/quaternion/quaternion.rs @@ -0,0 +1,7 @@ +use crate::vec; + +#[derive(Clone, Debug, Copy)] +pub struct Quaternion { + _coordinates: vec::Vector4d + +} diff --git a/src/mesh/assimp-master/port/assimp_rs/src/structs/ray/mod.rs b/src/mesh/assimp-master/port/assimp_rs/src/structs/ray/mod.rs new file mode 100644 index 0000000..7f0be07 --- /dev/null +++ b/src/mesh/assimp-master/port/assimp_rs/src/structs/ray/mod.rs @@ -0,0 +1,2 @@ +mod ray; + diff --git a/src/mesh/assimp-master/port/assimp_rs/src/structs/ray/ray.rs b/src/mesh/assimp-master/port/assimp_rs/src/structs/ray/ray.rs new file mode 100644 index 0000000..e69de29 diff --git a/src/mesh/assimp-master/port/assimp_rs/src/structs/scene/mod.rs b/src/mesh/assimp-master/port/assimp_rs/src/structs/scene/mod.rs new file mode 100644 index 0000000..5aea638 --- /dev/null +++ b/src/mesh/assimp-master/port/assimp_rs/src/structs/scene/mod.rs @@ -0,0 +1,2 @@ +mod scene; + diff --git a/src/mesh/assimp-master/port/assimp_rs/src/structs/scene/scene.rs b/src/mesh/assimp-master/port/assimp_rs/src/structs/scene/scene.rs new file mode 100644 index 0000000..e69de29 diff --git a/src/mesh/assimp-master/port/assimp_rs/src/structs/string/mod.rs b/src/mesh/assimp-master/port/assimp_rs/src/structs/string/mod.rs new file mode 100644 index 0000000..f599ba7 --- /dev/null +++ b/src/mesh/assimp-master/port/assimp_rs/src/structs/string/mod.rs @@ -0,0 +1,3 @@ +mod string; +pub use self::string::MAXLEN; +pub use self::string::Str; diff --git a/src/mesh/assimp-master/port/assimp_rs/src/structs/string/string.rs b/src/mesh/assimp-master/port/assimp_rs/src/structs/string/string.rs new file mode 100644 index 0000000..b88457d --- /dev/null +++ b/src/mesh/assimp-master/port/assimp_rs/src/structs/string/string.rs @@ -0,0 +1,41 @@ +pub const MAXLEN: usize = 1024; + +/// Want to consider replacing `Vec` +/// with a comparable definition at +/// https://doc.rust-lang.org/src/alloc/string.rs.html#415-417 +#[derive(Clone, Debug)] +struct Str { + length: usize, + data: Vec +} + +impl Str { + pub fn new(len_u32: usize, data_string: String) -> Str { + Str { + length: len_u32, + data: data_string.chars().collect() + } + } +} + +/// MaterialPropertyStr +/// The size of length is truncated to 4 bytes on a 64-bit platform when used as a +/// material property (see MaterialSystem.cpp, as aiMaterial::AddProperty() ). +#[derive(Clone, Debug)] +struct MaterialPropertyStr { + length: usize, + data: Vec +} + + +impl MaterialPropertyStr { + pub fn new(len_u32: usize, data_string: String) -> MaterialPropertyStr { + MaterialPropertyStr { + length: len_u32, + data: data_string.chars().collect() + } + } +} + + + diff --git a/src/mesh/assimp-master/port/assimp_rs/src/structs/texture/mod.rs b/src/mesh/assimp-master/port/assimp_rs/src/structs/texture/mod.rs new file mode 100644 index 0000000..1b5c930 --- /dev/null +++ b/src/mesh/assimp-master/port/assimp_rs/src/structs/texture/mod.rs @@ -0,0 +1,3 @@ +mod texture; +pub use self::texture::Texel; + diff --git a/src/mesh/assimp-master/port/assimp_rs/src/structs/texture/texture.rs b/src/mesh/assimp-master/port/assimp_rs/src/structs/texture/texture.rs new file mode 100644 index 0000000..b2c72f3 --- /dev/null +++ b/src/mesh/assimp-master/port/assimp_rs/src/structs/texture/texture.rs @@ -0,0 +1,19 @@ +#[derive(Clone, Debug, Copy)] +struct Texel { + b: u32, + g: u32, + r: u32, + a: u32 +} + +impl Texel { + pub fn new(b_u32: u32, g_u32: u32, + r_u32: u32, a_u32: u32) -> Texel { + Texel { + b: b_u32, + g: g_u32, + r: r_u32, + a: a_u32 + } + } +} diff --git a/src/mesh/assimp-master/port/assimp_rs/src/structs/transform/mod.rs b/src/mesh/assimp-master/port/assimp_rs/src/structs/transform/mod.rs new file mode 100644 index 0000000..b80c43d --- /dev/null +++ b/src/mesh/assimp-master/port/assimp_rs/src/structs/transform/mod.rs @@ -0,0 +1,2 @@ +mod transform; + diff --git a/src/mesh/assimp-master/port/assimp_rs/src/structs/transform/transform.rs b/src/mesh/assimp-master/port/assimp_rs/src/structs/transform/transform.rs new file mode 100644 index 0000000..e69de29 diff --git a/src/mesh/assimp-master/port/assimp_rs/src/structs/vec/mod.rs b/src/mesh/assimp-master/port/assimp_rs/src/structs/vec/mod.rs new file mode 100644 index 0000000..3613d5d --- /dev/null +++ b/src/mesh/assimp-master/port/assimp_rs/src/structs/vec/mod.rs @@ -0,0 +1,2 @@ +mod vec; + diff --git a/src/mesh/assimp-master/port/assimp_rs/src/structs/vec/vec.rs b/src/mesh/assimp-master/port/assimp_rs/src/structs/vec/vec.rs new file mode 100644 index 0000000..ee0d194 --- /dev/null +++ b/src/mesh/assimp-master/port/assimp_rs/src/structs/vec/vec.rs @@ -0,0 +1,48 @@ +struct Vector2d { + x: f32, + y: f32 +} + +struct Vector3d { + x: f32, + y: f32, + z: f32 +} + +struct Vector4d { + x: f32, + y: f32, + z: f32, + w: 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 + } + } +} + +impl Vector4d { + pub fn new(x_f32: f32, y_f32: f32, z_f32: f32, w_f32: f32) -> Vector4d { + Vector4d { + x: x_f32, + y: y_f32, + z: z_f32, + w: w_f32 + } + } +} + diff --git a/src/mesh/assimp-master/port/assimp_rs/src/structs/vertex/mod.rs b/src/mesh/assimp-master/port/assimp_rs/src/structs/vertex/mod.rs new file mode 100644 index 0000000..97ae3ec --- /dev/null +++ b/src/mesh/assimp-master/port/assimp_rs/src/structs/vertex/mod.rs @@ -0,0 +1,2 @@ +mod vertex; +// pub use self::vertex:: diff --git a/src/mesh/assimp-master/port/assimp_rs/src/structs/vertex/vertex.rs b/src/mesh/assimp-master/port/assimp_rs/src/structs/vertex/vertex.rs new file mode 100644 index 0000000..e69de29 -- cgit v1.2.1