[−][src]Enum ggez::graphics::Transform
A struct that represents where to put a Drawable
.
This can either be a set of individual components, or
a single Matrix4
transform.
Variants
Transform made of individual values
Fields of Values
dest: Point2<f32>
The position to draw the graphic expressed as a Point2
.
rotation: f32
The orientation of the graphic in radians.
scale: Vector2<f32>
The x/y scale factors expressed as a Vector2
.
offset: Point2<f32>
An offset from the center for transform operations like scale/rotation,
with 0,0
meaning the origin and 1,1
meaning the opposite corner from the origin.
By default these operations are done from the top-left corner, so to rotate something
from the center specify Point2::new(0.5, 0.5)
here.
Matrix(ColumnMatrix4<f32>)
Transform made of an arbitrary matrix.
It should represent the final model matrix of the given drawable. This is useful for situations where, for example, you build your own hierarchy system, where you calculate matrices of each hierarchy item and store a calculated world-space model matrix of an item. This lets you implement transform stacks, skeletal animations, etc.
Implementations
impl Transform
[src]
pub fn to_matrix(&self) -> Self
[src]
Crunches the transform down to a single matrix, if it's not one already.
pub fn to_bare_matrix(&self) -> ColumnMatrix4<f32>
[src]
Same as to_matrix()
but just returns a bare mint
matrix.
Trait Implementations
impl Clone for Transform
[src]
impl Copy for Transform
[src]
impl Debug for Transform
[src]
impl Default for Transform
[src]
impl PartialEq<Transform> for Transform
[src]
impl StructuralPartialEq for Transform
[src]
Auto Trait Implementations
impl RefUnwindSafe for Transform
[src]
impl Send for Transform
[src]
impl Sync for Transform
[src]
impl Unpin for Transform
[src]
impl UnwindSafe for Transform
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Pointable for T
pub const ALIGN: usize
type Init = T
The type for initializers.
pub unsafe fn init(init: <T as Pointable>::Init) -> usize
pub unsafe fn deref<'a>(ptr: usize) -> &'a T
pub unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T
pub unsafe fn drop(ptr: usize)
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,