-/*\r
-Copyright (C) 1999-2007 id Software, Inc. and contributors.\r
-For a list of contributors, see the accompanying CONTRIBUTORS file.\r
-\r
-This file is part of GtkRadiant.\r
-\r
-GtkRadiant is free software; you can redistribute it and/or modify\r
-it under the terms of the GNU General Public License as published by\r
-the Free Software Foundation; either version 2 of the License, or\r
-(at your option) any later version.\r
-\r
-GtkRadiant is distributed in the hope that it will be useful,\r
-but WITHOUT ANY WARRANTY; without even the implied warranty of\r
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
-GNU General Public License for more details.\r
-\r
-You should have received a copy of the GNU General Public License\r
-along with GtkRadiant; if not, write to the Free Software\r
-Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA\r
-*/\r
-\r
-#ifndef _ENTITYMODEL_H_\r
-#define _ENTITYMODEL_H_\r
-\r
-#include "plugin.h"\r
-\r
-/*! simulates misc_model entity behaviours for rendering/selection/editing */\r
-class CEntityMiscModel : public IRender, public ISelect, public IEdit\r
-{\r
-public:\r
- CEntityMiscModel (entity_t *e);\r
- virtual ~CEntityMiscModel ();\r
-\r
- void IncRef() { refCount++; }\r
- void DecRef() { if(--refCount == 0) delete this; }\r
-\r
- // IRender\r
- void Draw(int state, int rflags) const;\r
- const aabb_t *GetAABB() const { return &m_BBox; }\r
-\r
- // ISelect\r
- bool TestRay(const ray_t *ray, vec_t *dist) const;\r
- //bool TestBox(const aabb_t aabb) const;\r
-\r
- // ITransform\r
- void Translate(const vec3_t translation);\r
- void Rotate(const vec3_t pivot, const vec3_t rotation);\r
- const vec_t *GetTranslation() const { return m_translate; }\r
- const vec_t *GetRotation() const { return m_euler; }\r
- void OnKeyValueChanged(entity_t *e, const char *key, const char* value);\r
-\r
- void SetName(const char *name);\r
-private:\r
- void BuildCacheRequestString(const char *name);\r
- /*! updates the AABB and transformation matrix */\r
- void UpdateCachedData();\r
- entity_interfaces_t *m_model;\r
-\r
- entity_t *m_entity;\r
-\r
- int refCount;\r
- string_t m_version;\r
-\r
- Str m_cachereq;\r
-\r
- /*! AABB in local space */\r
- aabb_t m_BBox;\r
-\r
- /*! worldspace-to-localspace translation */\r
- vec3_t m_translate;\r
-\r
- /*! worldspace-to-localspace euler rotation angles */\r
- vec3_t m_euler;\r
-\r
- /*! worldspace-to-localspace scale */\r
- vec3_t m_scale;\r
-\r
- /*! localspace origin, effectively rotation & scale pivot point */\r
- vec3_t m_pivot;\r
-\r
- /*! worldspace-to-localspace transform, generated from translate/euler/scale/pivot */\r
- m4x4_t m_transform;\r
-\r
- /*! localspace-to-worldspace transform */\r
- m4x4_t m_inverse_transform;\r
-};\r
-\r
-/*! simulates eclass-model entity behaviours for rendering/selection/editing */\r
-class CEntityEclassModel : public IRender, public ISelect, public IEdit\r
-{\r
-public:\r
- CEntityEclassModel ();\r
- virtual ~CEntityEclassModel ();\r
-\r
- void IncRef() { refCount++; }\r
- void DecRef() { if(--refCount == 0) delete this; }\r
-\r
- // IRender\r
- void Draw(int state, int rflags) const;\r
- const aabb_t *GetAABB() const { return &m_BBox; }\r
-\r
- // ISelect\r
- bool TestRay(const ray_t *ray, vec_t *dist) const;\r
- //bool TestBox(const aabb_t aabb) const;\r
-\r
- // ITransform\r
- void Translate(const vec3_t translation);\r
- void Rotate(const vec3_t pivot, const vec3_t rotation);\r
- const vec_t *GetTranslation() const { return m_translate; }\r
- const vec_t *GetRotation() const { return m_euler; }\r
- void OnKeyValueChanged(entity_t *e, const char *key, const char* value);\r
-\r
- void SetName(const char *name);\r
- void SetEclass(const eclass_t* eclass);\r
-private:\r
- /*! updates the AABB and transformation matrix */\r
- void UpdateCachedData();\r
- entity_interfaces_t *m_model;\r
-\r
- int refCount;\r
- string_t m_name;\r
- string_t m_version;\r
- const eclass_t *m_eclass;\r
-\r
- /*! AABB in local space */\r
- aabb_t m_BBox;\r
-\r
- /*! worldspace-to-localspace translation */\r
- vec3_t m_translate;\r
-\r
- /*! worldspace-to-localspace euler rotation angles */\r
- vec3_t m_euler;\r
-\r
- /*! worldspace-to-localspace scale */\r
- vec3_t m_scale;\r
-\r
- /*! localspace origin, effectively rotation & scale pivot point */\r
- vec3_t m_pivot;\r
-\r
- /*! worldspace-to-localspace transform, generated from translate/euler/scale/pivot */\r
- m4x4_t m_transform;\r
-\r
- /*! localspace-to-worldspace transform */\r
- m4x4_t m_inverse_transform;\r
-};\r
-\r
-void pivot_draw(const vec3_t pivot);\r
-void Entity_UpdateClass(entity_t *e, const char* value);\r
-\r
-#endif /* _ENTITYMODEL_H_ */\r
+/*
+Copyright (C) 1999-2007 id Software, Inc. and contributors.
+For a list of contributors, see the accompanying CONTRIBUTORS file.
+
+This file is part of GtkRadiant.
+
+GtkRadiant is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+GtkRadiant is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GtkRadiant; if not, write to the Free Software
+Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+*/
+
+#ifndef _ENTITYMODEL_H_
+#define _ENTITYMODEL_H_
+
+#include "plugin.h"
+
+/*! simulates misc_model entity behaviours for rendering/selection/editing */
+class CEntityMiscModel : public IRender, public ISelect, public IEdit
+{
+public:
+ CEntityMiscModel (entity_t *e);
+ virtual ~CEntityMiscModel ();
+
+ void IncRef() { refCount++; }
+ void DecRef() { if(--refCount == 0) delete this; }
+
+ // IRender
+ void Draw(int state, int rflags) const;
+ const aabb_t *GetAABB() const { return &m_BBox; }
+
+ // ISelect
+ bool TestRay(const ray_t *ray, vec_t *dist) const;
+ //bool TestBox(const aabb_t aabb) const;
+
+ // ITransform
+ void Translate(const vec3_t translation);
+ void Rotate(const vec3_t pivot, const vec3_t rotation);
+ const vec_t *GetTranslation() const { return m_translate; }
+ const vec_t *GetRotation() const { return m_euler; }
+ void OnKeyValueChanged(entity_t *e, const char *key, const char* value);
+
+ void SetName(const char *name);
+private:
+ void BuildCacheRequestString(const char *name);
+ /*! updates the AABB and transformation matrix */
+ void UpdateCachedData();
+ entity_interfaces_t *m_model;
+
+ entity_t *m_entity;
+
+ int refCount;
+ string_t m_version;
+
+ Str m_cachereq;
+
+ /*! AABB in local space */
+ aabb_t m_BBox;
+
+ /*! worldspace-to-localspace translation */
+ vec3_t m_translate;
+
+ /*! worldspace-to-localspace euler rotation angles */
+ vec3_t m_euler;
+
+ /*! worldspace-to-localspace scale */
+ vec3_t m_scale;
+
+ /*! localspace origin, effectively rotation & scale pivot point */
+ vec3_t m_pivot;
+
+ /*! worldspace-to-localspace transform, generated from translate/euler/scale/pivot */
+ m4x4_t m_transform;
+
+ /*! localspace-to-worldspace transform */
+ m4x4_t m_inverse_transform;
+};
+
+/*! simulates eclass-model entity behaviours for rendering/selection/editing */
+class CEntityEclassModel : public IRender, public ISelect, public IEdit
+{
+public:
+ CEntityEclassModel ();
+ virtual ~CEntityEclassModel ();
+
+ void IncRef() { refCount++; }
+ void DecRef() { if(--refCount == 0) delete this; }
+
+ // IRender
+ void Draw(int state, int rflags) const;
+ const aabb_t *GetAABB() const { return &m_BBox; }
+
+ // ISelect
+ bool TestRay(const ray_t *ray, vec_t *dist) const;
+ //bool TestBox(const aabb_t aabb) const;
+
+ // ITransform
+ void Translate(const vec3_t translation);
+ void Rotate(const vec3_t pivot, const vec3_t rotation);
+ const vec_t *GetTranslation() const { return m_translate; }
+ const vec_t *GetRotation() const { return m_euler; }
+ void OnKeyValueChanged(entity_t *e, const char *key, const char* value);
+
+ void SetName(const char *name);
+ void SetEclass(const eclass_t* eclass);
+private:
+ /*! updates the AABB and transformation matrix */
+ void UpdateCachedData();
+ entity_interfaces_t *m_model;
+
+ int refCount;
+ string_t m_name;
+ string_t m_version;
+ const eclass_t *m_eclass;
+
+ /*! AABB in local space */
+ aabb_t m_BBox;
+
+ /*! worldspace-to-localspace translation */
+ vec3_t m_translate;
+
+ /*! worldspace-to-localspace euler rotation angles */
+ vec3_t m_euler;
+
+ /*! worldspace-to-localspace scale */
+ vec3_t m_scale;
+
+ /*! localspace origin, effectively rotation & scale pivot point */
+ vec3_t m_pivot;
+
+ /*! worldspace-to-localspace transform, generated from translate/euler/scale/pivot */
+ m4x4_t m_transform;
+
+ /*! localspace-to-worldspace transform */
+ m4x4_t m_inverse_transform;
+};
+
+void pivot_draw(const vec3_t pivot);
+void Entity_UpdateClass(entity_t *e, const char* value);
+
+#endif /* _ENTITYMODEL_H_ */