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

Cloth.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_CLOTH_H 00012 #define OPENCAL_CLOTH_H 00013 00014 // Includes 00015 #include <OpenCAL/global.h> 00016 #include <OpenCAL/MassSpringSystem.h> 00017 00018 namespace OpenCAL 00019 { 00020 // Forward declarations 00021 namespace Utils { class Vector3; class Texture; } 00022 using Utils::Vector3; 00023 using Utils::Texture; 00024 00035 class OPENCAL_API Cloth: public MassSpringSystem 00036 { 00037 protected: 00038 // Member variables 00039 unsigned int m_rows, m_columns; 00040 unsigned int m_structuralSprings, m_shearSprings, m_bendSprings; 00041 00042 public: 00043 // Constructors and destructor 00044 Cloth(System *parent, const Vector3 &position, float width, float height); 00045 //Cloth(System *parent, const Vector3 &from, const Vector3 &to); 00046 virtual ~Cloth(); 00047 00048 // Get functions 00049 PointMass *getPoint(unsigned int row, unsigned int col) 00050 { return (PointMass *) m_objects[row * m_columns + col]; } 00051 const PointMass *getPoint(unsigned int row, unsigned int col) const 00052 { return (const PointMass *) m_objects[row * m_columns + col]; } 00053 PointMass *getCorner1() { return getPoint(0, 0); } 00054 PointMass *getCorner2() { return getPoint(0, m_columns - 1); } 00055 PointMass *getCorner3() { return getPoint(m_rows - 1, 0); } 00056 PointMass *getCorner4() { return getPoint(m_rows - 1, m_columns - 1); } 00057 00059 00060 // Set functions 00061 00062 // Other functions 00063 virtual void render(); 00064 /* 00065 #ifdef USE_OPENGL 00066 virtual void drawGL(); 00067 #endif // USE_OPENGL 00068 */ 00069 00070 protected: 00071 // Protected functions 00072 void constructCloth(const Vector3 &position, float width, float height); 00073 }; 00074 } 00075 00076 #endif // OPENCAL_CLOTH_H

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