Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/branches/physics/src/ogreode/OgreOdeDebugObject.h @ 1923

Last change on this file since 1923 was 1923, checked in by rgrieder, 16 years ago

Cleaned up the heavy mess with header file includes in OgreOde. It should now compile a lot faster.

  • Property svn:eol-style set to native
File size: 3.2 KB
Line 
1#ifndef _OGREODEDEBUGOBJECT_H_
2#define _OGREODEDEBUGOBJECT_H_
3
4#include "OgreOdePreReqs.h"
5
6#include <OgreSimpleRenderable.h>
7
8namespace OgreOde
9{
10    //------------------------------------------------------------------------------------------------
11        class _OgreOdeExport DebugLines:public Ogre::SimpleRenderable
12        {
13        public:
14                DebugLines(void);
15                ~DebugLines(void);
16
17                void addLine(const Ogre::Vector3 &start,const Ogre::Vector3 &end)
18                {
19                        clear();
20
21                        _points.push_back(start);
22                        _points.push_back(end);
23                }
24                void addLine(Ogre::Real start_x, Ogre::Real start_y, Ogre::Real start_z, 
25            Ogre::Real end_x, Ogre::Real end_y, Ogre::Real end_z)
26                {
27                        addLine(Ogre::Vector3(start_x,start_y,start_z),Ogre::Vector3(end_x,end_y,end_z));
28                }
29                void draw();
30                void clear();
31
32                Ogre::Real getSquaredViewDepth(const Ogre::Camera *cam) const;
33                Ogre::Real getBoundingRadius(void) const;
34
35        protected:
36
37                Vector3Array _points;
38                bool _drawn;
39
40                static bool _materials_created;
41        };
42        //------------------------------------------------------------------------------------------------
43        class _OgreOdeExport DebugObject:public DebugLines
44        {
45        public:
46                enum Mode
47                {
48                        Mode_Unknown,
49                        Mode_Enabled,
50                        Mode_Disabled,
51                        Mode_Static
52                };
53
54        public:
55        DebugObject(DebugObject::Mode mode = DebugObject::Mode_Enabled);
56                virtual ~DebugObject();
57
58                void setMode(DebugObject::Mode mode);
59
60        protected:
61                DebugObject::Mode _mode;
62        };
63        //------------------------------------------------------------------------------------------------
64        class _OgreOdeExport BoxDebugObject:public DebugObject
65        {
66        public:
67                BoxDebugObject(const Ogre::Vector3& size);
68                virtual ~BoxDebugObject();
69        };
70        //------------------------------------------------------------------------------------------------
71        class _OgreOdeExport SphereDebugObject:public DebugObject
72        {
73        public:
74                SphereDebugObject(Ogre::Real radius);
75                virtual ~SphereDebugObject();
76        };
77        //------------------------------------------------------------------------------------------------
78        class _OgreOdeExport CapsuleDebugObject:public DebugObject
79        {
80        public:
81                CapsuleDebugObject(Ogre::Real radius, Ogre::Real length);
82                virtual ~CapsuleDebugObject();
83        };
84        //------------------------------------------------------------------------------------------------
85        class _OgreOdeExport CylinderDebugObject:public DebugObject
86        {
87        public:
88                CylinderDebugObject(Ogre::Real radius, Ogre::Real length);
89                virtual ~CylinderDebugObject();
90        };
91        //------------------------------------------------------------------------------------------------
92        class _OgreOdeExport TriangleMeshDebugObject:public DebugObject
93        {
94        public:
95                TriangleMeshDebugObject(int vertex_count);
96                virtual ~TriangleMeshDebugObject();
97
98                void beginDefinition();
99                void setVertex(int index, const Ogre::Vector3& vertex);
100                void endDefinition();
101        };
102        //------------------------------------------------------------------------------------------------
103        class _OgreOdeExport RayDebugObject:public DebugObject
104        {
105        public:
106                RayDebugObject(const Ogre::Vector3& start,const Ogre::Vector3& direction,const Ogre::Real length);
107                void setDefinition(const Ogre::Vector3& start,const Ogre::Vector3& direction,const Ogre::Real length);
108                virtual ~RayDebugObject();
109        };
110}
111
112#endif
Note: See TracBrowser for help on using the repository browser.