Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | Related Pages

sprite.h

Go to the documentation of this file.
00001 /***************************************************************************
00002                       sprite.h  -  Quad always facing camera
00003                              -------------------
00004     begin                : Tue Jun 4 2002
00005     copyright            : (C) 2002 by Reality Rift Studios
00006     email                : mattias@realityrift.com
00007  ***************************************************************************
00008 
00009  The contents of this file are subject to the Mozilla Public License Version
00010  1.1 (the "License"); you may not use this file except in compliance with
00011  the License. You may obtain a copy of the License at 
00012  http://www.mozilla.org/MPL/
00013 
00014  Software distributed under the License is distributed on an "AS IS" basis,
00015  WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
00016  for the specific language governing rights and limitations under the
00017  License.
00018 
00019  The Original Code is the NeoEngine, sprite.h
00020 
00021  The Initial Developer of the Original Code is Mattias Jansson.
00022  Portions created by Mattias Jansson are Copyright (C) 2002
00023  Reality Rift Studios. All Rights Reserved.
00024 
00025  ***************************************************************************/
00026 
00027 #ifndef __NESPRITE_H
00028 #define __NESPRITE_H
00029 
00030 
00031 #include "base.h"
00032 #include "sceneentity.h"
00033 #include "material.h"
00034 #include "vertexbuffer.h"
00035 #include "polygonbuffer.h"
00036 #include "vertex.h"
00037 
00038 
00045 namespace NeoEngine
00046 {
00047 
00048 
00049 //External classes
00050 class PolygonBuffer;
00051 
00052 
00053 
00054 
00055 
00061 class NEOENGINE_API Sprite : public SceneEntity
00062 {
00063     public:
00064 
00065         DefineVisitable();
00066 
00067     protected:
00068 
00070         float                                         m_afSize[2];
00071 
00073         float                                         m_fRotation;
00074 
00075 
00076     public:
00077 
00079         VertexBufferPtr                             m_pkVertexBuffer;
00080 
00082         PolygonStripBufferPtr                       m_pkPolygonBuffer;
00083 
00085         MaterialPtr                                 m_pkMaterial;
00086         
00087 
00088 
00096                                                       Sprite( const MaterialPtr &pkMaterial, float fSizeX = 0.0f, float fSizeY = 0.0f, const VertexDeclaration *pkFormat = &TexVertex::s_kDecl );
00097 
00100         virtual                                      ~Sprite();
00101 
00102 
00108         virtual bool                                  Render( Frustum *pkFrustum = 0, bool bForce = false );
00109 
00116         void                                          SetSize( float fSizeX, float fSizeY, bool bSetDefaultTexCoords = false );
00117 
00122         void                                          SetRotation( float fRot ) { m_fRotation = fRot; }
00123 
00128         void                                          Rotate( float fRot ) { m_fRotation += fRot; }
00129 };
00130 
00131 
00132 }; // namespace NeoEngine
00133 
00134 
00135 #endif

Generated on Wed Jan 21 14:21:07 2004 for NeoEngine by doxygen 1.3.5