use cgmath::{Deg, Point3}; use super::SpriteTexture; pub struct Sprite { /// The sprite texture to draw pub texture: SpriteTexture, /// This object's position, in world coordinates. pub pos: Point3, /// The size of this sprite, /// given as height in world units. pub size: f32, /// This sprite's rotation /// (relative to north, measured ccw) pub angle: Deg, /// Sprites that should be drawn relative to this sprite. pub children: Option>, } pub struct SubSprite { /// The sprite texture to draw pub texture: SpriteTexture, /// This object's position, in world coordinates. /// This is relative to this sprite's parent. pub pos: Point3, /// The size of this sprite, /// given as height in world units. pub size: f32, /// This sprite's rotation /// (relative to north, measured ccw) /// Just as position, this is relative to this /// subsprite's parent sprite. pub angle: Deg, } pub trait Spriteable { fn get_sprite(&self) -> Sprite; }