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

OpenCAL::JellyBeam Class Reference

#include <JellyBeam.h>

Inheritance diagram for OpenCAL::JellyBeam:

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

Collaboration graph
[legend]
List of all members.

Public Member Functions

 JellyBeam (System *parent, const Vector3 &from, const Vector3 &to)
virtual void render ()

Protected Member Functions

void constructBeam (const Vector3 &from, const Vector3 &to)

Detailed Description

This mass spring systems simulates a "jelly beam", a non-solid cube.

Definition at line 28 of file JellyBeam.h.


Member Function Documentation

void JellyBeam::constructBeam const Vector3 from,
const Vector3 to
[protected]
 

This functions constructs the jelly beam. The beam consists of 8 point masses (the corners), connected by 28 springs (straight springs, diagonal springs and internal springs)

4----------5
/| /|
(from) 0----------1 |
| 6--------|-7 (to)
|/ |/
2----------3

Definition at line 107 of file JellyBeam.cpp.

References OpenCAL::TriangleMesh::addMaterial(), OpenCAL::TriangleMesh::addTriangle(), OpenCAL::TriangleMesh::addVertex(), OpenCAL::Triangle::calculateNormal(), OpenCAL::TriangleMesh::getVertex(), OpenCAL::Utils::Vector3::getX(), OpenCAL::Utils::Vector3::getY(), OpenCAL::Utils::Vector3::getZ(), OpenCAL::Utils::Material::setAmbient(), OpenCAL::Spring::setDamping(), OpenCAL::Utils::Material::setDiffuse(), OpenCAL::Object::setDraw(), OpenCAL::Triangle::setMaterial(), OpenCAL::Object::setPosition(), and OpenCAL::Spring::setStiffness().

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:32 2004 for OpenCAL: Open Computer Animation Library by doxygen 1.3.8