pub struct Transform {
pub position: Vec3,
pub orientation: Quat,
pub scale: Vec3,
}Expand description
A world-space placement: position, orientation, and (optionally) scale. 一个世界空间中的放置:位置、朝向和(可选的)缩放。
Scale defaults to one and is intentionally distinct from position so a renderer or physics step can ignore it without ambiguity. 缩放默认为 1,并刻意与位置区分开,以便渲染器或物理步进能够毫无歧义地忽略它。
Fields§
§position: Vec3Translation in world space. 世界空间中的平移。
orientation: QuatRotation in world space. 世界空间中的旋转。
scale: Vec3Uniform or per-axis scale. 均匀或按轴缩放。
Implementations§
Source§impl Transform
impl Transform
Sourcepub const fn from_position(position: Vec3) -> Self
pub const fn from_position(position: Vec3) -> Self
Place an object at position with identity rotation and unit scale.
在 position 处放置对象,旋转为单位旋转、缩放为单位缩放。
Sourcepub const fn from_position_orientation(
position: Vec3,
orientation: Quat,
) -> Self
pub const fn from_position_orientation( position: Vec3, orientation: Quat, ) -> Self
Place an object at position with the given orientation and unit scale.
在 position 处以给定的 orientation 放置对象,缩放为单位缩放。
Trait Implementations§
impl Copy for Transform
impl StructuralPartialEq for Transform
Auto Trait Implementations§
impl Freeze for Transform
impl RefUnwindSafe for Transform
impl Send for Transform
impl Sync for Transform
impl Unpin for Transform
impl UnsafeUnpin for Transform
impl UnwindSafe for Transform
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