Ignore:
Timestamp:
08/13/06 01:44:15 (18 years ago)
Author:
szydlowski
Message:

improvements on demo mode, added command line parsing for easy benchmark scripting scripting,
so far only load/store demo from/to file

Location:
GTP/trunk/App/Demos/Vis/KdTreeDemo/OGRE/include
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • GTP/trunk/App/Demos/Vis/KdTreeDemo/OGRE/include/TestKdTree.h

    r1200 r1202  
    2727public: 
    2828 
    29         KdTreeApp()     { mFrameListener = 0; } 
     29        KdTreeApp()      
     30        {  
     31                mFrameListener = 0;  
     32                mRenderTargerListener = 0; 
     33        } 
     34 
     35        KdTreeApp(const String& infile, const String& outfile)   
     36        {  
     37                mFrameListener = 0;  
     38                mRenderTargerListener = 0; 
     39                mDemoInfileName = infile; 
     40                mDemoOutfileName = outfile; 
     41        } 
    3042 
    3143        ~KdTreeApp() 
     
    5668        int             mSelectEntities; 
    5769 
     70        String mDemoInfileName; 
     71        String mDemoOutfileName; 
     72 
    5873        virtual void setupResources(void); 
    5974 
     
    7186    virtual bool configure(void); 
    7287 
     88        /** load scene from file **/ 
    7389        bool loadScene(const String& filename); 
    7490        bool loadSceneIV(const String &filename, SceneNode *root, const int index); 
     91 
     92        void createMaterials(void); 
    7593private: 
    76         void createMaterials(void); 
    7794        std::string cat(std::string name, int x, int z) 
    7895        { 
  • GTP/trunk/App/Demos/Vis/KdTreeDemo/OGRE/include/TestKdTreeAppListener.h

    r1200 r1202  
    4646using namespace Ogre; 
    4747 
     48struct FrameInfo 
     49{ 
     50        FrameInfo(Vector3 pos, Quaternion or, Real time): 
     51        mPosition(pos), mOrientation(or), mElapsedTime(time) 
     52        { } 
     53 
     54        Vector3 mPosition; 
     55        Quaternion mOrientation; 
     56        Real    mElapsedTime; 
     57}; 
     58 
     59typedef std::list<FrameInfo> FrameList; 
     60 
    4861class KdTreeAppListener: public FrameListener, public KeyListener 
    4962{ 
     
    110123 
    111124        // stuff for walkthrough recording/playback 
    112         struct FrameInfo 
    113         { 
    114                 FrameInfo(Vector3 pos, Quaternion or, Real time): 
    115                 mPosition(pos), mOrientation(or), mElapsedTime(time) 
    116                 { } 
    117  
    118                 Vector3 mPosition; 
    119                 Quaternion mOrientation; 
    120                 Real    mElapsedTime; 
    121         }; 
    122  
    123         typedef std::list<FrameInfo> FrameList; 
     125        String mDemoInfileName; 
     126        String mDemoOutfileName; 
    124127 
    125128        enum AppState 
     
    139142        OverlayElement * mDemoStatus; 
    140143 
     144        void setDemoOverlay(); 
     145 
    141146        void toggleRecord(); 
    142147        void togglePlayback(); 
    143 //      void resetPlayback(); 
    144148 
    145149        void saveFrameInfo(Real elapsedTime); 
    146  
    147         void setDemoOverlay(); 
    148  
    149         void saveFramesBinary(const String& filename); 
    150         void loadFramesBinary(const String& filename); 
     150         
     151        /** save demo frame data to file **/ 
     152        static void saveFrames(const String& filename, FrameList& framelist); 
     153        static void saveFramesAscii(const String& filename, FrameList& framelist); 
     154        static void saveFramesBinary(const String& filename, FrameList& framelist); 
     155 
     156        /** load demo frame data from file **/ 
     157        static void loadFrames(const String& filename, FrameList& framelist); 
     158        static void loadFramesAscii(const String& filename, FrameList& framelist); 
     159        static void loadFramesBinary(const String& filename, FrameList& framelist); 
     160 
    151161public: 
    152         void loadFrames(const String& filename); 
    153         void saveFrames(const String& filename); 
    154  
    155162        // visualization modes for scene nodes 
    156163        enum  
     
    163170 
    164171    // Constructor takes a RenderWindow because it uses that to determine input context 
    165     KdTreeAppListener(RenderWindow* win, SceneManager* sm, Real rs, Real ms, Real rp, 
     172    KdTreeAppListener(RenderWindow* win, SceneManager* sm, Real rs, Real ms, Real rp,  
     173                const String& infile, const String& outfile,  
    166174                bool useBufferedInputKeys = false, bool useBufferedInputMouse = false); 
    167175 
Note: See TracChangeset for help on using the changeset viewer.