fix(pointer): proper direction

This commit is contained in:
Nova
2023-05-31 08:48:24 -04:00
parent 6861b92972
commit 5dc82be1a3
2 changed files with 9 additions and 4 deletions

View File

@@ -62,7 +62,12 @@ impl MousePointer {
let ray = ray_from_mouse(mouse.pos).unwrap();
self.spatial.set_local_transform(
Mat4::look_to_rh(ray.pos.into(), -Vec3::from(ray.dir), vec3(0.0, 1.0, 0.0)).inverse(),
Mat4::look_to_rh(
Vec3::from(ray.pos),
Vec3::from(ray.dir),
vec3(0.0, 1.0, 0.0),
)
.inverse(),
);
{
// Set pointer input datamap