Struct oxygengine_ha_renderer::components::transform::HaTransform
source · pub struct HaTransform { /* private fields */ }Implementations§
source§impl HaTransform
impl HaTransform
pub fn new(translation: Vec3, rotation: impl Into<Rotator>, scale: Vec3) -> Self
pub fn translation(v: Vec3) -> Self
pub fn rotation(v: impl Into<Rotator>) -> Self
pub fn scale(v: Vec3) -> Self
pub fn get_translation(&self) -> Vec3
pub fn get_rotation(&self) -> Rotator
pub fn get_scale(&self) -> Vec3
pub fn set_translation(&mut self, v: Vec3)
pub fn set_rotation(&mut self, v: impl Into<Rotator>)
pub fn set_scale(&mut self, v: Vec3)
pub fn with_translation(self, v: Vec3) -> Self
pub fn with_rotation(self, v: impl Into<Rotator>) -> Self
pub fn with_scale(self, v: Vec3) -> Self
pub fn change_translation<F>(&mut self, f: F)where F: FnMut(&mut Vec3),
pub fn change_rotation<F>(&mut self, f: F)where F: FnMut(&mut Rotator),
pub fn change_scale<F>(&mut self, f: F)where F: FnMut(&mut Vec3),
pub fn transform_local_point(&self, v: Vec3) -> Vec3
pub fn transform_world_point(&self, v: Vec3) -> Vec3
pub fn transform_local_direction(&self, v: Vec3) -> Vec3
pub fn transform_world_direction(&self, v: Vec3) -> Vec3
pub fn inverse_transform_local_point(&self, v: Vec3) -> Vec3
pub fn inverse_transform_world_point(&self, v: Vec3) -> Vec3
pub fn inverse_transform_local_direction(&self, v: Vec3) -> Vec3
pub fn inverse_transform_world_direction(&self, v: Vec3) -> Vec3
pub fn get_world_origin(&self) -> Vec3
pub fn get_world_forward(&self) -> Vec3
pub fn get_world_right(&self) -> Vec3
pub fn get_world_up(&self) -> Vec3
pub fn get_world_rotation_lossy(&self) -> Rotator
pub fn get_world_scale_lossy(&self) -> Vec3
pub fn interpolate(from: &Self, to: &Self, factor: Scalar) -> Self
pub fn interpolate_many( iter: impl Iterator<Item = (Self, Scalar)> ) -> Option<Self>
sourcepub fn from_matrix(matrix: Mat4) -> Self
pub fn from_matrix(matrix: Mat4) -> Self
This conversion assumes non-negative scale components - when either of scale components was negative, rotation will be affected.
pub fn apply( &mut self, translation: Vec3, rotation: impl Into<Rotator>, scale: Vec3 )
pub fn local_matrix(&self) -> Mat4
pub fn inverse_local_matrix(&self) -> Mat4
pub fn world_matrix(&self) -> Mat4
pub fn inverse_world_matrix(&self) -> Mat4
pub fn relative_to_world(&self, other: &Self) -> Self
pub fn relative_to_local(&self, other: &Self) -> Self
pub fn rebuild_world_matrix(&mut self, parent: Option<&HaTransform>)
Trait Implementations§
source§impl Clone for HaTransform
impl Clone for HaTransform
source§fn clone(&self) -> HaTransform
fn clone(&self) -> HaTransform
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moresource§impl Debug for HaTransform
impl Debug for HaTransform
source§impl Default for HaTransform
impl Default for HaTransform
source§impl<'de> Deserialize<'de> for HaTransform
impl<'de> Deserialize<'de> for HaTransform
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl From<HaTransform> for HaTransformDef
impl From<HaTransform> for HaTransformDef
source§fn from(v: HaTransform) -> Self
fn from(v: HaTransform) -> Self
Converts to this type from the input type.
source§impl From<HaTransformDef> for HaTransform
impl From<HaTransformDef> for HaTransform
source§fn from(v: HaTransformDef) -> Self
fn from(v: HaTransformDef) -> Self
Converts to this type from the input type.
source§impl PartialEq<HaTransform> for HaTransform
impl PartialEq<HaTransform> for HaTransform
source§fn eq(&self, other: &HaTransform) -> bool
fn eq(&self, other: &HaTransform) -> bool
This method tests for
self and other values to be equal, and is used
by ==.source§impl Prefab for HaTransform
impl Prefab for HaTransform
fn from_prefab(data: &Value) -> Result<Self, PrefabError>
fn from_prefab_with_extras( data: &Value, _named_entities: &HashMap<String, Entity, RandomState>, _state_token: ID<PhantomData<dyn State + Send + Sync>> ) -> Result<Self, PrefabError>
fn to_prefab(&self) -> Result<Value, PrefabError>
fn from_prefab_str(data: &str) -> Result<Self, PrefabError>
fn to_prefab_string(&self) -> Result<String, PrefabError>
fn post_from_prefab(&mut self)
source§impl Serialize for HaTransform
impl Serialize for HaTransform
impl PrefabComponent for HaTransform
impl StructuralPartialEq for HaTransform
Auto Trait Implementations§
impl RefUnwindSafe for HaTransform
impl Send for HaTransform
impl Sync for HaTransform
impl Unpin for HaTransform
impl UnwindSafe for HaTransform
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
§impl<T> Initialize for Twhere
T: Default,
impl<T> Initialize for Twhere T: Default,
fn initialize(&mut self)
§unsafe fn initialize_raw(data: *mut ())
unsafe fn initialize_raw(data: *mut ())
Safety Read more