NSMBW-Decomp
A decompilation of New Super Mario Bros. Wii
Loading...
Searching...
No Matches
daEnSnakeBlock_c::dBlock_c Class Reference

#include <game/bases/d_a_en_snake_block.hpp>

Inheritance diagram for daEnSnakeBlock_c::dBlock_c:
[legend]

Description

A single block segment within the Snake Block actor.

Manages its own 3D model, animations, collision, and physics.

Definition at line 19 of file d_a_en_snake_block.hpp.

Public Member Functions

 dBlock_c ()
 Creates a block.
virtual ~dBlock_c ()
 Destroys the block.
void createMdl (mAllocator_c *allocator)
 Initializes the 3D model, textures, and color animations.
void initCollision (daEnSnakeBlock_c *parent, mVec3_c &blockPos, bool icy)
 Initializes the block's collision.
void setAnmClr (const char *name)
 Sets the color animation for the block.
void draw (const mVec3_c &offset)
 Renders the block model.
void calcCollapse1 (s8 *moveSequence)
 Updates the block's position when in the Collapse1 state.
void calcCollision ()
 Updates the block's collision based on its offset from the parent.
void calcFallSpeed ()
 Updates the block's falling speed.
void calcAnm ()
 Advances the animations for the block.
mVec3_c getPos () const
void setPos (mVec3_c pos)
void posMove ()
 Moves the block by its speed.
void deleteBlock ()
 Releases the model and associated animation resources.
void releaseBgCtr ()
 Releases the block's collision.

Public Attributes

nw4r::g3d::ResFile mResFile
 The resource file.
m3d::mdl_c mModel
 The block model.
m3d::anmMatClr_c mAnmClr
 The color animation.
nw4r::g3d::ResAnmTexSrt mResTexSrt
 The texture animation resource.
m3d::anmTexSrt_c mAnmTexSrt
 The texture animation.
mVec3_c mPos
 The block's position (center of block).
mVec3_c mSpeed
 The block' speed.
mVec3_c mLastPos
 The block's position in the previous movement.
dBg_ctr_c mBgCtr
 The collision.
int mMoveSequenceIdx
 The block's current step in the movement sequence.
daEnSnakeBlock_cmpOwner
 The parent Snake Block actor.
s16 m_1b4

Static Public Attributes

static dBg_ctr_c::CallbackF callBackF
 The floor collision callback.
static dBg_ctr_c::CallbackH callBackH
 The ceiling collision callback.
static dBg_ctr_c::CallbackW callBackW
 The side collision callback.

Constructor & Destructor Documentation

◆ dBlock_c()

daEnSnakeBlock_c::dBlock_c::dBlock_c ( )
inline

Creates a block.

Definition at line 22 of file d_a_en_snake_block.hpp.

◆ ~dBlock_c()

virtual daEnSnakeBlock_c::dBlock_c::~dBlock_c ( )
inlinevirtual

Destroys the block.

Definition at line 25 of file d_a_en_snake_block.hpp.

Member Function Documentation

◆ createMdl()

void daEnSnakeBlock_c::dBlock_c::createMdl ( mAllocator_c * allocator)

Initializes the 3D model, textures, and color animations.

Parameters
allocatorThe allocator to use for the model and animation data.

Definition at line 16 of file d_a_en_snake_block.cpp.

◆ initCollision()

void daEnSnakeBlock_c::dBlock_c::initCollision ( daEnSnakeBlock_c * parent,
mVec3_c & blockPos,
bool icy )

Initializes the block's collision.

Parameters
parentThe parent Snake Block actor.
blockPosThe block position.
icyWhether the surface must be icy.

Definition at line 68 of file d_a_en_snake_block.cpp.

◆ setAnmClr()

void daEnSnakeBlock_c::dBlock_c::setAnmClr ( const char * name)

Sets the color animation for the block.

Parameters
nameThe animation name.

Definition at line 49 of file d_a_en_snake_block.cpp.

◆ draw()

void daEnSnakeBlock_c::dBlock_c::draw ( const mVec3_c & offset)

Renders the block model.

Parameters
offsetThe offset from the block position, used for the shaking animation.

Definition at line 56 of file d_a_en_snake_block.cpp.

◆ calcCollapse1()

void daEnSnakeBlock_c::dBlock_c::calcCollapse1 ( s8 * moveSequence)

Updates the block's position when in the Collapse1 state.

Definition at line 106 of file d_a_en_snake_block.cpp.

◆ calcCollision()

