SBSPSS/source/hazard/hbwheel.cpp

79 lines
1.7 KiB
C++
Raw Normal View History

2001-05-05 15:53:08 +02:00
/*=========================================================================
hbwheel.cpp
Author: CRB
Created:
Project: Spongebob
Purpose:
Copyright (c) 2001 Climax Development Ltd
===========================================================================*/
#ifndef __HAZARD_HBWHEEL_H__
#include "hazard\hbwheel.h"
#endif
#ifndef __VID_HEADER_
#include "system\vid.h"
#endif
#ifndef __LEVEL_LEVEL_H__
#include "level\level.h"
#endif
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void CNpcBigWheelHazard::init()
{
CNpcHazard::init();
m_rotation = 0;
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void CNpcBigWheelHazard::processMovement( int _frames )
{
2001-05-05 15:54:34 +02:00
m_rotation += 5 * _frames;
2001-05-05 15:53:08 +02:00
m_rotation &= 4095;
2001-06-18 21:06:43 +02:00
if ( m_soundId == NOT_PLAYING )
{
m_soundId = (int) CSoundMediator::playSfx( CSoundMediator::SFX_WORLD_OBJECT__BIG_WHEEL, true );
}
2001-05-05 15:53:08 +02:00
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void CNpcBigWheelHazard::render()
{
CHazardThing::render();
2001-05-14 23:08:03 +02:00
if (canRender())
{
DVECTOR &renderPos=getRenderPos();
2001-05-05 15:53:08 +02:00
2001-05-14 23:08:03 +02:00
SVECTOR rotation;
rotation.vx = 0;
rotation.vy = 0;
rotation.vz = m_rotation;
2001-05-05 16:58:49 +02:00
2001-05-14 23:08:03 +02:00
VECTOR scale;
scale.vx = ONE;
scale.vy = ONE;
scale.vz = ONE;
2001-05-05 15:53:08 +02:00
2001-05-14 23:08:03 +02:00
m_modelGfx->Render(renderPos,&rotation,&scale);
2001-05-05 15:53:08 +02:00
}
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void CNpcBigWheelHazard::collidedWith( CThing *_thisThing )
{
// do not collide
}