Planeshift
gemmesh.h
Go to the documentation of this file.
1 /*
2 * gemmesh.h by Andrew Craig <andrew@hydlaa.com>
3 *
4 * Copyright (C) 2008 Atomic Blue (info@planeshift.it, http://www.atomicblue.org)
5 *
6 *
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation (version 2 of the License)
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 *
18 */
19 
20 #ifndef GEM_MESH_HEADER
21 #define GEM_MESH_HEADER
22 
23 //=============================================================================
24 // Crystal Space Includes
25 //=============================================================================
26 #include "cstypes.h"
27 #include "csutil/scf.h"
28 #include "csutil/weakref.h"
29 
30 //=============================================================================
31 // Crystal Space Forward Definitions
32 //=============================================================================
33 struct iEngine;
34 struct iMeshWrapper;
35 struct iMeshFactoryWrapper;
36 struct iSector;
37 struct iObjectRegistry;
38 class csVector3;
39 
40 
41 //=============================================================================
42 // PlaneShift Forward Definitions
43 //=============================================================================
44 class GEMSupervisor;
45 class gemObject;
46 
56 class gemMesh
57 {
58 public:
68  gemMesh(iObjectRegistry* objreg, gemObject* owner, GEMSupervisor* super);
69 
70  ~gemMesh();
71 
83  iMeshFactoryWrapper* LoadMeshFactory(const char* fileName, const char* factoryName);
84 
93  bool SetMesh(const char* factoryName, const char* fileName);
94 
100  iMeshWrapper* GetMesh();
101 
107  void SetMesh(iMeshWrapper* newMesh);
108 
112  void RemoveMesh();
113 
121  void MoveMesh(iSector* sector, const float yrot, const csVector3 &position);
122 
123 private:
124  csRef<iMeshWrapper> mesh;
125  iObjectRegistry* objectReg;
126  csWeakRef<iEngine> engine;
127 
128  GEMSupervisor* gem;
129 
130  gemObject* gemOwner;
131 };
132 
135 #endif
gemMesh(iObjectRegistry *objreg, gemObject *owner, GEMSupervisor *super)
Create a new gem Mesh.
iMeshFactoryWrapper * LoadMeshFactory(const char *fileName, const char *factoryName)
Load a mesh factory.
void MoveMesh(iSector *sector, const float yrot, const csVector3 &position)
Move a mesh.
bool SetMesh(const char *factoryName, const char *fileName)
Set a mesh.
A gemObject is any solid, graphical object visible in PS with normal physics and normal collision det...
Definition: gem.h:314
This class holds the refs to the core factories, etc in CEL.
Definition: gem.h:126
This is a helper class that defines a mesh on the server.
Definition: gemmesh.h:56
iMeshWrapper * GetMesh()
Get the Crystal Space iMeshWrapper from this.
void RemoveMesh()
Removes the mesh from the engine.