29 lines
578 B
Rust
29 lines
578 B
Rust
use cgmath::{Deg, Point3};
|
|
|
|
use super::SpriteTexture;
|
|
use crate::physics::Pfloat;
|
|
|
|
pub struct Sprite {
|
|
/// Name of the sprite to draw
|
|
pub texture: SpriteTexture,
|
|
|
|
/// This object's position, in world coordinates.
|
|
pub pos: Point3<Pfloat>,
|
|
|
|
/// The size of this sprite,
|
|
/// given as height in world units.
|
|
pub size: Pfloat,
|
|
|
|
/// Scale factor.
|
|
/// if this is 1, sprite height is exactly self.size.
|
|
pub scale: Pfloat,
|
|
|
|
/// This sprite's rotation
|
|
/// (relative to north, measured ccw)
|
|
pub angle: Deg<Pfloat>,
|
|
}
|
|
|
|
pub trait Spriteable {
|
|
fn get_sprite(&self) -> Sprite;
|
|
}
|