Skip to main content

Model

Struct Model 

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

Complete MDX model file structure

This structure represents an entire MDX model, including all geometry, materials, animations, and metadata. It can represent models from Warcraft III Classic (version 800) through Reforged (version 1200).

The structure is organized into chunks, each containing a specific type of data. Not all chunks are required - optional chunks can have empty vectors.

Implementations§

Source§

impl Model

Source

pub fn new() -> Self

§Panics

Panics if the native allocation fails.

Source

pub fn version(&self) -> u32

MDX version: 800 (Classic), 900, 1000, 1100, 1200 (Reforged)

Source

pub fn set_version(&mut self, value: u32)

Source

pub fn model_name(&self) -> String

Name of the model

Source

pub fn set_model_name(&mut self, value: &str)

Source

pub fn animation_file_name(&self) -> String

Path to external animation file (rarely used)

Source

pub fn set_animation_file_name(&mut self, value: &str)

Source

pub fn model_extent(&self) -> Ref<'_, Extent>

Bounding volume for the entire model Borrows the field in place — no copy, no allocation.

Source

pub fn model_extent_mut(&mut self) -> RefMut<'_, Extent>

Source

pub fn blend_time(&self) -> u32

Time in milliseconds to blend between animations

Source

pub fn set_blend_time(&mut self, value: u32)

Source

pub fn global_sequences(&self) -> &[u32]

Global looping animation durations Zero-copy view of the underlying std::vector.

Source

pub fn global_sequences_mut(&mut self) -> &mut [u32]

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

Source

pub fn set_global_sequences(&mut self, values: &[u32])

Source

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

Source

pub fn sequences_len(&self) -> usize

Named animation sequences

Source

pub fn sequences(&self, index: usize) -> Option<Ref<'_, Sequence>>

Borrows element index in place. None when out of range.

Source

pub fn sequences_mut(&mut self, index: usize) -> Option<RefMut<'_, Sequence>>

Source

pub fn sequences_iter(&self) -> impl ExactSizeIterator<Item = Ref<'_, Sequence>>

Iterate the elements, borrowing each in turn.

Source

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

Source

pub fn textures_len(&self) -> usize

Texture paths and settings

Source

pub fn textures(&self, index: usize) -> Option<Ref<'_, Texture>>

Borrows element index in place. None when out of range.

Source

pub fn textures_mut(&mut self, index: usize) -> Option<RefMut<'_, Texture>>

Source

pub fn textures_iter(&self) -> impl ExactSizeIterator<Item = Ref<'_, Texture>>

Iterate the elements, borrowing each in turn.

Source

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

Source

pub fn sounds_len(&self) -> usize

Sounds (deprecated)

Source

pub fn sounds(&self, index: usize) -> Option<Ref<'_, Sound>>

Borrows element index in place. None when out of range.

Source

pub fn sounds_mut(&mut self, index: usize) -> Option<RefMut<'_, Sound>>

Source

pub fn sounds_iter(&self) -> impl ExactSizeIterator<Item = Ref<'_, Sound>>

Iterate the elements, borrowing each in turn.

Source

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

Source

pub fn sound_emitters_len(&self) -> usize

Sound emitters (deprecated)

Source

pub fn sound_emitters(&self, index: usize) -> Option<Ref<'_, SoundEmitter>>

Borrows element index in place. None when out of range.

Source

pub fn sound_emitters_mut( &mut self, index: usize, ) -> Option<RefMut<'_, SoundEmitter>>

Source

pub fn sound_emitters_iter( &self, ) -> impl ExactSizeIterator<Item = Ref<'_, SoundEmitter>>

Iterate the elements, borrowing each in turn.

Source

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

Source

pub fn materials_len(&self) -> usize

Material definitions

Source

pub fn materials(&self, index: usize) -> Option<Ref<'_, Material>>

Borrows element index in place. None when out of range.

Source

pub fn materials_mut(&mut self, index: usize) -> Option<RefMut<'_, Material>>

Source

pub fn materials_iter(&self) -> impl ExactSizeIterator<Item = Ref<'_, Material>>

Iterate the elements, borrowing each in turn.

Source

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

Source

pub fn texture_animations_len(&self) -> usize

UV animation data

Source

pub fn texture_animations( &self, index: usize, ) -> Option<Ref<'_, TextureAnimation>>

