Skip to content

Commit

Permalink
"Auto commit number 36"
Browse files Browse the repository at this point in the history
  • Loading branch information
lat-murmeldjur committed Mar 27, 2024
1 parent 8e0c7e1 commit 79ba19c
Show file tree
Hide file tree
Showing 10 changed files with 53 additions and 73 deletions.
2 changes: 1 addition & 1 deletion chronicl.dt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
35
36
2 changes: 1 addition & 1 deletion featuring.dt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
35
36
1 change: 1 addition & 0 deletions ohio.note
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,4 @@ Year::2024::|::Month::03::|::Day::25::|::Hour::18::|::Minute::28::|::Second::03:
Year::2024::|::Month::03::|::Day::25::|::Hour::20::|::Minute::22::|::Second::48::
Year::2024::|::Month::03::|::Day::26::|::Hour::16::|::Minute::25::|::Second::20::
Year::2024::|::Month::03::|::Day::27::|::Hour::16::|::Minute::33::|::Second::15::
Year::2024::|::Month::03::|::Day::27::|::Hour::16::|::Minute::56::|::Second::43::
20 changes: 8 additions & 12 deletions src/anomaly.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
// experimental generic composite reductive approximation outline
use std::sync::mpsc;
use std::thread;
use std::thread::JoinHandle;


use crate::f32_3::dd_f32_3;
use crate::f64_3::mltply_f64_3;
use crate::magma_ocean::{magma, petrify, Stone};
use crate::positions::{move_positions, Normal, Position};
use crate::positions::{move_positions};

pub static ts_f64: f64 = 5.391247 * 1e-44;
pub static ls_f64: f64 = 299792458.0 * 1000000000.0 * 6.1879273537329 * 1e+25;
Expand Down Expand Up @@ -54,14 +54,10 @@ pub fn interact(anom: &mut Anomaly) {
component_interact(anom);
}

