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