2 Copyright (C) 1999-2007 id Software, Inc. and contributors.
\r
3 For a list of contributors, see the accompanying CONTRIBUTORS file.
\r
5 This file is part of GtkRadiant.
\r
7 GtkRadiant is free software; you can redistribute it and/or modify
\r
8 it under the terms of the GNU General Public License as published by
\r
9 the Free Software Foundation; either version 2 of the License, or
\r
10 (at your option) any later version.
\r
12 GtkRadiant is distributed in the hope that it will be useful,
\r
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
\r
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
\r
15 GNU General Public License for more details.
\r
17 You should have received a copy of the GNU General Public License
\r
18 along with GtkRadiant; if not, write to the Free Software
\r
19 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
\r
25 #define MODEL_MAJOR "model"
\r
28 loads model from model file name specified,
\r
29 fills model struct with pointers to model interfaces
\r
31 name is a relative path, we'll use VFS to extract a basepath to add to get the absolute path.
\r
33 typedef void (* PFN_LOADMODEL) (entity_interfaces_t *model, const char *name);
\r
35 struct _QERPlugModelTable
\r
38 PFN_LOADMODEL m_pfnLoadModel;
\r
42 //forward declare entity_t
\r
44 typedef struct entity_s entity_t;
\r
46 // any module relying on imodel will need to link against the mathlib
\r
47 #include "mathlib.h"
\r
50 #define DRAW_GL_FILL 0x0001
\r
51 #define DRAW_GL_LIGHTING 0x0010
\r
52 #define DRAW_GL_TEXTURE_2D 0x0100
\r
53 #define DRAW_GL_BLEND 0x1000
\r
55 // predefined state combinations
\r
56 #define DRAW_GL_WIRE 0x0000
\r
57 #define DRAW_GL_FLAT 0x0001
\r
58 #define DRAW_GL_SOLID 0x0011
\r
59 #define DRAW_GL_TEXTURED 0x0111
\r
63 #define DRAW_SOLID 1
\r
64 #define DRAW_TEXTURED 2
\r
67 #define DRAW_RF_NONE 0x0000
\r
68 #define DRAW_RF_SEL_OUTLINE 0x0001
\r
69 #define DRAW_RF_SEL_FILL 0x0010
\r
70 #define DRAW_RF_XY 0x0011
\r
71 #define DRAW_RF_CAM 0x0100
\r
76 virtual ~IRender() { }
\r
77 virtual void IncRef() = 0; // increments the reference counter for this object
\r
78 virtual void DecRef() = 0; // decrements the reference counter for this object, deletes the object if reference count is zero
\r
79 virtual void Draw(int state, int rflags) const = 0; // render the object - state = the opengl state
\r
80 virtual const aabb_t *GetAABB() const = 0;
\r
86 virtual ~ISelect() { }
\r
87 virtual void IncRef() = 0; // increments the reference counter for this object
\r
88 virtual void DecRef() = 0; // decrements the reference counter for this object, deletes the object if reference count is zero
\r
89 virtual bool TestRay(const ray_t *ray, vec_t *dist) const = 0; // test ray intersection, return bool true if intersects, and store distance to closest point of intersection
\r
90 //virtual bool TestBox(const aabb_t *aabb) const = 0; // test aabb intersection, return bool true if touching or intersecting
\r
96 virtual ~IEdit() { }
\r
97 virtual void IncRef() = 0; // increments the reference counter for this object
\r
98 virtual void DecRef() = 0; // decrements the reference counter for this object, deletes the object if reference count is zero
\r
99 virtual void Translate(const vec3_t translation) = 0;
\r
100 virtual void Rotate(const vec3_t pivot, const vec3_t rotation) = 0;
\r
101 virtual const vec_t *GetTranslation() const = 0;
\r
102 virtual const vec_t *GetRotation() const = 0;
\r
103 virtual void OnKeyValueChanged(entity_t *e, const char *key, const char* value) = 0;
\r
106 #endif /* _IMODEL_H_ */
\r