00001 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 5 -*- */ 00002 00003 /* 00004 * Combination of a first person action and a real time strategy battle game. 00005 */ 00006 00007 /* 00008 * StoneSprite.h 00009 * MetalWarriors 00010 * $Revision: 1.7 $ 00011 * 00012 * Created by Daniel Aarno on Thu Oct 30 2003. 00013 * Copyright (c) 2003 Daniel Aarno and Erik Ytterberg - All rights reserved. 00014 * 00015 * This program is free software; you can redistribute it and/or modify 00016 * it under the terms of the GNU General Public License as published by 00017 * the Free Software Foundation; either version 2 of the License, or 00018 * (at your option) any later version. 00019 * 00020 * This program is distributed in the hope that it will be useful, 00021 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00022 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00023 * GNU General Public License for more details. 00024 * 00025 * You should have received a copy of the GNU General Public License 00026 * along with this program; if not, write to the Free Software 00027 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00028 */ 00029 00030 00031 #ifndef _STONE_SPRITE_ 00032 #define _STONE_SPRITE_ 00033 00034 #include "Sprite.h" 00035 #include "Model.h" 00036 00037 class StoneSprite : public Sprite 00038 { 00039 protected: 00040 float height; 00041 float width; 00042 float depth; 00043 static TexID tex; 00044 GLuint dlist; 00045 00046 public: 00047 StoneSprite(float x_size, float y_size, float z_size, 00048 float x, float y, float z); 00049 00050 virtual void update(); 00051 virtual void paint(); 00052 00053 virtual bool checkCollision(Sprite *with, bool fromSelf /*= false*/); 00054 virtual bool notifyCollision(Sprite *sender); 00055 00056 private: 00057 void sphericalCoords(float *coord, float fi, float theta); 00058 void distortCoords(float *coords, float factor); 00059 void createNormals(float *coord, float *normal1, float *e1, float *e2, float *e3 , float *e4); 00060 }; 00061 00062 #endif //_STONE_SPRITE_
1.4.7