git checkout --orphan gh-pages
git reset --hard
git commit --allow-empty -m "Initializing gh-pages branch"
git push origin gh-pages
git checkout main
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[package] | |
name = "app" | |
version = "0.1.0" | |
edition = "2021" | |
[dependencies] | |
egui = "0.27.2" | |
egui-wgpu = { version = "0.27.2", features = ["winit"] } | |
egui-winit = "0.27.2" | |
pollster = "0.3.0" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// [dependencies] | |
// anyhow = "1.0.40" | |
// env_logger = "0.11.1" | |
// winit = "0.29.10" | |
fn main() -> anyhow::Result<()> { | |
env_logger::init(); | |
let event_loop = winit::event_loop::EventLoop::new()?; | |
let _window = winit::window::WindowBuilder::new() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// [dependencies] | |
// anyhow = "1.0.40" | |
// env_logger = "0.11.1" | |
// winit = "0.28.7" | |
use anyhow::Result; | |
fn main() -> Result<()> { | |
env_logger::init(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use std::f32::consts::PI; | |
// Complex number struct | |
#[derive(Clone, Copy)] | |
struct Complex { | |
re: f32, | |
im: f32, | |
} | |
// Implementing basic operations for Complex numbers |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// cosine based palette, 4 vec3 params | |
vec3 palette( in float t ) | |
{ | |
vec3 a = vec3(0.5, 0.1, 0.1); | |
vec3 b = vec3(0.7, 0.4, 0.4); | |
vec3 c = vec3(1.0, 0.8, 0.8); | |
vec3 d = vec3(0.263, 0.416, 0.557); | |
return a + b*cos( 6.28318*(c*t+d) ); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pub fn decompose_matrix( | |
matrix: &nalgebra_glm::Mat4, | |
) -> (nalgebra_glm::Vec3, nalgebra_glm::Quat, nalgebra_glm::Vec3) { | |
let translation = nalgebra_glm::Vec3::new(matrix.m14, matrix.m24, matrix.m34); | |
let (scale_x, scale_y, scale_z) = ( | |
nalgebra_glm::length(&nalgebra_glm::Vec3::new(matrix.m11, matrix.m12, matrix.m13)), | |
nalgebra_glm::length(&nalgebra_glm::Vec3::new(matrix.m21, matrix.m22, matrix.m23)), | |
nalgebra_glm::length(&nalgebra_glm::Vec3::new(matrix.m31, matrix.m32, matrix.m33)), | |
); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fn visit_graph_recursively<N, E, VM>( | |
graph: &petgraph::graph::DiGraph<N, E>, | |
visit_map: &mut VM, | |
node_idx: petgraph::graph::NodeIndex, | |
) where | |
N: std::fmt::Debug, | |
VM: petgraph::visit::VisitMap<petgraph::graph::NodeIndex>, | |
{ | |
// Mark the current node as visited | |
visit_map.visit(node_idx); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#[derive(Default, Debug, Clone, serde::Serialize, serde::Deserialize)] | |
pub enum Command { | |
#[default] | |
Empty, | |
Exit, | |
} | |
impl Command { | |
pub fn execute(&mut self, context: &mut Context) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use std::time::{Instant}; | |
#[derive(Clone)] // Derive the Clone trait to enable cloning of State | |
struct State { | |
// Example fields representing the state of the physics object | |
position: f64, | |
velocity: f64, | |
} | |
// Function to update the physics state of the object |