Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Oct 14, 2008, 10:07:50 PM (17 years ago)
Author:
rgrieder
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/physics/src/ogreode/OgreOdeFrameListener.h

    r1919 r1923  
    88#define _PHYSICSFRAMELISTENER_H_
    99
     10#include "OgreOdePreReqs.h"
     11#include <OgreSceneQuery.h>
     12#include <OgreFrameListener.h>
     13
    1014// Uncomment this if you're planning to use the Plane2D joint
    1115// But you'll have to have modified ODE first!
     
    1519A physical thing
    1620*/
    17 class PhysicalThing : public RaySceneQueryListener
     21class PhysicalThing : public Ogre::RaySceneQueryListener
    1822{
    1923public:
     
    2327
    2428        // Just create geoms
    25     void makePlane(Real a,Real b,Real c,Real d);                                // Plane
    26     void makeBox(Real x,Real y,Real z,Real lx,Real ly,Real lz); // Box
    27     void makeSphere(Real x,Real y,Real z,Real r);                               // Sphere
     29    void makePlane(Ogre::Real a, Ogre::Real b, Ogre::Real c, Ogre::Real d);                             // Plane
     30    void makeBox(Ogre::Real x, Ogre::Real y, Ogre::Real z, Ogre::Real lx, Ogre::Real ly, Ogre::Real lz);        // Box
     31    void makeSphere(Ogre::Real x, Ogre::Real y, Ogre::Real z, Ogre::Real r);                            // Sphere
    2832
    2933        // Create bodies and geoms
    30     void makePlane(dWorld *world,SceneNode *node);
    31         void makeBox(dWorld *world,SceneNode *node,Real mass = 1,Vector3 const &offs = Vector3(0,0,0));
    32     void makeSphere(dWorld *world,SceneNode *node,Real mass = 1);
    33         void makeTerrainTriMesh(dWorld *world,SceneManager *mgr,Real grid_size,Real grid_spacing);
     34    void makePlane(dWorld *world, Ogre::SceneNode *node);
     35        void makeBox(dWorld *world, Ogre::SceneNode *node, Ogre::Real mass = 1, Ogre::Vector3 const &offs = Ogre::Vector3(0,0,0));
     36    void makeSphere(dWorld *world, Ogre::SceneNode *node, Ogre::Real mass = 1);
     37        void makeTerrainTriMesh(dWorld *world, Ogre::SceneManager *mgr, Ogre::Real grid_size, Ogre::Real grid_spacing);
    3438
    3539        // Callback functions for the ray scene query functionality
    36         virtual bool queryResult(SceneQuery::WorldFragment *fragment,Real distance);
    37         virtual bool queryResult(MovableObject *obj,Real distance);
     40        virtual bool queryResult(Ogre::SceneQuery::WorldFragment *fragment, Ogre::Real distance);
     41        virtual bool queryResult(Ogre::MovableObject *obj, Ogre::Real distance);
    3842
    3943        // Update the position and orientation of the scene node we're controlling
     
    4145
    4246        // Utility functions to get at internal stuff
    43         SceneNode *getNode(void);
     47        Ogre::SceneNode *getNode(void);
    4448        dBodyID getBodyID(void);
    4549        dSpaceID getSpaceID(void);
     
    4953        dBody           *_body;
    5054        dSpace          *_space;
    51         SceneNode       *_node;
     55        Ogre::SceneNode *_node;
    5256
    53         std::list<Vector3> _frag;
     57        std::list<Ogre::Vector3> _frag;
    5458
    5559        dVector3 *_vertices;
     
    6064A Frame listener that implements the physics
    6165*/
    62 class PhysicsFrameListener : public FrameListener
     66class PhysicsFrameListener : public Ogre::FrameListener
    6367{
    6468protected:
     
    7680   
    7781        // Adjustable variables
    78     Real total_time,step_size;
    79         Real k_spring,k_damper,k_tyre,k_mu,k_erp,k_cfm;
     82    Ogre::Real total_time,step_size;
     83        Ogre::Real k_spring,k_damper,k_tyre,k_mu,k_erp,k_cfm;
    8084
    8185        // Utility function to find the physical thing associated with an Ogre scene node
    82         dBodyID getBodyID(SceneNode *node);
     86        dBodyID getBodyID(Ogre::SceneNode *node);
    8387
    8488public:
     
    8892
    8993        // Tell us when every frame's about to be started
    90     bool frameStarted(const FrameEvent& evt);
     94    bool frameStarted(const Ogre::FrameEvent& evt);
    9195        void pause(bool p = true);
    9296
     
    98102        // Create things manually, no physical bodies
    99103        // so they won't move, but things will collide with them
    100     PhysicalThing *createPlane(Real a,Real b,Real c,Real d);
    101     PhysicalThing *createBox(Real x,Real y,Real z,Real lx,Real ly,Real lz);
    102     PhysicalThing *createSphere(Real x,Real y,Real z,Real r);
     104    PhysicalThing *createPlane(Ogre::Real a,Ogre::Real b,Ogre::Real c,Ogre::Real d);
     105    PhysicalThing *createBox(Ogre::Real x,Ogre::Real y,Ogre::Real z,Ogre::Real lx,Ogre::Real ly,Ogre::Real lz);
     106    PhysicalThing *createSphere(Ogre::Real x,Ogre::Real y,Ogre::Real z,Ogre::Real r);
    103107
    104108        // Create objects based on Ogre nodes, these nodes will then
     
    107111        // Except for the plane, which can't actually be a physical body
    108112        // and the trimesh which we're not going to allow to be a physical body
    109     PhysicalThing *createPlane(SceneNode *node);
    110         PhysicalThing *createBox(SceneNode *node,Real mass = 1,Vector3 const &offs = Vector3(0,0,0));
    111     PhysicalThing *createSphere(SceneNode *node,Real mass = 1);
    112         PhysicalThing *createTerrainTriMesh(SceneManager *mgr,Real grid_size,Real grid_spacing);
     113    PhysicalThing *createPlane(Ogre::SceneNode *node);
     114        PhysicalThing *createBox(Ogre::SceneNode *node,Ogre::Real mass = 1,Ogre::Vector3 const &offs = Ogre::Vector3(0,0,0));
     115    PhysicalThing *createSphere(Ogre::SceneNode *node,Ogre::Real mass = 1);
     116        PhysicalThing *createTerrainTriMesh(Ogre::SceneManager *mgr,Ogre::Real grid_size,Ogre::Real grid_spacing);
    113117
    114118        // Create and activate a new space inside the standard hash space
     
    120124        // The order of n1/n2 does matter; n1 is what you want attaching
    121125        // and n2 is what you want it attaching to
    122         dJoint *createHinge2(SceneNode *n1,SceneNode *n2,const Vector3 &suspension = Vector3(0,1,0),const Vector3 &axle = Vector3(1,0,0));
    123         dJoint *createHinge(SceneNode *n1,SceneNode *n2,const Vector3 &axis = Vector3(1,0,0));
    124         dJoint *createSlider(SceneNode *n1,SceneNode *n2,const Vector3 &axis = Vector3(0,1,0));
    125         dJoint *createBall(SceneNode *n1,SceneNode *n2);
     126        dJoint *createHinge2(Ogre::SceneNode *n1,Ogre::SceneNode *n2,const Ogre::Vector3 &suspension = Ogre::Vector3(0,1,0),const Ogre::Vector3 &axle = Ogre::Vector3(1,0,0));
     127        dJoint *createHinge(Ogre::SceneNode *n1,Ogre::SceneNode *n2,const Ogre::Vector3 &axis = Ogre::Vector3(1,0,0));
     128        dJoint *createSlider(Ogre::SceneNode *n1,Ogre::SceneNode *n2,const Ogre::Vector3 &axis = Ogre::Vector3(0,1,0));
     129        dJoint *createBall(Ogre::SceneNode *n1,Ogre::SceneNode *n2);
    126130#ifdef INCLUDE_PLANE2D_JOINT
    127         dJoint *createPlane2D(SceneNode *n);
     131        dJoint *createPlane2D(Ogre::SceneNode *n);
    128132#endif
    129133
    130134        // Apply forces to a body under our control
    131         void addTorque(SceneNode *n,const Vector3 &force);
     135        void addTorque(Ogre::SceneNode *n,const Ogre::Vector3 &force);
    132136
    133137        // Set the parameters used for the CFM/ERP joint parameters
    134         void setSuspension(Real spring,Real damper);
     138        void setSuspension(Ogre::Real spring,Ogre::Real damper);
    135139
    136140        // Set the acceleration due to gravity
    137         void setGravity(Real g);
     141        void setGravity(Ogre::Real g);
    138142
    139143        // Get our constants
    140         Real getTyre(void){return k_tyre;};
    141         Real getMu(void){return k_mu;};
    142         Real getCFM(void){return k_cfm;};
    143         Real getERP(void){return k_erp;};
     144        Ogre::Real getTyre(void){return k_tyre;};
     145        Ogre::Real getMu(void){return k_mu;};
     146        Ogre::Real getCFM(void){return k_cfm;};
     147        Ogre::Real getERP(void){return k_erp;};
    144148
    145149        // Static function for ODE to call when collisions (potentially) occur
Note: See TracChangeset for help on using the changeset viewer.