This commit is contained in:
parent
de88f966a9
commit
4142818b5c
2 changed files with 40 additions and 1 deletions
|
@ -26,6 +26,7 @@ void CNpcBarrelHazard::init()
|
||||||
CNpcHazard::init();
|
CNpcHazard::init();
|
||||||
|
|
||||||
m_npcPath.setPathType( CNpcPath::SINGLE_USE_PATH );
|
m_npcPath.setPathType( CNpcPath::SINGLE_USE_PATH );
|
||||||
|
m_rotation = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
@ -111,6 +112,41 @@ void CNpcBarrelHazard::processMovement( int _frames )
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ( moveX < 0 )
|
||||||
|
{
|
||||||
|
m_rotation -= 64 * _frames;
|
||||||
|
m_rotation &= 4095;
|
||||||
|
}
|
||||||
|
else if ( moveX > 0 )
|
||||||
|
{
|
||||||
|
m_rotation += 64 * _frames;
|
||||||
|
m_rotation &= 4095;
|
||||||
|
}
|
||||||
|
|
||||||
Pos.vx += moveX;
|
Pos.vx += moveX;
|
||||||
Pos.vy += moveY;
|
Pos.vy += moveY;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
void CNpcBarrelHazard::render()
|
||||||
|
{
|
||||||
|
CHazardThing::render();
|
||||||
|
|
||||||
|
if (canRender())
|
||||||
|
{
|
||||||
|
DVECTOR &renderPos=getRenderPos();
|
||||||
|
|
||||||
|
SVECTOR rotation;
|
||||||
|
rotation.vx = 0;
|
||||||
|
rotation.vy = 0;
|
||||||
|
rotation.vz = m_rotation;
|
||||||
|
|
||||||
|
VECTOR scale;
|
||||||
|
scale.vx = ONE;
|
||||||
|
scale.vy = ONE;
|
||||||
|
scale.vz = ONE;
|
||||||
|
|
||||||
|
m_modelGfx->Render(renderPos,&rotation,&scale);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -22,8 +22,11 @@ class CNpcBarrelHazard : public CNpcHazard
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
void init();
|
void init();
|
||||||
|
void render();
|
||||||
protected:
|
protected:
|
||||||
void processMovement( int _frames );
|
void processMovement( int _frames );
|
||||||
|
|
||||||
|
s16 m_rotation;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
Loading…
Add table
Add a link
Reference in a new issue