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

OpenCAL::Cloth Class Reference

#include <Cloth.h>

Inheritance diagram for OpenCAL::Cloth:

Inheritance graph
[legend]
Collaboration diagram for OpenCAL::Cloth:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 Cloth (System *parent, const Vector3 &position, float width, float height)
virtual ~Cloth ()
PointMassgetPoint (unsigned int row, unsigned int col)
const PointMassgetPoint (unsigned int row, unsigned int col) const
PointMassgetCorner1 ()
PointMassgetCorner2 ()
PointMassgetCorner3 ()
PointMassgetCorner4 ()
virtual void render ()

Protected Member Functions

void constructCloth (const Vector3 &position, float width, float height)

Protected Attributes

unsigned int m_rows
unsigned int m_columns
unsigned int m_structuralSprings
unsigned int m_shearSprings
unsigned int m_bendSprings

Detailed Description

This mass spring system simulates a rectangular cloth, using three types of springs to connect the grid of point masses: Structural, shear and bend springs.

Todo:

Definition at line 35 of file Cloth.h.


Constructor & Destructor Documentation

Cloth::Cloth System parent,
const Vector3 position,
float  width,
float  height
 

This constructors creates a horizontal rectangular piece of cloth, at a certain position, and with a certain width and height Definition at line 36 of file Cloth.cpp.

References constructCloth().

Here is the call graph for this function:

Cloth::~Cloth  )  [virtual]
 

This constructors creates a rectangular piece of cloth, within the rectangle starting at from, and ending in to. Definition at line 54 of file Cloth.cpp.


Member Function Documentation

void Cloth::constructCloth const Vector3 position,
float  width,
float  height
[protected]
 

Todo:
  • Allow the cloth to tear (with the spring's snapfactor) -> not easy, with the triangle mesh and all...
Definition at line 108 of file Cloth.cpp.

References OpenCAL::TriangleMesh::addTriangle(), OpenCAL::TriangleMesh::addVertex(), OpenCAL::Triangle::calculateNormal(), OpenCAL::Object::disableDraw(), OpenCAL::TriangleMesh::getVertex(), OpenCAL::Spring::setDamping(), OpenCAL::Object::setPosition(), OpenCAL::Spring::setSnapFactor(), OpenCAL::Spring::setStiffness(), and OpenCAL::Vertex::setTexturePos().

Referenced by Cloth().

Here is the call graph for this function:

void Cloth::render  )  [virtual]
 

Todo:
Spring get functions

Reimplemented from OpenCAL::MassSpringSystem.

Definition at line 68 of file Cloth.cpp.

References OpenCAL::TriangleMesh::calculateVertexNormals(), OpenCAL::System::getRenderer(), OpenCAL::TriangleMesh::invalidateTriangleNormals(), and OpenCAL::Renderer::renderMesh().

Here is the call graph for this function:


The documentation for this class was generated from the following files:
Generated on Sun Aug 15 19:19:31 2004 for OpenCAL: Open Computer Animation Library by doxygen 1.3.8