[−][src]Trait rust_3d::IsEditable2D
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_xy(&mut self, x: f64, y: f64)
Sets the position from x and y values
fn increase_distance_to_by<P>(&mut self, other: &P, factor: Positive) where
P: Is2D,
P: Is2D,
Increases distance towards other by factor
fn add<P>(&mut self, other: &P) where
P: Is2D,
P: Is2D,
Adds the coordinates of other onto this. x = x + other.x ...
fn subtract<P>(&mut self, other: &P) where
P: Is2D,
P: Is2D,
Subtracts the coordinates of other from this. x = x - other.x ...
fn scale_pos(&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