Planeshift
solid.h
Go to the documentation of this file.
1 /*
2  * solid.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 SOLID_HEADER
21 #define SOLID_HEADER
22 
23 //=============================================================================
24 // Crystal Space Includes
25 //=============================================================================
26 #include "csutil/scf.h"
27 #include "csutil/weakref.h"
28 #include <iengine/mesh.h>
29 
30 //=============================================================================
31 // Project Includes
32 //=============================================================================
33 
34 //=============================================================================
35 // Local Includes
36 //=============================================================================
37 
38 
39 
40 struct iObjectRegistry;
41 
42 
47 class psSolid
48 {
49 public:
54  psSolid(iObjectRegistry* objectReg);
55 
56  ~psSolid();
57 
62  void SetMesh(iMeshWrapper* mesh);
63 
66  void Setup();
67 
71  iCollider* GetCollider();
72 
73 private:
74  iObjectRegistry* objectReg;
75  csWeakRef<iMeshWrapper> mesh;
76  csRef<csColliderWrapper> colliderWrap;
77 
78  bool noCollider;
79 };
80 
81 #endif
Collider creation class.
Definition: solid.h:47
void SetMesh(iMeshWrapper *mesh)
Set the mesh that we want to use as the colliding one.
iCollider * GetCollider()
Get the collider object this class creates.
void Setup()
Complete the setup of the class and create the collider wrappers.
psSolid(iObjectRegistry *objectReg)
Create a blank collider.