pub fn component_interact(anom: &mut Anomaly) {
for f in &anom.Force {
// for mut a in anom.Anomaly.iter_mut() {
// for mut b in anom.Anomaly.iter_mut() {
// println!("0");
// }
// }
}
pub fn component_interact(_anom: &mut Anomaly) {
// for f in &anom.Force {
//
// }
}

pub fn progress(anom: &mut Anomaly, time: f64) {
Expand Down Expand Up @@ -113,7 +109,7 @@ pub fn component_progress(component: &mut Component, time: f64) {
let inertia_2 = component_property(component, In2);

for c in &mut component.Composition {
for mut s in c.Space.iter_mut() {
for s in c.Space.iter_mut() {
let mov0 = mltply_f64_3([inertia_0, inertia_1, inertia_2], ts_f64);
*s = dd_f32_3(*s, [mov0[0] as f32, mov0[1] as f32, mov0[2] as f32]);
}
Expand Down Expand Up @@ -177,7 +173,7 @@ pub fn add_particle_by(anom: &mut Anomaly, p: Anomaly) {
}

pub fn particle(position: [f32; 3], properties: Vec<Property>) -> Anomaly {
let mut anom = Anomaly {
let anom = Anomaly {
Anomaly: vec![],
Component: vec![Component {
Component: vec![],
Expand Down
6 changes: 3 additions & 3 deletions src/f32_3.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ pub fn angle_of(c: [f32; 3], x: [f32; 3], r: [f32; 3]) -> f32 {
return 0.0;
}

let mut angle_of = (dot_product(vector, r) / (vl * vector_length(r)));
let mut angle_of = dot_product(vector, r) / (vl * vector_length(r));

if angle_of > 1.0 {
angle_of = 1.0;
Expand All @@ -125,7 +125,7 @@ pub fn angle_360_of(c: [f32; 3], x: [f32; 3], r: [f32; 3], norm: [f32; 3]) -> f3
}

let vector = nrmlz_f32_3(diff);
let mut angle_of = (dot_product(vector, r) / (vector_length(vector) * vector_length(r)));
let mut angle_of = dot_product(vector, r) / (vector_length(vector) * vector_length(r));

if angle_of > 1.0 {
angle_of = 1.0;
Expand All @@ -140,7 +140,7 @@ pub fn angle_360_of(c: [f32; 3], x: [f32; 3], r: [f32; 3], norm: [f32; 3]) -> f3
let n = find_orthogonal_f32_3(norm, r);

// (v−p)⋅n>0
if (dot_product(diff, n) < 0.0) {
if dot_product(diff, n) < 0.0 {
return 2.0 * PI - angle;
}

Expand Down
32 changes: 13 additions & 19 deletions src/magma_ocean.rs
Original file line number Diff line number Diff line change
@@ -1,23 +1,17 @@
use rand::rngs::ThreadRng;
use rand::Rng;
use std::f32::consts::PI;
use std::thread;
use std::time::{Duration, SystemTime};
use vulkano::{buffer::BufferContents, pipeline::graphics::vertex_input::Vertex};
use std::time::Duration;

use crate::positions::{create_points_on_cross_section, sort_positions_by_angle, Normal, Position};

use crate::f32_3::{
angle_360_of, angle_of, angular_difference, average_f32_3, dd_f32_3, dot_product, dstnc_f32_3,
find_points_normal, gen_f32_3, gen_f32_3_unit_on_point_normal_plane, gen_rthgnl_f32_3,
mltply_f32_3, nrmlz_f32_3, sbtr_f32_3, vector_length,
angle_360_of, angular_difference, average_f32_3, dd_f32_3, find_points_normal, gen_f32_3,
gen_rthgnl_f32_3, mltply_f32_3, nrmlz_f32_3, sbtr_f32_3, vector_length,
};

use crate::shapes::{f32_3_dots_collinear, rotational_distance_function_sine, spherical_progress};

use crate::u_modular::{
modular_difference, modular_difference_in_range, modular_offset, modular_offset_in_range,
};
use crate::u_modular::{modular_difference_in_range, modular_offset_in_range};

#[derive(Debug)]
pub struct Magma {
Expand Down Expand Up @@ -48,7 +42,7 @@ pub fn magma(flow: u32, scale: f32) -> Magma {
indices: vec![],
};

let mut base = scale;
let base = scale;
let mut cbase = -2.5 * scale;
for i in 1..=flow {
lava_flow.positions.push(Position {
Expand Down Expand Up @@ -152,11 +146,11 @@ pub fn petrify(flow: Magma) -> Stone {

for i in 0..points_of_plane {
stone.positions.push(Position {
position: plane.positions[(i as usize)].position,
position: plane.positions[i as usize].position,
});
let normal = //nrmlz_f32_3(gen_f32_3(0.0, 1.0, &mut rng));
// find_points_normal(plane.positions[(i as usize)].position, *plane_point);
find_points_normal(plane.positions[(i as usize)].position, normal_origin);
find_points_normal(plane.positions[i as usize].position, normal_origin);
stone.normals.push(Normal { normal: normal });
}

Expand All @@ -179,7 +173,7 @@ pub fn petrify(flow: Magma) -> Stone {
//vertex_plane_one: [u32; 2],
[previous_plane[1], previous_plane[2] - 1],
//plane_one: [f32; 3],
planes_points[(previous_plane[0] as usize)],
planes_points[previous_plane[0] as usize],
//vertex_plane_two: [u32; 2],
[previous_plane[2], previous_plane[2] + points_of_plane - 1],
//plane_two: [f32; 3],
Expand Down Expand Up @@ -216,7 +210,7 @@ pub fn petrify(flow: Magma) -> Stone {
return stone;
}

pub fn petrify_flow(flow: Magma) -> Stone {
pub fn petrify_flow(_flow: Magma) -> Stone {
return Stone {
positions: vec![],
normals: vec![],
Expand Down Expand Up @@ -294,11 +288,11 @@ pub fn find_indices_double_circle(
// they can be located far away in a single direction

let po1 = sbtr_f32_3(
stone.positions[(i as usize)].position,
stone.positions[i as usize].position,
double_planes_points_center,
);
let po2 = sbtr_f32_3(
stone.positions[(k as usize)].position,
stone.positions[k as usize].position,
double_planes_points_center,
);

Expand All @@ -314,7 +308,7 @@ pub fn find_indices_double_circle(

for j in single_vertex_plane[0]..=single_vertex_plane[1] {
let po3 = sbtr_f32_3(
stone.positions[(j as usize)].position,
stone.positions[j as usize].position,
single_planes_points_center,
);
let nrml_point_3 = dd_f32_3(
Expand Down Expand Up @@ -367,7 +361,7 @@ pub fn find_indices_double_circle(
loop_for = single_vertex_plane[1] - single_vertex_plane[0] + 1;
}

for l in 1..=loop_for {
for _l in 1..=loop_for {
stone.indices.push(index_double_saved);
stone.indices.push(running_index);
stone.indices.push(modular_offset_in_range(
Expand Down
45 changes: 19 additions & 26 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,7 @@
#![allow(warnings)] // not today, erosion

mod display_mods;
use display_mods::{
display_time_elapsed_nice, oclock, record_nanos, wait_one_millis_and_micros_and_nanos,
Groupable,
};
use display_mods::{display_time_elapsed_nice, oclock, record_nanos, Groupable};

mod f32_3;
use f32_3::gen_f32_3;
Expand All @@ -21,21 +18,20 @@ mod f64_3;
use f64_3::{gen_f64_3, mltply_f64_3, nrmlz_f64_3};

mod positions;
use positions::{move_positions, Normal, Position};
use positions::{Normal, Position};

mod shapes;
mod u_modular;

mod magma_ocean;
use magma_ocean::{magma, petrify, Stone};
use magma_ocean::Stone;

mod anomaly;
use anomaly::{add_particle_by, e, ls_f64, progress, q, ts_f64, view, Anomaly};

mod moving_around;
use moving_around::{
move_elevation, move_forwards, move_in_x, move_in_y, move_in_z, move_sideways,
rotate_horizontal, rotate_up, rotate_vertical,
move_elevation, move_forwards, move_sideways, rotate_horizontal, rotate_up, rotate_vertical,
};

use cgmath::{Matrix3, Matrix4, Point3, Rad, Vector3};
Expand Down Expand Up @@ -79,7 +75,7 @@ use vulkano::{
GraphicsPipeline, Pipeline, PipelineBindPoint, PipelineLayout,
PipelineShaderStageCreateInfo,
},
query::{QueryControlFlags, QueryPool, QueryPoolCreateInfo, QueryResultFlags, QueryType},
query::{QueryControlFlags, QueryPool, QueryPoolCreateInfo, QueryType},
render_pass::{Framebuffer, FramebufferCreateInfo, RenderPass, Subpass},
shader::EntryPoint,
swapchain::{
Expand All @@ -89,21 +85,15 @@ use vulkano::{
Validated, VulkanError, VulkanLibrary,
};
use winit::{
dpi::{LogicalPosition, LogicalSize},
event::{DeviceEvent, ElementState, Event, KeyEvent, RawKeyEvent, WindowEvent},
event_loop::{ActiveEventLoop, ControlFlow, EventLoop},
keyboard::{Key, KeyCode, ModifiersState, PhysicalKey},

// WARNING: This is not available on all platforms (for example on the web).
platform::modifier_supplement::KeyEventExtModifierSupplement,
raw_window_handle::HasRawWindowHandle,
window::{Fullscreen, Window, WindowAttributes, WindowId},
event::{DeviceEvent, ElementState, Event, RawKeyEvent, WindowEvent},
event_loop::EventLoop,
keyboard::{KeyCode, ModifiersState, PhysicalKey},
window::{Fullscreen, Window},
};

use rand::rngs::ThreadRng;
use rand::Rng;

pub struct bv {
pub struct Bv {
pub v: Subbuffer<[Position]>,
pub n: Subbuffer<[Normal]>,
pub i: Subbuffer<[u32]>,
Expand Down Expand Up @@ -362,7 +352,7 @@ fn main() {

duration_since_epoch_nanos = display_time_elapsed_nice(duration_since_epoch_nanos);

let mut modifiers = ModifiersState::default();
let _modifiers = ModifiersState::default();

// Create a query pool for occlusion queries, with 3 slots.
let query_pool = QueryPool::new(
Expand Down Expand Up @@ -444,7 +434,7 @@ fn main() {
turning_down = true;
}
PhysicalKey::Code(KeyCode::KeyP) => {
if (rot_static) {
if rot_static {
rot_static = false;
} else {
rot_static = true;
Expand Down Expand Up @@ -500,7 +490,10 @@ fn main() {
_ => (),
},

Event::WindowEvent { window_id, event } => match event {
Event::WindowEvent {
window_id: _,
event,
} => match event {
WindowEvent::CloseRequested => {
control_flow.exit();
}
Expand Down Expand Up @@ -555,12 +548,12 @@ fn main() {
progress(&mut anom, ts_f64);
let get = view(&mut anom);

let mut bvs: Vec<bv> = vec![];
let mut bvs: Vec<Bv> = vec![];

for mut g in get {
let (vertex_buffer, normals_buffer, index_buffer) =
load_buffers_short(&mut g, memory_allocator.clone());
bvs.push(bv {
bvs.push(Bv {
v: vertex_buffer,
n: normals_buffer,
i: index_buffer,
Expand Down Expand Up @@ -622,7 +615,7 @@ fn main() {
100.0,
);

let mut view = Matrix4::look_at_rh(
let view = Matrix4::look_at_rh(
Point3::new(
view_point.position[0],
view_point.position[1],
Expand Down
9 changes: 4 additions & 5 deletions src/moving_around.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
use crate::f32_3::{
dd_f32_3, dot_product, dstnc_f32_3, find_orthogonal_f32_3, find_points_normal, mltply_f32_3,
sbtr_f32_3,
};

use crate::positions::Position;
Expand All @@ -12,7 +11,7 @@ use crate::positions::Position;
pub fn move_forwards(
view_point: &mut Position,
center: &mut Position,
up_direction: &mut Position,
_up_direction: &mut Position,
rate: f32,
) {
let direction = mltply_f32_3(
Expand Down Expand Up @@ -54,7 +53,7 @@ pub fn move_elevation(
pub fn move_in_x(
view_point: &mut Position,
center: &mut Position,
up_direction: &mut Position,
_up_direction: &mut Position,
rate: f32,
) {
view_point.position[0] = view_point.position[0] + rate;
Expand All @@ -64,7 +63,7 @@ pub fn move_in_x(
pub fn move_in_y(
view_point: &mut Position,
center: &mut Position,
up_direction: &mut Position,
_up_direction: &mut Position,
rate: f32,
) {
view_point.position[1] = view_point.position[1] + rate;
Expand All @@ -74,7 +73,7 @@ pub fn move_in_y(
pub fn move_in_z(
view_point: &mut Position,
center: &mut Position,
up_direction: &mut Position,
_up_direction: &mut Position,
rate: f32,
) {
view_point.position[2] = view_point.position[2] + rate;
Expand Down
4 changes: 2 additions & 2 deletions src/positions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use crate::f32_3::{
angle_360_of, dd_f32_3, gen_f32_3_unit_on_point_normal_plane, mltply_f32_3, sbtr_f32_3,
};
use rand::rngs::ThreadRng;
use rand::Rng;

use vulkano::{buffer::BufferContents, pipeline::graphics::vertex_input::Vertex};
#[derive(BufferContents, Vertex, Debug, Clone, Copy)]
#[repr(C)]
Expand All @@ -28,7 +28,7 @@ pub fn create_points_on_cross_section(
rng: &mut ThreadRng,
) -> Vec<Position> {
let mut positions = vec![];
for i in 1..=points_number {
for _i in 1..=points_number {
let point = gen_f32_3_unit_on_point_normal_plane(planes_normal, plane_point, 1.0, rng);

let angle = angle_360_of(plane_point, point, reference_orthogonal, planes_normal);
Expand Down
5 changes: 1 addition & 4 deletions src/shapes.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
use crate::f32_3::{dd_f32_3, mltply_f32_3, sbtr_f32_3};
use rand::rngs::ThreadRng;
use rand::Rng;
use std::f32::consts::PI;

pub fn f32_3_dots_collinear(
point_1: [f32; 3],
Expand All @@ -13,7 +10,7 @@ pub fn f32_3_dots_collinear(

for i in 0..points_number {
planes_points.push(dd_f32_3(
mltply_f32_3(points_diff, ((i as f32) / (points_number as f32))),
mltply_f32_3(points_diff, (i as f32) / (points_number as f32)),
point_1,
));
}
Expand Down

0 comments on commit 79ba19c

Please sign in to comment.