Struct gemini_engine::elements::Triangle
source · pub struct Triangle {
pub pos0: Vec2D,
pub pos1: Vec2D,
pub pos2: Vec2D,
pub fill_char: ColChar,
/* private fields */
}Expand description
Fields§
§pos0: Vec2D§pos1: Vec2D§pos2: Vec2D§fill_char: ColCharImplementations§
source§impl Triangle
impl Triangle
pub const fn new( pos0: Vec2D, pos1: Vec2D, pos2: Vec2D, fill_char: ColChar ) -> Self
sourcepub const fn with_array(points: &[Vec2D], fill_char: ColChar) -> Self
pub const fn with_array(points: &[Vec2D], fill_char: ColChar) -> Self
Takes the corners of the triangle as an array rather than as separate parameters
sourcepub fn generate_cache(&mut self)
pub fn generate_cache(&mut self)
Generate a BlitCache if you intend for the triangle to not move across multiple frames. If you use this, you MUST call generate_cache if the triangle does move in the future. This function will not generate a new cache if the previously generated cache is still valid
Trait Implementations§
source§impl ViewElement for Triangle
impl ViewElement for Triangle
source§fn active_pixels(&self) -> Vec<Point>
fn active_pixels(&self) -> Vec<Point>
Return a vector of every coordinate where a pixel should be placed and its respective
ColChar. If your whole object is a solid colour, consider using utils::points_to_pixels() which will add the same ColChar to every point and can then be used as this function’s outputAuto Trait Implementations§
impl RefUnwindSafe for Triangle
impl Send for Triangle
impl Sync for Triangle
impl Unpin for Triangle
impl UnwindSafe for Triangle
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more