Trait rust_3d::traits::IsEditable2D
[−]
[src]
pub trait IsEditable2D: Is2D + IsEditableND { fn set_x(&mut self, val: f64); fn set_y(&mut self, val: f64); fn set_pos(&mut self, x: f64, y: f64) { ... } fn add<P>(&mut self, other: &P)
where
P: Is2D, { ... } fn substract<P>(&mut self, other: &P)
where
P: Is2D, { ... } fn scale(&mut self, val: f64) { ... } fn rotate<P>(&mut self, r: Rad, center: &P)
where
P: Is2D, { ... } }
IsEditable2D is a trait used for types which are positioned in 2D space and their position can be changed
Required Methods
fn set_x(&mut self, val: f64)
Should set the position in x
fn set_y(&mut self, val: f64)
Should set the position in y
Provided Methods
fn set_pos(&mut self, x: f64, y: f64)
Sets the position from a x and y values
fn add<P>(&mut self, other: &P) where
P: Is2D,
P: Is2D,
Adds the coordinates of other onto this. x = x + other.x ...
fn substract<P>(&mut self, other: &P) where
P: Is2D,
P: Is2D,
Substracts the coordinates of other from this. x = x - other.x ...
fn scale(&mut self, val: f64)
Scales the coordinates by applying a factor to all of them
fn rotate<P>(&mut self, r: Rad, center: &P) where
P: Is2D,
P: Is2D,
Rotates the position around a center ccw for rad radians
Implementors
impl IsEditable2D for FilterBox2D
impl IsEditable2D for FilterCircle
impl IsEditable2D for Point2D