pub struct DataDrivenProperty { /* private fields */ }Expand description
One decoded property of a data-driven material
data is the raw value; its shape depends on size: 4 = scalar (f32, u32 enum, or BGRA colour — depends on the property), 8 = {u32 index into DataDrivenMaterial::texturePaths, u32 texture source}, 12 = 3 floats, 16 = 4 floats, 20 = {u32 ColorChannelSelect, f32 multiply, f32 add, f32, u16 flags}, 32 = {f32 offsetU/V, tilingU/V, angleU/V/W, u32 flags}, 48 = fresnel {u32 FresnelMode, f32 exponent, min, max, rotation, mask}.
Implementations§
Source§impl DataDrivenProperty
impl DataDrivenProperty
pub fn set_name_hash(&mut self, value: u32)
pub fn set_name(&mut self, value: &str)
Sourcepub fn data_mut(&mut self) -> &mut [u8] ⓘ
pub fn data_mut(&mut self) -> &mut [u8] ⓘ
Zero-copy mutable view. Resize first — the borrow forbids it after.
pub fn set_data(&mut self, values: &[u8])
pub fn resize_data(&mut self, count: usize)
Trait Implementations§
Source§impl Debug for DataDrivenProperty
impl Debug for DataDrivenProperty
Source§impl Default for DataDrivenProperty
impl Default for DataDrivenProperty
Source§impl Drop for DataDrivenProperty
impl Drop for DataDrivenProperty
impl Send for DataDrivenProperty
Auto Trait Implementations§
impl !Sync for DataDrivenProperty
impl Freeze for DataDrivenProperty
impl RefUnwindSafe for DataDrivenProperty
impl Unpin for DataDrivenProperty
impl UnsafeUnpin for DataDrivenProperty
impl UnwindSafe for DataDrivenProperty
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