BoundingRectangle CurveDataCircularBuffer::getBounds() const {
  if (!points_.empty()) {
    QPointF minimum(xMin_.top().x_, yMin_.top());
    QPointF maximum(xMax_.top(), yMax_.top());
    
    return BoundingRectangle(minimum, maximum);
  }
  
  
  return BoundingRectangle();
}
LevelNavigationButton::LevelNavigationButton(CIwSVec2 menuPosition, CIwSVec2 offset, CIwSVec2 size, bool mainMenu) : MenuButton()
{
	IW_CALLSTACK("LevelNavigationButton::LevelNavigationButton");

   this->i2Size = size;
	this->i2RegionSize = size;
	this->i2Offset = offset;
   this->i2Position = menuPosition + this->i2Offset;
   this->brBoundingBox = BoundingRectangle(this->i2Position, this->i2Size);

   this->sName = "levelnavigationbutton";

   if(mainMenu == true)
   {
      this->tTextureList.push_back(ImageManager::getImage("kittyplay"));
	   this->tTextureList.push_back(ImageManager::getImage("kittyplay2"));
   }
   else
   {
      this->tTextureList.push_back(ImageManager::getImage("kittysidebutton_levels"));
		this->tTextureList.push_back(ImageManager::getImage("kittysidebutton_levels2"));
   }

	this->sSoundList.push_back(SoundManager::getSound("menu2"));
	this->sSoundList.push_back(SoundManager::getSound("menu8"));

   ClassTracker::addUnit(this);
}
Mouse::Mouse(CIwSVec2 i2Position): ShinyUnit() 
{
   IW_CALLSTACK("Mouse::Mouse");

   this->iAIHole = 10;
   this->bUpdate = false;
   this->bDead = false;
   this->bScared = false;
   this->f2Velocity = CIwFVec2(0.101f, 0);
   this->tTextureList.push_back(ImageManager::getImage("mouse"));
   this->tTextureList.push_back(ImageManager::getImage("mouseleft"));


   this->sSoundList.push_back(SoundManager::getSound("mouse1"));
   this->sSoundList.push_back(SoundManager::getSound("mouse2"));	
   this->sSoundList.push_back(SoundManager::getSound("mouse3"));
   this->sSoundList.push_back(SoundManager::getSound("mouse4"));

   this->i2Position = i2Position;
   this->f2AbsPosition = CIwFVec2((float)this->i2Position.x, (float)this->i2Position.y);
   this->i2InitialPosition = i2Position;
   this->sName = "mouse";
   this->fShininess = 6;
   this->bIsMoving = true;
   this->brBoundingBox = BoundingRectangle(this->getPosition(), this->getSize(), CIwSVec2((int)(this->i2Size.x * 0.3f), (int)(this->i2Size.y * 0.3f)), true);
   this->csPlayWith = CatState::MOUSEPLAYING;

   ClassTracker::addUnit(this);
}
Scythe::Scythe(CIwSVec2 i2Position): LethalUnit()
{
   IW_CALLSTACK("Scythe::Scythe");

   this->tTextureList.push_back(ImageManager::getImage("scythe"));
   this->tTextureList.push_back(ImageManager::getImage("bloodyscythe"));

   this->sSoundList.push_back(SoundManager::getSound("scythe_kill"));
   this->sSoundList.push_back(SoundManager::getSound("swoosh3"));

   this->iSoundIndex = 5;

   this->i2Position = i2Position;
   this->sName="scythe";
   this->brBoundingBox = BoundingRectangle(this->i2Position, this->i2Size, CIwSVec2((int)(this->i2Size.x * 0.7f), (int)(this->i2Size.y * 0.7f)));
   this->bUpdate = false;
   this->bIsMoving = true;
   this->bDrawn = false;
   this->mRot = CIwMat2D();
   this->iLength = 0;
   this->fAngularAcceleration = 0;
   this->fAngularVel = 0;
   this->fAngle = 0;
   this->iCapDeathCount = 1000;

   this->DarkGreen.Set(46, 139, 87, 255);
   this->LightGreen.Set(0, 255, 127, 255);
   this->green = IwRandMinMax(0 , 255);
   this->up = true;

   ClassTracker::addUnit(this);
}
StartBox::StartBox(CIwSVec2 i2Position): Unit()
{
   IW_CALLSTACK("StartBox::StartBox");

   this->tTextureList.push_back(ImageManager::getImage("start"));
   this->i2Position = i2Position;
   this->sName = "startbox";
   this->brBoundingBox = BoundingRectangle(this->i2Position, this->i2Size, this->i2Size, true);

   ClassTracker::addUnit(this);
}
CatEvent::CatEvent(CIwSVec2 i2Position): ShinyUnit()
{
   IW_CALLSTACK("CatEvent::CatEvent");

   this->i2Position = i2Position;
   this->sName = "catevent";
   this->fShininess = -1;
   this->bIsMoving = true;
   this->brBoundingBox = BoundingRectangle(this->i2Position, this->i2Size,this->i2Size, true);
   this->csPlayWith = CatState::IDLING;

   ClassTracker::addUnit(this);
}
Beispiel #7
0
BoundingRectangle TransformMatrix::transformRect (BoundingRectangle br) {
    std::array<Vec2f, 4> points;
    points[0] = br.getPosition();
    points[1] = Vec2f (br.getPosition().x + br.getWidth(),br.getPosition().y);
    points[2] = Vec2f (br.getPosition().x + br.getWidth(), br.getPosition().y + br.getHeight());
    points[3] = Vec2f (br.getPosition().x, br.getPosition().y + br.getHeight());
    for (unsigned int i = 0; i < points.size(); i++) {
        points[i] = transform(points[i]);
    }
    std::array<std::array<float, 2>, 2> store;
    store = Computer::getExtends(points);

    return BoundingRectangle(store[0][0], store[1][0],store[0][1] - store[0][0],store[1][1] - store[1][0]);
}
BearTrap::BearTrap(CIwSVec2 i2Position): LethalUnit()
{
   IW_CALLSTACK("BearTrap::BearTrap");

   this->iCapDeathCount = 1;
   this->tTextureList.push_back(ImageManager::getImage("bear_trap"));
   this->tTextureList.push_back(ImageManager::getImage("bear_trap_close"));
   this->sSoundList.push_back(SoundManager::getSound("beartrap"));
   this->i2Position = i2Position;
   this->iSoundIndex = 5;
   this->sName = "beartrap";
   this->brBoundingBox = BoundingRectangle(this->getPosition(), this->getSize(), CIwSVec2((int)(this->getSize().x * 0.5f), this->getSize().y), true);

   ClassTracker::addUnit(this);
}
LitterBox::LitterBox(CIwSVec2 i2Position): ShinyUnit()
{
   IW_CALLSTACK("LitterBox::LitterBox");

   this->bFull = true;
   this->fShininess = -1;
   this->tTextureList.push_back(ImageManager::getImage("litter_box"));
   this->tTextureList.push_back(ImageManager::getImage("litter_box_poop"));

   this->sSoundList.push_back(SoundManager::getSound("litterbox1"));
   this->sSoundList.push_back(SoundManager::getSound("litterbox1"));
   this->sSoundList.push_back(SoundManager::getSound("litterbox2"));
   this->sSoundList.push_back(SoundManager::getSound("litterbox2"));
   this->sSoundList.push_back(SoundManager::getSound("litterbox2"));

   this->i2Position = i2Position;
   this->sName = "litterbox";
   this->brBoundingBox = BoundingRectangle(this->getPosition(), this->getSize(), this->getSize(), true);
   this->csPlayWith = CatState::POOPING;

   ClassTracker::addUnit(this);
}
Food::Food(CIwSVec2 i2Position): ShinyUnit()
{
   IW_CALLSTACK("Food::Food");

   this->tTextureList.push_back(ImageManager::getImage("cat_food"));
   this->tTextureList.push_back(ImageManager::getImage("platform"));

   this->sSoundList.push_back(SoundManager::getSound("foodmunch1"));
   this->sSoundList.push_back(SoundManager::getSound("foodmunch1"));
   this->sSoundList.push_back(SoundManager::getSound("foodmunch2"));
   this->sSoundList.push_back(SoundManager::getSound("foodmunch2"));
   this->sSoundList.push_back(SoundManager::getSound("foodmunch3"));
   this->sSoundList.push_back(SoundManager::getSound("foodmunch3"));

   this->i2Position = i2Position;
   this->fShininess = SHININESS;
   this->sName = "food";
   this->brBoundingBox = BoundingRectangle(this->getPosition(), this->getSize(), CIwSVec2((int)(this->getSize().x * 0.7f), (int)(this->getSize().y * 0.7f)), true);
   this->csPlayWith = CatState::EATINGFOOD;
   this->bEmpty = false;

   ClassTracker::addUnit(this);
}