pub struct MeshStyle { /* private fields */ }
Expand description
MeshStyle
component.
Usually accessed through Entity::mesh_style
().
Implementations
sourceimpl MeshStyle
impl MeshStyle
sourcepub fn create(name: &str) -> Self
pub fn create(name: &str) -> Self
Creates a MeshStyle
entity.
name
- Just a name, to keep track of the entity during development.
sourcepub fn set_mesh_style(&self, mesh_style: &MeshStyleData)
pub fn set_mesh_style(&self, mesh_style: &MeshStyleData)
Sets the mesh style parameters to match this mesh style.
sourcepub fn flags(&self) -> ValueAccessorReadWrite<MeshStyleFlags>
pub fn flags(&self) -> ValueAccessorReadWrite<MeshStyleFlags>
Returns a ValueAccessor
for the world::MeshStyleFlags
of the entity.
Used to set/get the flags.
sourcepub fn diffuse_tint(&self) -> ValueAccessorReadWriteAnimate<Vec4>
pub fn diffuse_tint(&self) -> ValueAccessorReadWriteAnimate<Vec4>
Returns a ValueAccessor
for the diffuse tint of the entity.
Used to set/get/animate the diffuse tint.
sourcepub fn morph_target_weights(
&self
) -> ValueAccessorDataReadWrite<MorphTargetData>
pub fn morph_target_weights(
&self
) -> ValueAccessorDataReadWrite<MorphTargetData>
Returns a ValueAccessor
for the morph target weights of the entity.
Used to set/get/animate weights. There’s a limit to the number of morph targets weights that can be non-zero at once and still affect the mesh. Currently that limit is 4, but it will soon be changed higher.
sourcepub fn materials(&self) -> ValueAccessorDataReadWrite<WorldMaterials>
pub fn materials(&self) -> ValueAccessorDataReadWrite<WorldMaterials>
Returns a ValueAccessor
for the material overrides of the entity.
Used to set/get per-instance materials that override the materials of a mesh.
sourcepub fn billboard_offset(&self) -> ValueAccessorReadWriteAnimate<Vec3>
pub fn billboard_offset(&self) -> ValueAccessorReadWriteAnimate<Vec3>
Sets a view-space offset vector for billboarded meshes (if flags contains BILLBOARD).
Lets you compose multiple billboards together at the same worldspace location in “2D”. Useful for things like speech bubbles.
sourcepub fn outline_thickness(&self) -> ValueAccessorReadWriteAnimate<f32>
pub fn outline_thickness(&self) -> ValueAccessorReadWriteAnimate<f32>
Sets the thickness of the outline displayed if flags contains OUTLINE.
The thickness is specified in in screen space in sort of virtual pixels, of which there are 1024 across the screen. This is so results don’t feel drastically different between an 1024x768 and a 4k screen. A 2px border is generally pretty appropriate as a thin border, and a 5px is a nice thick one.
sourcepub fn outline_color(&self) -> ValueAccessorReadWriteAnimate<Vec4>
pub fn outline_color(&self) -> ValueAccessorReadWriteAnimate<Vec4>
Sets the color of the outline displayed if flags contains OUTLINE.
sourcepub fn visibility_flags(&self) -> ValueAccessorReadWrite<MeshVisibilityFlags>
pub fn visibility_flags(&self) -> ValueAccessorReadWrite<MeshVisibilityFlags>
Returns a ValueAccessor
for the world::MeshVisibilityFlags
of the entity.
Used to set/get the flags.
sourcepub fn visibility_player_id_set_flags(
&self
) -> ValueAccessorReadWrite<MeshVisibilityFlags>
pub fn visibility_player_id_set_flags(
&self
) -> ValueAccessorReadWrite<MeshVisibilityFlags>
Sets the visibility flags used for the player id set which overwrites Self::visibility_flags
.
Used to set/get the visibility flag.
sourcepub fn visibility_player_id_set(
&self
) -> ValueAccessorDataReadWrite<PlayerIdSet>
pub fn visibility_player_id_set(
&self
) -> ValueAccessorDataReadWrite<PlayerIdSet>
Returns a ValueAccessor
for the set of player ids the visibility_player_id_set_flags
value should affect.
Used to set/get the player id set.
sourcepub fn mesh_style_player_id_set_flags(
&self
) -> ValueAccessorReadWrite<MeshStyleFlags>
pub fn mesh_style_player_id_set_flags(
&self
) -> ValueAccessorReadWrite<MeshStyleFlags>
Sets the mesh style flags used for the player id set which overwrites flags
.
Used to set/get the mesh style flag.
sourcepub fn mesh_style_player_id_set(
&self
) -> ValueAccessorDataReadWrite<PlayerIdSet>
pub fn mesh_style_player_id_set(
&self
) -> ValueAccessorDataReadWrite<PlayerIdSet>
The players which we will use Self::mesh_style_player_id_set_flags
for instead of [Self::flags
].
Default: the empty set (use [Self::flags
] for everyone).
Used to set/get the player id set.
Trait Implementations
sourceimpl ComponentTrait for MeshStyle
impl ComponentTrait for MeshStyle
sourcefn get_type() -> ComponentType
fn get_type() -> ComponentType
The type of the component, as a ComponentType
enum.
sourcefn from_entity(handle: Entity) -> Self
fn from_entity(handle: Entity) -> Self
Adopt an Entity
, wrap in a component struct.
Auto Trait Implementations
impl RefUnwindSafe for MeshStyle
impl Send for MeshStyle
impl Sync for MeshStyle
impl Unpin for MeshStyle
impl UnwindSafe for MeshStyle
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more