and the problem was a query that I mis-typed. damn

This commit is contained in:
2021-02-04 19:18:14 -08:00
parent 3d87d11485
commit 9dffd6797c
2 changed files with 6 additions and 5 deletions

View File

@@ -1,6 +1,7 @@
use bytemuck::__core::ops::Range;
use bytemuck::{Zeroable, Pod};
use crate::{OPENGL_TO_WGPU_MATRIX, DirectionalLight, Position};
use cgmath::Point3;
#[repr(C)]
@@ -16,10 +17,10 @@ unsafe impl Pod for LightRaw {}
unsafe impl Zeroable for LightRaw {}
impl DirectionalLight {
pub fn to_raw(&self, pos: Position) -> LightRaw {
pub fn to_raw(&self, pos: Point3<f32>) -> LightRaw {
use cgmath::{Deg, EuclideanSpace, Matrix4, PerspectiveFov, Point3, Vector3};
let pos = cgmath::Point3::new(pos.x, pos.y, pos.z);
//let pos = cgmath::Point3::new(pos.x, pos.y, pos.z);
let mx_view = Matrix4::look_at(pos, Point3::origin(), Vector3::unit_z());
let projection = PerspectiveFov {
fovy: Deg(self.fov).into(),