Borrows element index in place. None when out of range.

Source

pub fn texture_animations_mut( &mut self, index: usize, ) -> Option<RefMut<'_, TextureAnimation>>

Source

pub fn texture_animations_iter( &self, ) -> impl ExactSizeIterator<Item = Ref<'_, TextureAnimation>>

Iterate the elements, borrowing each in turn.

Source

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

Source

pub fn geosets_len(&self) -> usize

Mesh geometry

Source

pub fn geosets(&self, index: usize) -> Option<Ref<'_, Geoset>>

Borrows element index in place. None when out of range.

Source

pub fn geosets_mut(&mut self, index: usize) -> Option<RefMut<'_, Geoset>>

Source

pub fn geosets_iter(&self) -> impl ExactSizeIterator<Item = Ref<'_, Geoset>>

Iterate the elements, borrowing each in turn.

Source

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

Source

pub fn geoset_animations_len(&self) -> usize

Mesh visibility/color animation

Source

pub fn geoset_animations( &self, index: usize, ) -> Option<Ref<'_, GeosetAnimation>>

Borrows element index in place. None when out of range.

Source

pub fn geoset_animations_mut( &mut self, index: usize, ) -> Option<RefMut<'_, GeosetAnimation>>

Source

pub fn geoset_animations_iter( &self, ) -> impl ExactSizeIterator<Item = Ref<'_, GeosetAnimation>>

Iterate the elements, borrowing each in turn.

Source

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

Source

pub fn bones_len(&self) -> usize

Skeleton bones

Source

pub fn bones(&self, index: usize) -> Option<Ref<'_, Bone>>

Borrows element index in place. None when out of range.

Source

pub fn bones_mut(&mut self, index: usize) -> Option<RefMut<'_, Bone>>

Source

pub fn bones_iter(&self) -> impl ExactSizeIterator<Item = Ref<'_, Bone>>

Iterate the elements, borrowing each in turn.

Source

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

Source

pub fn helpers_len(&self) -> usize

Helper/attachment nodes

Source

pub fn helpers(&self, index: usize) -> Option<Ref<'_, Helper>>

Borrows element index in place. None when out of range.

Source

pub fn helpers_mut(&mut self, index: usize) -> Option<RefMut<'_, Helper>>

Source

pub fn helpers_iter(&self) -> impl ExactSizeIterator<Item = Ref<'_, Helper>>

Iterate the elements, borrowing each in turn.

Source

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

Source

pub fn attachments_len(&self) -> usize

Equipment attachment points

Source

pub fn attachments(&self, index: usize) -> Option<Ref<'_, Attachment>>

Borrows element index in place. None when out of range.

Source

pub fn attachments_mut( &mut self, index: usize, ) -> Option<RefMut<'_, Attachment>>

Source

pub fn attachments_iter( &self, ) -> impl ExactSizeIterator<Item = Ref<'_, Attachment>>

Iterate the elements, borrowing each in turn.

Source

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

Source

pub fn pivot_points(&self) -> &[Vector3f]

Pivot points for nodes Zero-copy view of the underlying std::vector.

Source

pub fn pivot_points_mut(&mut self) -> &mut [Vector3f]

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

Source

pub fn set_pivot_points(&mut self, values: &[Vector3f])

Source

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

Source

pub fn lights_len(&self) -> usize

Light sources

Source

pub fn lights(&self, index: usize) -> Option<Ref<'_, Light>>

Borrows element index in place. None when out of range.

Source

pub fn lights_mut(&mut self, index: usize) -> Option<RefMut<'_, Light>>

Source

pub fn lights_iter(&self) -> impl ExactSizeIterator<Item = Ref<'_, Light>>

Iterate the elements, borrowing each in turn.

Source

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

Source

pub fn particle_emitters_len(&self) -> usize

Particle emitters v1

Source

pub fn particle_emitters( &self, index: usize, ) -> Option<Ref<'_, ParticleEmitter>>

Borrows element index in place. None when out of range.

Source

pub fn particle_emitters_mut( &mut self, index: usize, ) -> Option<RefMut<'_, ParticleEmitter>>

Source

pub fn particle_emitters_iter( &self, ) -> impl ExactSizeIterator<Item = Ref<'_, ParticleEmitter>>

Iterate the elements, borrowing each in turn.

Source

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

Source

