Skip to main content

BillboardBehavior

Struct BillboardBehavior 

Source
pub struct BillboardBehavior { /* private fields */ }
Expand description

BBSC — Billboard behavior (v0, 48 bytes)

Turns one bone to face the camera. The only source of billboarding there is: BoneFlag::Billboard1/2 are set on no bone in the whole corpus.

StarCraft II applies these at draw time, per view, from sub_10290A890CBBSolver::Solve is a stub — and writes the bone’s local rotation, so the subtree follows.

Implementations§

Source§

impl BillboardBehavior

Source

pub fn new() -> Self

§Panics

Panics if the native allocation fails.

Source

pub fn dependents(&self) -> &[u16]

Dependent bone indices (U16_). Empty in every shipped record; the engine never reads them Zero-copy view of the underlying std::vector.

Source

pub fn dependents_mut(&mut self) -> &mut [u16]

Zero-copy mutable view. Resize first — the borrow forbids it after.

Source

pub fn set_dependents(&mut self, values: &[u16])

Source

pub fn resize_dependents(&mut self, count: usize)

Source

pub fn bone_index(&self) -> u16

Index into BONE array

Source

pub fn set_bone_index(&mut self, value: u16)

Source

pub fn billboard_type(&self) -> u8

Which axes may turn — see BillboardType

Source

pub fn set_billboard_type(&mut self, value: u8)

Source

pub fn camera_look_at(&self) -> u8

Non-zero: aim from this bone at the eye. Zero: aim along the camera’s view direction instead, so every such bone shares one orientation

Source

pub fn set_camera_look_at(&mut self, value: u8)

Source

pub fn up(&self) -> Quaternion

MISNAMED: not a direction. A rotation applied before the billboard basis, and only by the axis-locked types 0/1/2

Source

pub fn set_up(&mut self, value: Quaternion)

Source

pub fn forward(&self) -> Quaternion

MISNAMED likewise: the same kind of pre-rotation, taken only by type 6, and only on a bone whose parent is another bone. Types 3/4/5 take neither

Source

pub fn set_forward(&mut self, value: Quaternion)

Trait Implementations§

Source§

impl Debug for BillboardBehavior

Source§

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

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

impl Default for BillboardBehavior

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Drop for BillboardBehavior

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

fn pin_drop(self: Pin<&mut Self>)

🔬This is a nightly-only experimental API. (pin_ergonomics)
Execute the destructor for this type, but different to Drop::drop, it requires self to be pinned. Read more
Source§

impl Send for BillboardBehavior

Auto Trait Implementations§

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> 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, 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.