Struct let_engine::objects::NewObject
source · pub struct NewObject {
pub transform: Transform,
pub appearance: Appearance,
/* private fields */
}
Expand description
Object to be initialized to the layer.
Fields§
§transform: Transform
§appearance: Appearance
Implementations§
source§impl NewObject
impl NewObject
New
source§impl NewObject
impl NewObject
Setters
sourcepub fn set_isometry(&mut self, position: Vec2, rotation: f32)
pub fn set_isometry(&mut self, position: Vec2, rotation: f32)
Sets the position and rotation of an object.
sourcepub fn appearance(&self) -> &Appearance
pub fn appearance(&self) -> &Appearance
Returns a reference to the appearance of the object.
source§impl NewObject
impl NewObject
Physics
sourcepub fn collider(&self) -> Option<&Collider>
pub fn collider(&self) -> Option<&Collider>
Returns the collider of the object in case it has one.
sourcepub fn set_collider(&mut self, collider: Option<Collider>)
pub fn set_collider(&mut self, collider: Option<Collider>)
Sets the collider of the object.
sourcepub fn collider_mut(&mut self) -> Option<&mut Collider>
pub fn collider_mut(&mut self) -> Option<&mut Collider>
Returns a mutable reference to the collider.
sourcepub fn rigid_body(&self) -> Option<&RigidBody>
pub fn rigid_body(&self) -> Option<&RigidBody>
Returns the rigid bodyh of the object in case it has one.
sourcepub fn set_rigid_body(&mut self, rigid_body: Option<RigidBody>)
pub fn set_rigid_body(&mut self, rigid_body: Option<RigidBody>)
Sets the rigid body of the object.
sourcepub fn rigid_body_mut(&mut self) -> Option<&mut RigidBody>
pub fn rigid_body_mut(&mut self) -> Option<&mut RigidBody>
Returns a mutable reference to the rigid body.
sourcepub fn local_collider_position(&self) -> Vec2
pub fn local_collider_position(&self) -> Vec2
Returns the local position of the collider.
sourcepub fn set_local_collider_position(&mut self, pos: Vec2)
pub fn set_local_collider_position(&mut self, pos: Vec2)
Sets the local position of the collider of this object in case it has one.
Trait Implementations§
source§impl PartialEq for NewObject
impl PartialEq for NewObject
impl Eq for NewObject
impl StructuralPartialEq for NewObject
Auto Trait Implementations§
impl !RefUnwindSafe for NewObject
impl Send for NewObject
impl Sync for NewObject
impl Unpin for NewObject
impl !UnwindSafe for NewObject
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> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
§impl<F, T> IntoSample<T> for Fwhere
T: FromSample<F>,
impl<F, T> IntoSample<T> for Fwhere
T: FromSample<F>,
fn into_sample(self) -> T
§impl<T> Pointable for T
impl<T> Pointable for T
source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
Read this value from the supplied reader. Same as
ReadEndian::read_from_little_endian()
.§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self
from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self
is actually part of its subset T
(and can be converted to it).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset
but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self
to the equivalent element of its superset.