ScreenFPS.h

Go to the documentation of this file.
00001 #ifndef _SCREEN_FPS_H
00002 #define _SCREEN_FPS_H
00003 
00004 #include "ScreenOutdoors.h"
00005 #include "MercuryLight.h"
00006 #include "MercuryODE.h"
00007 #include "MercuryCamera.h"
00008 #include "ODEProjectile.h"
00009 #include "MercuryLoadableModel.h"
00010 
00011 class ScreenFPS : public ScreenOutdoors
00012 {
00013 public:
00014     ScreenFPS( ) { }
00015     ScreenFPS( const MString & name ):ScreenOutdoors( name ) { m_name = name; }
00016     virtual ~ScreenFPS();
00017 
00018     virtual void Init();
00019     virtual void Update( const float dTime );
00020     virtual void Message( int Message, PStack & data, const MString &name );
00021     virtual bool Command( PStack & ret, const char * command, PStack & args );
00022     CLASS_RTTI( ScreenFPS, ScreenOutdoors );
00023 private:
00024     void CalculateLook(int x, int y, MercuryODEObject* control);
00025     void TweenCamera(int x, int y, MercuryODEObject* control);
00026     void CalculateMovement(MercuryODEObject* control);
00027     void PlayRobotAnimations(int dx);
00028     void ObjectHit(const MercuryPoint& position, dBodyID id, const MercuryPoint& ray);
00029 
00030     MercuryINI          m_pINI;
00031     MercuryLoadableModel m_pPlayer;
00032     MercuryODEWorld     m_pWorld;
00033     MercuryCamera       m_fCamera;
00034     MercuryPoint        pTarget;    //Where the robot is pointing relative to itself
00035     MercuryPoint        m_pGun;
00036     Projectile          pBullet;
00037 
00038     MercurySprite       m_sprCrosshairsCenter;
00039     MercurySprite       m_sprCrosshairs;
00040     VirtualProjectile   m_Aimer;
00041     bool                m_interactable;
00042     bool                m_oldInter;
00043     float               fClosestAimerObject;
00044     MercuryPoint        m_aimPos;
00045 
00046     float               m_closestHitObjectDistance;
00047     dBodyID             m_closestHitObject;
00048     MercuryPoint        m_closestHitPosition;
00049     MercuryPoint        m_closestHitRay;
00050     bool                m_runObjectHitCode;
00051 
00052 
00053 
00054     Projectile          pPhysics;
00055     int                 iPhysicsObject;
00056     float               fClosestPhysicsObject;
00057 
00058     MercuryPoint        pLookAt;
00059     bool                m_bFirstUpdate;
00060     int                 m_iSlidingF;
00061     float               m_fTimeSinceLastShot;
00062     
00063     float               m_fForwardMovement;
00064     MVector< MercuryLoadableModel::LoadableModelAnimationInfo > pTweenCommands;
00065 
00066     bool                m_bFPS;
00067 
00068     bool m_fistExplosion;
00069     bool m_donefirst;
00070 
00071     float m_slowDown;
00072 };
00073 
00074 #endif
00075 
00076 /* 
00077  * Copyright (c) 2006, Charles Lohr
00078  * All rights reserved.
00079  *
00080  * Redistribution and use in source and binary forms, with or
00081  * without modification, are permitted provided that the following
00082  * conditions are met:
00083  *  -   Redistributions of source code must retain the above
00084  *      copyright notice, this list of conditions and the following disclaimer.
00085  *  -   Redistributions in binary form must reproduce the above copyright
00086  *      notice, this list of conditions and the following disclaimer in
00087  *      the documentation and/or other materials provided with the distribution.
00088  *  -   Neither the name of the Mercury Engine nor the names of its
00089  *      contributors may be used to endorse or promote products derived from
00090  *      this software without specific prior written permission.
00091  *
00092  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
00093  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00094  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
00095  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
00096  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
00097  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
00098  * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
00099  * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
00100  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
00101  * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00102  */

Hosted by SourceForge.net Logo