Probably wrong bilinear patch intersection

This commit is contained in:
hal8174 2025-08-21 20:50:05 +02:00
parent 6d363aecd0
commit 76448ed442
Signed by: hal8174
SSH key fingerprint: SHA256:NN98ZYwnrreQLSOV/g+amY7C3yL/mS1heD7bi5t6PPw
2 changed files with 126 additions and 18 deletions

View file

@ -1,6 +1,6 @@
use crate::prelude::*;
use core::panic;
use std::ops::{Add, Index, Sub};
use std::ops::{Add, Index, Mul, Sub};
#[derive(Debug, Clone, Copy)]
pub struct Pos3 {
@ -32,6 +32,14 @@ impl Pos3 {
}
}
pub fn as_dir(self) -> Dir3 {
Dir3 {
x: self.x,
y: self.y,
z: self.z,
}
}
pub fn from_barycentric(vertices: [Self; 3], coordinates: [Float; 3]) -> Self {
Self {
x: vertices[0].x() * coordinates[0]