Added torus

This commit is contained in:
STP
2023-11-24 22:35:20 -05:00
parent 1fbcb8f79b
commit ccac1f414d
3 changed files with 9 additions and 3 deletions

View File

@@ -2,7 +2,7 @@ use nalgebra::Point3;
use pixels::{wgpu, PixelsContext}; use pixels::{wgpu, PixelsContext};
use std::time::Instant; use std::time::Instant;
const INIT_FILE: &str = "test.rhai"; const INIT_FILE: &str = "scene.rhai";
const BUFFER_PROPORTION_INIT: f32 = 1.0; const BUFFER_PROPORTION_INIT: f32 = 1.0;
const BUFFER_PROPORTION_MIN: f32 = 0.5; const BUFFER_PROPORTION_MIN: f32 = 0.5;
@@ -16,7 +16,7 @@ const CAMERA_MIN: f32 = -10.0;
const CAMERA_MAX: f32 = 10.0; const CAMERA_MAX: f32 = 10.0;
const CAMERA_INIT: f32 = 5.0; const CAMERA_INIT: f32 = 5.0;
/// Manages all state required for rendering Dear ImGui over `Pixels`. /// Manages all state required for rendering Dear ImGui over `Pixels`test.
pub enum GuiEvent { pub enum GuiEvent {
BufferResize, BufferResize,
CameraRelocate, CameraRelocate,

View File

@@ -148,6 +148,12 @@ impl Scene {
.register_type::<Rectangle>() .register_type::<Rectangle>()
.register_fn("Rectangle", Rectangle::new) .register_fn("Rectangle", Rectangle::new)
.register_fn("RectangleUnit", Rectangle::unit); .register_fn("RectangleUnit", Rectangle::unit);
engine
.register_type::<SteinerSurface>()
.register_fn("Steiner", SteinerSurface::new);
engine
.register_type::<Torus>()
.register_fn("Torus", Torus::new);
let scene: Scene = engine.eval_file(filename.into())?; let scene: Scene = engine.eval_file(filename.into())?;
Ok(scene) Ok(scene)

View File

@@ -16,7 +16,7 @@ use winit::window::{Window, WindowBuilder};
const START_WIDTH: i32 = 800; const START_WIDTH: i32 = 800;
const START_HEIGHT: i32 = 800; const START_HEIGHT: i32 = 800;
const COLOUR_CLEAR: [u8; 4] = [0x22, 0x22, 0x11, 0xff]; const COLOUR_CLEAR: [u8; 4] = [0x22, 0x00, 0x11, 0xff];
const INIT_FILE: &str = "test.rhai"; const INIT_FILE: &str = "test.rhai";