pub fn particle_emitters_2_len(&self) -> usize

Particle emitters v2

Source

pub fn particle_emitters_2( &self, index: usize, ) -> Option<Ref<'_, ParticleEmitter2>>

Borrows element index in place. None when out of range.

Source

pub fn particle_emitters_2_mut( &mut self, index: usize, ) -> Option<RefMut<'_, ParticleEmitter2>>

Source

pub fn particle_emitters_2_iter( &self, ) -> impl ExactSizeIterator<Item = Ref<'_, ParticleEmitter2>>

Iterate the elements, borrowing each in turn.

Source

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

Source

pub fn ribbon_emitters_len(&self) -> usize

Ribbon trail effects

Source

pub fn ribbon_emitters(&self, index: usize) -> Option<Ref<'_, RibbonEmitter>>

Borrows element index in place. None when out of range.

Source

pub fn ribbon_emitters_mut( &mut self, index: usize, ) -> Option<RefMut<'_, RibbonEmitter>>

Source

pub fn ribbon_emitters_iter( &self, ) -> impl ExactSizeIterator<Item = Ref<'_, RibbonEmitter>>

Iterate the elements, borrowing each in turn.

Source

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

Source

pub fn corn_emitters_len(&self) -> usize

PopcornFX emitters (Reforged)

Source

pub fn corn_emitters(&self, index: usize) -> Option<Ref<'_, CornEmitter>>

Borrows element index in place. None when out of range.

Source

pub fn corn_emitters_mut( &mut self, index: usize, ) -> Option<RefMut<'_, CornEmitter>>

Source

pub fn corn_emitters_iter( &self, ) -> impl ExactSizeIterator<Item = Ref<'_, CornEmitter>>

Iterate the elements, borrowing each in turn.

Source

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

Source

pub fn event_objects_len(&self) -> usize

Animation event triggers

Source

pub fn event_objects(&self, index: usize) -> Option<Ref<'_, EventObject>>

Borrows element index in place. None when out of range.

Source

pub fn event_objects_mut( &mut self, index: usize, ) -> Option<RefMut<'_, EventObject>>

Source

pub fn event_objects_iter( &self, ) -> impl ExactSizeIterator<Item = Ref<'_, EventObject>>

Iterate the elements, borrowing each in turn.

Source

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

Source

pub fn cameras_len(&self) -> usize

Camera definitions

Source

pub fn cameras(&self, index: usize) -> Option<Ref<'_, Camera>>

Borrows element index in place. None when out of range.

Source

pub fn cameras_mut(&mut self, index: usize) -> Option<RefMut<'_, Camera>>

Source

pub fn cameras_iter(&self) -> impl ExactSizeIterator<Item = Ref<'_, Camera>>

Iterate the elements, borrowing each in turn.

Source

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

Source

pub fn collision_shapes_len(&self) -> usize

Collision geometry

Source

pub fn collision_shapes(&self, index: usize) -> Option<Ref<'_, CollisionShape>>

Borrows element index in place. None when out of range.

Source

pub fn collision_shapes_mut( &mut self, index: usize, ) -> Option<RefMut<'_, CollisionShape>>

Source

pub fn collision_shapes_iter( &self, ) -> impl ExactSizeIterator<Item = Ref<'_, CollisionShape>>

Iterate the elements, borrowing each in turn.

Source

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

Source

pub fn face_effects_len(&self) -> usize

Facial effects (Reforged)

Source

pub fn face_effects(&self, index: usize) -> Option<Ref<'_, FaceEffect>>

Borrows element index in place. None when out of range.

Source

pub fn face_effects_mut( &mut self, index: usize, ) -> Option<RefMut<'_, FaceEffect>>

Source

pub fn face_effects_iter( &self, ) -> impl ExactSizeIterator<Item = Ref<'_, FaceEffect>>

Iterate the elements, borrowing each in turn.

Source

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

Trait Implementations§

Source§

impl Debug for Model

Source§

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

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

impl Default for Model

Source§

fn default() -> Self

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

impl Drop for Model

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 Model

Auto Trait Implementations§

§

impl !Sync for Model

§

impl Freeze for Model

§

impl RefUnwindSafe for Model

§

impl Unpin for Model

§

impl UnsafeUnpin for Model

§

impl UnwindSafe for Model

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 = Infallible

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

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

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.