MercuryShapes.h

Go to the documentation of this file.
00001 #ifndef _MERCURY_SHAPES_H
00002 #define _MERCURY_SHAPES_H
00003 
00004 #include "MercuryModel.h"
00005 #include "MercuryINI.h"
00006 
00008 class MercuryShape : public MercuryModel
00009 {
00010 public:
00011     MercuryShape();
00012     virtual ~MercuryShape();
00013 
00015     bool LoadImage( const MString & Filename );
00016 
00018     MercuryMaterial * GetTopMaterial() { return m_materials[0]; } 
00019 
00021     MercuryMesh * GetTopMesh() { return m_meshes[0]; }
00022 
00024     void LoadModel() { }
00025 
00027     void MakeSphere( int Stacks=6, int Slices=12 );
00029     void MakeCylinder( int Stacks=6, int Slices=12 );
00031     void MakeSprite( int Rows = 1, int Cols = 1 );
00033     void MakeBox( bool bWholeMap = true );
00034 
00036     bool SetFromINI( MercuryINI & InINI, const MString & section );
00037     virtual bool Command( PStack & ret, const char * command, PStack & args );
00038     virtual void EnumerateCommands( MVector< MString > & toAdd );
00039 
00041     void CleanupMeshes();
00042     CLASS_RTTI( MercuryShape, MercuryModel );
00043 };
00044 
00045 #endif
00046 
00047 /* 
00048  * Copyright (c) 2005-2006, Charles Lohr
00049  * All rights reserved.
00050  *
00051  * Redistribution and use in source and binary forms, with or
00052  * without modification, are permitted provided that the following
00053  * conditions are met:
00054  *  -   Redistributions of source code must retain the above
00055  *      copyright notice, this list of conditions and the following disclaimer.
00056  *  -   Redistributions in binary form must reproduce the above copyright
00057  *      notice, this list of conditions and the following disclaimer in
00058  *      the documentation and/or other materials provided with the distribution.
00059  *  -   Neither the name of the Mercury Engine nor the names of its
00060  *      contributors may be used to endorse or promote products derived from
00061  *      this software without specific prior written permission.
00062  *
00063  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
00064  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00065  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
00066  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
00067  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
00068  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
00069  * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
00070  * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
00071  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
00072  * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00073  */

Hosted by SourceForge.net Logo