Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | Related Pages

Gravity.h

00001 /*************************************************************************** 00002 * This file is part of OpenCAL: Open Computer Animation Library * 00003 * I created OpenCAL as my master's thesis Computer Science (multimedia) * 00004 * at the tUL university in Diepenbeek, Belgium * 00005 * * 00006 * Copyright (C) 2003-2004 by Jeroen Dierckx * 00007 * jeroen.dierckx@student.luc.ac.be * 00008 * * 00009 ***************************************************************************/ 00010 00011 #ifndef OPENCAL_GRAVITY_H 00012 #define OPENCAL_GRAVITY_H 00013 00014 // Includes 00015 #include <OpenCAL/global.h> 00016 #include <OpenCAL/Force.h> 00017 00018 #include <OpenCAL/Vector3.h> 00019 using OpenCAL::Utils::Vector3; 00020 00021 00022 namespace OpenCAL 00023 { 00024 // Forward declarations 00025 class PhysicsSystem; 00026 00030 class OPENCAL_API Gravity: public Force 00031 { 00032 protected: 00033 // Member variables 00034 Vector3 m_gravity; 00035 00036 public: 00037 // Constructors and destructor 00038 Gravity(PhysicsSystem *parent, const Vector3 &gravity = Vector3(0.0f, -9.81f, 0.0f)); 00039 Gravity(PhysicsSystem *parent, float downGravity); 00040 virtual ~Gravity(); 00041 00042 // Get functions 00043 const Vector3 &getGravity() const { return m_gravity; } 00044 float getDownGravity() const { return -m_gravity.getY(); } 00045 00046 // Set functions 00047 void setGravity(const Vector3 &gravity) { m_gravity = gravity; } 00048 void setGravity(float downGravity) { m_gravity = Vector3(0, -downGravity, 0); } 00049 00050 // Other functions 00051 void execute(float seconds); 00052 }; 00053 } 00054 00055 #endif // OPENCAL_GRAVITY_H

Generated on Sun Aug 15 19:19:22 2004 for OpenCAL: Open Computer Animation Library by doxygen 1.3.8