Skip to content

Instantly share code, notes, and snippets.

@milespossing
Last active November 10, 2021 05:23
Show Gist options
  • Save milespossing/e849522623ee0d17d64beabb52fcc54f to your computer and use it in GitHub Desktop.
Save milespossing/e849522623ee0d17d64beabb52fcc54f to your computer and use it in GitHub Desktop.
Simple ray for ray tracer
use amethyst::{
core::math::{Vector3},
ecs::{Component, VecStorage},
};
#[derive(Debug)]
pub struct Ray {
pub pos: Vector3<f32>,
pub vel: Vector3<f32>,
}
impl Ray {
pub fn new(pos: Vector3<f32>, vel: Vector3<f32>) -> Ray{
Ray { pos, vel }
}
}
impl Component for Ray {
type Storage = VecStorage<Self>;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment