Struct ark_api::world::MeshStyle

source ·
pub struct MeshStyle { /* private fields */ }
Expand description

MeshStyle component.

Usually accessed through Entity::mesh_style().

Implementations§

source§

impl MeshStyle

source

pub fn create(name: &str) -> Self

Creates a MeshStyle entity.

  • name - Just a name, to keep track of the entity during development.
source

pub fn set_mesh_style(&self, mesh_style: &MeshStyleData)

Sets the mesh style parameters to match this mesh style.

source

pub fn flags(&self) -> ValueAccessorReadWrite<MeshStyleFlags>

Returns a ValueAccessor for the world::MeshStyleFlags of the entity.

Used to set/get the flags.

source

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.

source

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.

source

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.

source

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.

source

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.

source

pub fn outline_color(&self) -> ValueAccessorReadWriteAnimate<Vec4>

Sets the color of the outline displayed if flags contains OUTLINE.

source

pub fn visibility_flags(&self) -> ValueAccessorReadWrite<MeshVisibilityFlags>

Returns a ValueAccessor for the world::MeshVisibilityFlags of the entity.

Used to set/get the flags.

source

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.

source

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.

source

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.

source

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§

source§

impl ComponentTrait for MeshStyle

source§

fn get_type() -> ComponentType

The type of the component, as a ComponentType enum.
source§

fn from_entity(handle: Entity) -> Self

Adopt an Entity, wrap in a component struct.
source§

fn entity(&self) -> Entity

Get the entity that the component belongs to.
source§

impl Debug for MeshStyle

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

const: unstable · source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
const: unstable · source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.