void daEnSnakeBlock_c::dBlock_c::calcCollision ( )

Updates the block's collision based on its offset from the parent.

Definition at line 91 of file d_a_en_snake_block.cpp.

◆ calcFallSpeed()

void daEnSnakeBlock_c::dBlock_c::calcFallSpeed ( )

Updates the block's falling speed.

Definition at line 99 of file d_a_en_snake_block.cpp.

◆ calcAnm()

void daEnSnakeBlock_c::dBlock_c::calcAnm ( )

Advances the animations for the block.

Definition at line 44 of file d_a_en_snake_block.cpp.

◆ getPos()

mVec3_c daEnSnakeBlock_c::dBlock_c::getPos ( ) const
inline

Definition at line 51 of file d_a_en_snake_block.hpp.

◆ setPos()

void daEnSnakeBlock_c::dBlock_c::setPos ( mVec3_c pos)
inline

Definition at line 52 of file d_a_en_snake_block.hpp.

◆ posMove()

void daEnSnakeBlock_c::dBlock_c::posMove ( )
inline

Moves the block by its speed.

Definition at line 53 of file d_a_en_snake_block.hpp.

◆ deleteBlock()

void daEnSnakeBlock_c::dBlock_c::deleteBlock ( )

Releases the model and associated animation resources.

Definition at line 38 of file d_a_en_snake_block.cpp.

◆ releaseBgCtr()

void daEnSnakeBlock_c::dBlock_c::releaseBgCtr ( )
inline

Releases the block's collision.

Definition at line 58 of file d_a_en_snake_block.hpp.

Member Data Documentation

◆ callBackF

void daEnSnakeBlock_c::dBlock_c::callBackF
static

The floor collision callback.

Definition at line 64 of file d_a_en_snake_block.hpp.

◆ callBackH

void daEnSnakeBlock_c::dBlock_c::callBackH
static

The ceiling collision callback.

Definition at line 65 of file d_a_en_snake_block.hpp.

◆ callBackW

void daEnSnakeBlock_c::dBlock_c::callBackW
static

The side collision callback.

Definition at line 66 of file d_a_en_snake_block.hpp.

◆ mResFile

nw4r::g3d::ResFile daEnSnakeBlock_c::dBlock_c::mResFile

The resource file.

Definition at line 68 of file d_a_en_snake_block.hpp.

◆ mModel

m3d::mdl_c daEnSnakeBlock_c::dBlock_c::mModel

The block model.

Definition at line 69 of file d_a_en_snake_block.hpp.

◆ mAnmClr

m3d::anmMatClr_c daEnSnakeBlock_c::dBlock_c::mAnmClr

The color animation.

Definition at line 70 of file d_a_en_snake_block.hpp.

◆ mResTexSrt

nw4r::g3d::ResAnmTexSrt daEnSnakeBlock_c::dBlock_c::mResTexSrt

The texture animation resource.

Definition at line 71 of file d_a_en_snake_block.hpp.

◆ mAnmTexSrt

m3d::anmTexSrt_c daEnSnakeBlock_c::dBlock_c::mAnmTexSrt

The texture animation.

Definition at line 72 of file d_a_en_snake_block.hpp.

◆ mPos

mVec3_c daEnSnakeBlock_c::dBlock_c::mPos

The block's position (center of block).

Definition at line 74 of file d_a_en_snake_block.hpp.

◆ mSpeed

mVec3_c daEnSnakeBlock_c::dBlock_c::mSpeed

The block' speed.

Definition at line 75 of file d_a_en_snake_block.hpp.

◆ mLastPos

mVec3_c daEnSnakeBlock_c::dBlock_c::mLastPos

The block's position in the previous movement.

Definition at line 76 of file d_a_en_snake_block.hpp.

◆ mBgCtr

dBg_ctr_c daEnSnakeBlock_c::dBlock_c::mBgCtr

The collision.

Definition at line 78 of file d_a_en_snake_block.hpp.

◆ mMoveSequenceIdx

int daEnSnakeBlock_c::dBlock_c::mMoveSequenceIdx

The block's current step in the movement sequence.

Definition at line 79 of file d_a_en_snake_block.hpp.

◆ mpOwner

daEnSnakeBlock_c* daEnSnakeBlock_c::dBlock_c::mpOwner

The parent Snake Block actor.

Definition at line 80 of file d_a_en_snake_block.hpp.

◆ m_1b4

s16 daEnSnakeBlock_c::dBlock_c::m_1b4

Definition at line 82 of file d_a_en_snake_block.hpp.