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

PhysicalObject.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_PHYSICALOBJECT_H 00012 #define OPENCAL_PHYSICALOBJECT_H 00013 00014 // Includes 00015 #include <OpenCAL/global.h> 00016 #include <OpenCAL/Object.h> 00017 #include <OpenCAL/Physical.h> 00018 00019 namespace OpenCAL 00020 { 00021 // Forward declarations 00022 class PhaseSpace; 00023 00028 class OPENCAL_API PhysicalObject: public Object, public Physical 00029 { 00030 protected: 00031 // Member variables 00032 00033 public: 00034 // Destructor 00035 virtual ~PhysicalObject(); 00036 00037 // Get functions 00038 00039 // Set functions 00040 00041 // Other functions 00042 virtual void disable() { m_velocity = m_force = Vector3::zero; m_enabled = false; } 00043 void fix() { disable(); } 00044 void unfix() { m_enabled = true; } 00045 bool isFixed() const { return !m_enabled; } 00046 00047 // State functions 00048 virtual void addToState(PhaseSpace *state) = 0; 00049 virtual void addToDerivative(PhaseSpace *deriv) = 0; 00050 virtual void fromState(PhaseSpace *state) = 0; 00051 00052 protected: 00053 // Constructors 00054 // protected, so no instance of this base class can be made 00055 PhysicalObject(System *parent, float mass = 1.0); 00056 }; 00057 } 00058 00059 #endif // OPENCAL_PHYSICALOBJECT_H

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