Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: downloads/ogreode/include/OgreOdeDebugObject.h @ 21

Last change on this file since 21 was 21, checked in by nicolasc, 16 years ago

added ogreode and Colladaplugin

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