We cant build recursive enum type, as the size of that time would be infitite
This commit is contained in:
parent
c4a794c4f2
commit
58a9c36d0d
@ -1,2 +1,2 @@
|
||||
mod geometry;
|
||||
pub mod geometry;
|
||||
pub mod math;
|
||||
|
||||
@ -1,4 +1,10 @@
|
||||
use hello::math::Point3;
|
||||
use hello::geometry::Geometry;
|
||||
use hello::math::{Mat4x4, Point3};
|
||||
|
||||
enum SceneGraphNode {
|
||||
Geometry(Mat4x4, Geometry),
|
||||
SubNode(Mat4x4, SceneGraphNode),
|
||||
}
|
||||
|
||||
fn main() {
|
||||
let p1 = Point3::new(0.0, 0.0, 0.0);
|
||||
|
||||
@ -90,6 +90,10 @@ impl Sub for Point3 {
|
||||
}
|
||||
}
|
||||
|
||||
pub struct Mat4x4 {
|
||||
v: f64,
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user