C:/Users/Mike/Documents/Visual Studio Projects/GameEngine/include/PhysicsComponent.h

Go to the documentation of this file.
00001 /*
00002 -----------------------------------------------------------------------------
00003 Copyright (C) 2006 Michael Harnetty
00004 
00005 This program is free software; you can redistribute it and/or
00006 modify it under the terms of the GNU General Public License
00007 as published by the Free Software Foundation; either version 2
00008 of the License, or (at your option) any later version.
00009 
00010 This program is distributed in the hope that it will be useful,
00011 but WITHOUT ANY WARRANTY; without even the implied warranty of
00012 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013 GNU General Public License for more details.
00014 
00015 You should have received a copy of the GNU General Public License
00016 along with this program; if not, write to the Free Software
00017 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
00018 -----------------------------------------------------------------------------
00019 */
00020 
00021 #ifndef PHYSICAL_OBJECT_H
00022 #define PHYSICAL_OBJECT_H
00023 
00024 #include "GameEnginePrerequisites.h"
00025 #include "GameObjectComponent.h"
00026 #include "PhysicsManager.h"
00027 
00028 namespace GameEngine {
00029 
00032         class ENGINE_DECL PhysicsComponent : public GameObjectComponent 
00033         {
00034         public:
00039                 PhysicsComponent(       PhysicsManager* physicsManager );
00040 
00051                 PhysicsComponent(       PhysicsManager* physicsManager,
00052                                                         Vector3 initialPos,
00053                                                         Quaternion initialOri,
00054                                                         Vector3 initialLinVel,
00055                                                         Vector3 initialAngVel,
00056                                                         Vector3 initialLinAcc,
00057                                                         Vector3 initialAngAc
00058                                                 );
00059                                                 
00062                 virtual ~PhysicsComponent();
00063 
00064                 
00065                 
00070                 Vector3 getPosition() { return Vector3::vecFromOpal( mPhysicsEntity->getPosition() ); }
00071                 
00076                 Quaternion getOrientation() { return  Quaternion::quatFromOpal( mPhysicsEntity->getQuaternion() ); }
00077                 
00082                 Vector3 getLinearVelocity() { return Vector3::vecFromOpal( mPhysicsEntity->getLocalLinearVel() ); }
00083                 
00084                 // Note to self: Need to add functions for angular velocity etc
00085 
00090                 PhysicsManager* getPhysicsManager() { return mPhysicsManager; }
00091 
00092         protected:
00093                 PhysicsManager* mPhysicsManager;
00094                 opal::Solid* mPhysicsEntity;
00095 
00096                 Quaternion mInitialOri;
00097                 Vector3 mInitialPos, mInitialLinVel, mInitialAngVel, mInitialLinAcc, mInitialAngAc;
00098 
00099         };
00100 
00101 }
00102 
00103 #endif

Generated on Thu Apr 19 09:47:02 2007 for GameEngine by  doxygen 1.5.2