SBSPSS/source/hazard/hbwheel.cpp

88 lines
1.9 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;
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
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
}
2001-05-16 22:40:52 +02:00
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
const CRECT *CNpcBigWheelHazard::getThinkBBox()
{
CRECT objThinkBox = getCollisionArea();
sBBox &thinkBBox = CThingManager::getThinkBBox();
objThinkBox.x1 = thinkBBox.XMin;
objThinkBox.x2 = thinkBBox.XMax;
objThinkBox.y1 = thinkBBox.YMin;
objThinkBox.y2 = thinkBBox.YMax;
return &objThinkBox;
}