Compare commits

..

No commits in common. "4e536d420d8b437dda1720ddd9901d1dc3b60abc" and "d74879d339335fa2d75d06291dad9783497bdd7b" have entirely different histories.

5 changed files with 16 additions and 58 deletions

View File

@ -2,6 +2,6 @@
Lithium is a small Real-Time 3D renderer written in rust.
It is not meant for real world usage, but for learning about 3D rendering.
## License
# License
Lithium is licensed under the MIT open source license.
Check the `LICENSE` file for more info.

View File

@ -2,17 +2,10 @@
# It is not intended for manual editing.
version = 3
[[package]]
name = "anyhow"
version = "1.0.75"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a4668cab20f66d8d020e1fbc0ebe47217433c1b6c8f2040faf858554e394ace6"
[[package]]
name = "lithium-loader"
version = "0.1.0"
dependencies = [
"anyhow",
"lithium-utils",
]

View File

@ -9,5 +9,3 @@ authors = ["antifallobst"]
[dependencies]
lithium-utils = { path = "../lithium-utils" }
anyhow = "1.0.75"

View File

@ -1,4 +1,3 @@
use anyhow::Result;
use lithium_utils::{Vector2, Vector3};
pub struct Vertex {
@ -54,12 +53,4 @@ impl Model {
faces,
}
}
pub fn faces(&self) -> &Vec<(u32, u32, u32)> {
&self.faces
}
pub fn vertex(&self, id: u32) -> Option<&Vertex> {
self.vertices.get(id as usize)
}
}

View File

@ -1,26 +1,6 @@
use std::ops::{Add, Sub};
pub struct Vector2 {
pub x: f32,
pub y: f32,
}
impl Default for Vector2 {
fn default() -> Self {
Self { x: 0_f32, y: 0_f32 }
}
}
impl Vector2 {
pub fn new(x: f32, y: f32) -> Self {
Self { x, y }
}
}
pub struct Vector3 {
pub x: f32,
pub y: f32,
pub z: f32,
x: f32,
y: f32,
}
impl Default for Vector3 {
@ -33,25 +13,21 @@ impl Default for Vector3 {
}
}
impl Add for Vector3 {
type Output = Self;
fn add(self, rhs: Self) -> Self::Output {
Self::Output {
x: self.x + rhs.x,
y: self.y + rhs.y,
z: self.z + rhs.z,
}
impl Vector2 {
pub fn new(x: f32, y: f32) -> Self {
Self { x, y }
}
}
impl Sub for Vector3 {
type Output = Vector3;
fn sub(self, rhs: Self) -> Self::Output {
Self::Output {
x: self.x - rhs.x,
y: self.y - rhs.y,
z: self.z - rhs.z,
}
pub struct Vector3 {
x: f32,
y: f32,
z: f32,
}
impl Default for Vector2 {
fn default() -> Self {
Self { x: 0_f32, y: 0_f32 }
}
}