C:/Users/Mike/Documents/Visual Studio Projects/GameEngine/src/PhysicsComponent.cpp

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 #include "PhysicsComponent.h"
00022 
00023 namespace GameEngine {
00024         
00025 
00026         PhysicsComponent::PhysicsComponent(     PhysicsManager* physicsManager) 
00027                                                                                         :       mPhysicsManager(physicsManager),
00028                                                                                                 mInitialPos(0,0,0),
00029                                                                                                 mInitialOri(1,0,0,0),
00030                                                                                                 mInitialLinVel(0,0,0),
00031                                                                                                 mInitialAngVel(0,0,0),
00032                                                                                                 mInitialLinAcc(0,0,0),
00033                                                                                                 mInitialAngAc(0,0,0)
00034         {
00035 
00036         }
00037 
00038 
00039         PhysicsComponent::PhysicsComponent(     PhysicsManager* physicsManager,
00040                                                                                 Vector3 initialPos,
00041                                                                                 Quaternion initialOri,
00042                                                                                 Vector3 initialLinVel,
00043                                                                                 Vector3 initialAngVel,
00044                                                                                 Vector3 initialLinAcc,
00045                                                                                 Vector3 initialAngAc
00046                                                                                 )
00047                                                                                         :       mPhysicsManager(physicsManager),
00048                                                                                                 mInitialPos(initialPos),
00049                                                                                                 mInitialOri(initialOri),
00050                                                                                                 mInitialLinVel(initialLinVel),
00051                                                                                                 mInitialAngVel(initialAngVel),
00052                                                                                                 mInitialLinAcc(initialLinAcc),
00053                                                                                                 mInitialAngAc(initialAngAc)
00054         {
00055 
00056         }
00057 
00058         PhysicsComponent::~PhysicsComponent()
00059         {
00060                 if(mPhysicsEntity){
00061                         mPhysicsManager->mPhysicsSim->destroySolid(mPhysicsEntity);
00062                         mPhysicsEntity = NULL;
00063                 }
00064         }
00065 
00066 }

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