#include <Element.h>
Inheritance diagram for Teddy::Models::Element:
Public Methods | |
Element (unsigned long options=0) | |
virtual | ~Element () |
Element destructor. More... | |
virtual void | draw (Projection *p)=0 |
virtual void | debug () |
Debugging information. More... | |
virtual void | add (const float x, const float y, const float z) |
Insert a vertex to the face, component version. More... | |
virtual void | add (Vertex *v) |
Insert a vertex to the face, pointer version. More... | |
virtual void | append (const float x, const float y, const float z) |
Insert a vertex to the face - pointer version, reverse order. More... | |
virtual void | append (Vertex *v) |
Insert a vertex to the face - pointer version, reverse order. More... | |
virtual void | reverse () |
virtual bool | contains (const Vertex *v) const |
Return true if element contains spesified vertex. More... | |
virtual void | makeNormal () |
virtual void | makeConvexNormal () |
virtual void | smooth (float max_smoothing_angle) |
Default Element smooth - does not do anything. More... | |
void | setNormal (const Vector &normal) |
Set element normal. More... | |
void | setNormal (const float x, const float y, const float z) |
const Vector & | getNormal () const |
Set element normal. More... | |
virtual double | getMaxVector () const |
void | clearTraversal () |
Default Element add to collision model - does not do anything. More... | |
virtual void | transformVertices (const Matrix &m, const Matrix &normal_matrix, const bool reverse) |
Transform all element vertices. More... | |
Public Attributes | |
list< Vertex * > | vertices |
Static Public Attributes | |
const unsigned long | EL_HAS_ELEMENT_NORMAL = (1L<< 0L) |
const unsigned long | EL_USE_ELEMENT_NORMAL = (1L<< 1L) |
const unsigned long | EL_USE_VERTEX_NORMALS = (1L<< 2L) |
const unsigned long | VX_HAS_PARENT = (1L<< 3L) |
const unsigned long | VX_HAS_VERTEX = (1L<< 4L) |
const unsigned long | VX_HAS_NORMAL = (1L<< 5L) |
const unsigned long | VX_HAS_COLOR = (1L<< 6L) |
const unsigned long | VX_HAS_TEXTURE = (1L<< 7L) |
const unsigned long | VX_USE_THIS_VERTEX = (1L<< 8L) |
const unsigned long | VX_USE_THIS_NORMAL = (1L<< 9L) |
const unsigned long | VX_USE_THIS_COLOR = (1L<<10L) |
const unsigned long | VX_USE_THIS_TEXTURE = (1L<<11L) |
const unsigned long | VX_USE_PARENT_VERTEX = (1L<<12L) |
const unsigned long | VX_USE_PARENT_NORMAL = (1L<<13L) |
const unsigned long | VX_USE_PARENT_COLOR = (1L<<14L) |
const unsigned long | VX_USE_PARENT_TEXTURE = (1L<<15L) |
const unsigned long | VX_TRAVERSAL_VISITED = (1L<<16L) |
const unsigned long | VX_USE_PARENT_ALL |
Protected Attributes | |
Vector | normal |
Definition at line 61 of file Element.h.
|
Definition at line 70 of file Element.cpp. |
|
Element destructor.
Definition at line 79 of file Element.cpp. |
|
Insert a vertex to the face, pointer version.
Reimplemented in Teddy::Models::Face. Definition at line 89 of file Element.cpp. References vertices. |
|
Insert a vertex to the face, component version.
Reimplemented in Teddy::Models::Face. Definition at line 96 of file Element.cpp. References vertices. Referenced by Teddy::Models::Vertex::addNormal. |
|
Insert a vertex to the face - pointer version, reverse order.
Reimplemented in Teddy::Models::Face. Definition at line 104 of file Element.cpp. References vertices. |
|
Insert a vertex to the face - pointer version, reverse order.
Reimplemented in Teddy::Models::Face. Definition at line 111 of file Element.cpp. References vertices. |
|
Default Element add to collision model - does not do anything.
Definition at line 245 of file Element.cpp. References vertices, and VX_TRAVERSAL_VISITED. |
|
Return true if element contains spesified vertex.
Definition at line 136 of file Element.cpp. References vertices. |
|
Debugging information.
Reimplemented in Teddy::Models::Vertex. Definition at line 84 of file Element.cpp. |
|
Implemented in Teddy::Models::Face. |
|
Reimplemented in Teddy::Models::Vertex. Definition at line 255 of file Element.cpp. References vertices. |
|
Set element normal.
Definition at line 130 of file Element.cpp. References normal, and Vector. Referenced by Teddy::Models::Face::smooth. |
|
Definition at line 218 of file Element.cpp. References makeNormal, normal, reverse, Vector, and vertices. |
|
Calculate a normal for Element. This requires at least three vertices, and the vertices must not be on a single line. Reimplemented in Teddy::Models::QuadStrip. Definition at line 160 of file Element.cpp. References Teddy::SysSupport::dmsg, EL_HAS_ELEMENT_NORMAL, EL_USE_ELEMENT_NORMAL, Teddy::MixIn::Options::enable, Teddy::SysSupport::M_WARN, normal, Vector, and vertices. Referenced by makeConvexNormal, and Teddy::Models::Face::smooth. |
|
Reverse order of vertices in Face. Remember to update normal as well if needed - that is not done by this. Reimplemented in Teddy::Models::QuadStrip. Definition at line 150 of file Element.cpp. References vertices. Referenced by makeConvexNormal, and transformVertices. |
|
Reimplemented in Teddy::Models::Vertex. Definition at line 123 of file Element.cpp. References EL_HAS_ELEMENT_NORMAL, Teddy::MixIn::Options::enable, normal, and Vector. |
|
Set element normal.
Reimplemented in Teddy::Models::Vertex. Definition at line 119 of file Element.cpp. References EL_HAS_ELEMENT_NORMAL, Teddy::MixIn::Options::enable, normal, and Vector. |
|
Default Element smooth - does not do anything.
Reimplemented in Teddy::Models::Face. Definition at line 233 of file Element.cpp. |
|
Transform all element vertices.
Definition at line 273 of file Element.cpp. References EL_HAS_ELEMENT_NORMAL, Teddy::MixIn::Options::isEnabled, normal, reverse, vertices, and VX_TRAVERSAL_VISITED. |
|
|
|
Definition at line 42 of file Element.cpp. Referenced by Teddy::Models::Face::smooth. |
|
Reimplemented in Teddy::Models::Vertex. Definition at line 133 of file Element.h. Referenced by Teddy::Models::TriangleStrip::draw, Teddy::Models::TriangleFan::draw, Teddy::Models::QuadStrip::draw, Teddy::Models::Face::draw, getNormal, makeConvexNormal, Teddy::Models::TriangleStrip::makeNormal, Teddy::Models::TriangleFan::makeNormal, Teddy::Models::QuadStrip::makeNormal, makeNormal, setNormal, Teddy::Models::Face::smooth, and transformVertices. |
|
|
Definition at line 47 of file Element.cpp. Referenced by Teddy::Models::Vertex::applyColor, Teddy::Models::Vertex::debug, Teddy::Models::Vertex::getColor, and Teddy::Models::Vertex::setColor. |
|
Definition at line 46 of file Element.cpp. Referenced by Teddy::Models::Vertex::applyNormal, Teddy::Models::Vertex::debug, Teddy::Models::Vertex::getNormal, Teddy::Models::Vertex::normNormal, Teddy::Models::Vertex::setNormal, and Teddy::Models::Face::smooth. |
|
|
Definition at line 48 of file Element.cpp. Referenced by Teddy::Models::Vertex::applyTexture, Teddy::Models::Vertex::debug, Teddy::Models::Vertex::getTexture, and Teddy::Models::Vertex::setTexture. |
|
Definition at line 45 of file Element.cpp. Referenced by Teddy::Models::Vertex::applyVertex, Teddy::Models::Vertex::debug, Teddy::Models::Vertex::getVertex, and Teddy::Models::Vertex::setVertex. |
|
Definition at line 60 of file Element.cpp. Referenced by clearTraversal, and transformVertices. |
|
Initial value: Element::VX_USE_PARENT_VERTEX | Element::VX_USE_PARENT_NORMAL | Element::VX_USE_PARENT_COLOR | Element::VX_USE_PARENT_TEXTURE Definition at line 62 of file Element.cpp. |
|
Definition at line 57 of file Element.cpp. Referenced by Teddy::Models::Vertex::applyColor, Teddy::Models::Vertex::debug, Teddy::Models::Vertex::getColor, and Teddy::Models::Vertex::setColor. |
|
Definition at line 56 of file Element.cpp. Referenced by Teddy::Models::Vertex::applyNormal, Teddy::Models::Vertex::debug, Teddy::Models::Vertex::getNormal, Teddy::Models::Vertex::normNormal, and Teddy::Models::Vertex::setNormal. |
|
Definition at line 58 of file Element.cpp. Referenced by Teddy::Models::Vertex::applyTexture, Teddy::Models::Vertex::debug, Teddy::Models::Vertex::getTexture, and Teddy::Models::Vertex::setTexture. |
|
Definition at line 55 of file Element.cpp. Referenced by Teddy::Models::Vertex::applyVertex, Teddy::Models::Vertex::debug, Teddy::Models::Vertex::getVertex, and Teddy::Models::Vertex::setVertex. |
|
Definition at line 52 of file Element.cpp. Referenced by Teddy::Models::Vertex::applyColor, Teddy::Models::Vertex::debug, Teddy::Models::Vertex::getColor, and Teddy::Models::Vertex::setColor. |
|
Definition at line 51 of file Element.cpp. Referenced by Teddy::Models::Vertex::applyNormal, Teddy::Models::Vertex::debug, Teddy::Models::Vertex::getNormal, Teddy::Models::Vertex::normNormal, and Teddy::Models::Vertex::setNormal. |
|
Definition at line 53 of file Element.cpp. Referenced by Teddy::Models::Vertex::applyTexture, Teddy::Models::Vertex::debug, Teddy::Models::Vertex::getTexture, and Teddy::Models::Vertex::setTexture. |
|
Definition at line 50 of file Element.cpp. Referenced by Teddy::Models::Vertex::applyVertex, Teddy::Models::Vertex::debug, Teddy::Models::Vertex::getVertex, and Teddy::Models::Vertex::setVertex. |