Skip to main content

ShapeInstance

Struct ShapeInstance 

Source
pub struct ShapeInstance {
Show 14 fields pub sides: i32, pub x: f64, pub y: f64, pub rad: f32, pub ang: f32, pub rgba: [f32; 4], pub rgba2: [f32; 4], pub border_rgba: [f32; 4], pub additive: bool, pub thick: bool, pub textured: bool, pub tex_zoom: f32, pub tex_ang: f32, pub image: Option<ShapeImage>,
}
Expand description

One evaluated custom-shape instance (CShape after per-frame code for that instance).

Fields§

§sides: i32

var_pf_sides (clamped to 3..=CompatRules::max_shape_sides by the renderer).

§x: f64

var_pf_x, projectM / MD2 compute the fan centre x * 2.0 - 1.0 in double and round to f32 once, so x / y stay in the equation VM’s f64 (0..1, y=1 top).

§y: f64

var_pf_y, see x.

§rad: f32

var_pf_rad.

§ang: f32

var_pf_ang.

§rgba: [f32; 4]

Inner colour var_pf_r/g/b/a.

§rgba2: [f32; 4]

Outer colour var_pf_r2/g2/b2/a2.

§border_rgba: [f32; 4]

Border colour var_pf_border_*.

§additive: bool

var_pf_additive.

§thick: bool

var_pf_thick (thick outline).

§textured: bool

var_pf_textured.

§tex_zoom: f32

var_pf_tex_zoom.

§tex_ang: f32

var_pf_tex_ang.

§image: Option<ShapeImage>

projectM’s shapecode_N_image: a textured shape samples this user texture (see Renderer::set_user_texture) instead of the main image. None (the default, and every MilkDrop 2 shape) keeps the main-image behaviour.

Trait Implementations§

Source§

impl Clone for ShapeInstance

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ShapeInstance

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Default for ShapeInstance

Source§

fn default() -> Self

state.cpp defaults (m_shape[i]).

Auto Trait Implementations§

§

impl Forget for ShapeInstance

§

impl Freeze for ShapeInstance
where *const u8 is !null: Freeze, PhantomData<u8>: Freeze,

§

impl Move for ShapeInstance

§

impl RefUnwindSafe for ShapeInstance

§

impl Send for ShapeInstance
where RawVecInner: Send,

§

impl Sync for ShapeInstance
where RawVecInner: Sync,

§

impl Unpin for ShapeInstance
where *const u8 is !null: Unpin,

§

impl UnsafeUnpin for ShapeInstance

§

impl UnwindSafe for ShapeInstance
where RawVecInner: UnwindSafe,

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

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

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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

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

Source§

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

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.
Source§

impl<S, T> Upcast<T> for S
where T: UpcastFrom<S> + ?Sized, S: ?Sized,

Source§

fn upcast(&self) -> &T
where Self: ErasableGeneric, T: Sized + ErasableGeneric<Repr = Self::Repr>,

Perform a zero-cost type-safe upcast to a wider ref type within the Wasm bindgen generics type system. Read more
Source§

fn upcast_into(self) -> T
where Self: Sized + ErasableGeneric, T: Sized + ErasableGeneric<Repr = Self::Repr>,

Perform a zero-cost type-safe upcast to a wider type within the Wasm bindgen generics type system. Read more
Source§

impl<T> WasmNotSend for T

Source§

impl<T> WasmNotSendSync for T

Source§

impl<T> WasmNotSync for T