#include <Model.h>
Inheritance diagram for Teddy::Models::Model:
Public Methods | |
Model (std::string name, Model *shape=NULL) | |
Create new Model. More... | |
Teddy::Maths::Matrix | getLocalToWorldMatrix () const |
Teddy::Maths::Matrix | getWorldToLocalMatrix () const |
Teddy::Maths::Matrix | getViewMatrix () const |
Teddy::Maths::Matrix | getModelMatrix (Model *camera) const |
Teddy::Maths::Matrix | getScaledModelMatrix (Model *camera) const |
void | doMaterial (Teddy::PhysicalComponents::Projection *p, Model *parent=NULL) |
Apply Model material. More... | |
virtual void | draw (Teddy::PhysicalComponents::Projection *p, Model *parent=NULL) |
Drawing the instance. More... | |
list< Model * > & | getChildren () |
void | add (Model *child) |
Add child Model. More... | |
void | remove (Model *child) |
Remove child Model. More... | |
Geometry * | getGeometry () const |
void | setGeometry (Geometry *g) |
virtual Teddy::Materials::Material * | getMaterial () const |
Return the effective material used for this Model. More... | |
void | setMaterial (Teddy::Materials::Material *m, bool recursive=false) |
Set Model Material. More... | |
void | applyMaterial (const Teddy::PhysicalComponents::Projection &p, Teddy::Materials::Material *material) |
void | setClipRadius (const double clip_radius) |
void | setupClipRadius () |
double | getClipRadius () const |
void | add (Element *e) |
Insert Element to Model. More... | |
void | addTri (Vertex *a, Vertex *b, Vertex *c) |
void | addQuad (Vertex *a, Vertex *b, Vertex *c, Vertex *d) |
void | addPenta (Vertex *a, Vertex *b, Vertex *c, Vertex *d, Vertex *e) |
void | addHexa (Vertex *a, Vertex *b, Vertex *c, Vertex *d, Vertex *e, Vertex *f) |
void | addOcta (Vertex *a, Vertex *b, Vertex *c, Vertex *d, Vertex *e, Vertex *f, Vertex *g, Vertex *h) |
void | transformVertices (const Teddy::Maths::Matrix &m) |
void | transformVertices (const Teddy::Maths::Matrix &m, const Teddy::Maths::Matrix &normal_matrix, const bool reverse) |
void | clearTraversal () |
void | truncate () |
Teddy::Maths::Quaternion & | getAttitude () |
void | copyAttitude (const Model &other) |
Copy orientation (attitude) from other Model. More... | |
Teddy::Maths::TVector< double > | vectorTo (const Model &other) const |
Return vector to other Model. More... | |
double | distanceTo (const Model &other) const |
Return distance to another Model. More... | |
double | distanceTo (const Teddy::Maths::TVector< double > &pos) const |
void | setPosition (const double x, const double y, const double z) |
void | setPosition (const Teddy::Maths::TVector< double > &v) |
Teddy::Maths::TVector< double > | getPosition () const |
Get position relative to parent. More... | |
void | transform (const Teddy::Maths::Matrix &m) |
void | translate (const Teddy::Maths::TVector< double > &v) |
void | roll (const double radians) |
Concatenate roll. More... | |
void | pitch (const double radians) |
Concatenate pitch. More... | |
void | heading (const double radians) |
Concatenate heading. More... | |
void | foward (const double l) |
Move Model foward. More... | |
Static Public Attributes | |
const unsigned long | OPT_VISIBLE = (1ul<<1ul) |
const unsigned long | OPT_RECURS_MATERIAL = (1ul<<2ul) |
Protected Attributes | |
Teddy::Maths::Quaternion | attitude |
Attitude (orientation). More... | |
Teddy::Maths::TVector< double > | position |
Position (location). More... | |
double | clip_radius |
For view volume clipping. More... | |
list< Model * > | children |
Hierarchial. More... | |
Geometry * | geometry |
Geometry. More... | |
Teddy::Materials::Material * | material |
Material property for this Model. More... | |
Static Protected Attributes | |
Teddy::Materials::Material * | default_material |
Definition at line 61 of file Model.h.
|
Create new Model.
Definition at line 52 of file Model.cpp. References add, and setClipRadius. Referenced by Teddy::Imports::LWLayer::faceList, Teddy::Imports::LWLayer::polygonTags_ID4_d, Teddy::Imports::LWLayer::processLayer, setupClipRadius, and Teddy::Imports::LWLayer::surfaceList. |
|
Definition at line 79 of file Model.cpp. References geometry. |
|
|
Definition at line 256 of file Model.cpp. References add. Referenced by Teddy::Models::TruncatedOctahedron::TruncatedOctahedron. |
|
Definition at line 269 of file Model.cpp. References add. Referenced by Teddy::Models::TruncatedCube::TruncatedCube. |
|
Definition at line 244 of file Model.cpp. References add. Referenced by Teddy::Models::Dodecahedron::Dodecahedron. |
|
Definition at line 233 of file Model.cpp. References add. Referenced by Teddy::Models::Cube::Cube, Teddy::Models::Cuboctahedron::Cuboctahedron, Teddy::Models::TruncatedCuboctahedron::TruncatedCuboctahedron, and Teddy::Models::TruncatedOctahedron::TruncatedOctahedron. |
|
Definition at line 223 of file Model.cpp. References add. Referenced by Teddy::Models::Cuboctahedron::Cuboctahedron, Teddy::Models::Icosahedron::Icosahedron, Teddy::Models::Octahedron::Octahedron, Teddy::Models::Tetrahedron::Tetrahedron, Teddy::Models::TruncatedCube::TruncatedCube, and Teddy::Models::TruncatedCuboctahedron::TruncatedCuboctahedron. |
|
|
|
|
|
Copy orientation (attitude) from other Model.
Definition at line 106 of file ModelTransform.cpp. References attitude. |
|
|
|
Return distance to another Model.
Definition at line 78 of file ModelTransform.cpp. References Teddy::Maths::TVector< double >::distance, and position. |
|
Apply Model material.
Definition at line 43 of file ModelDraw.cpp. References material. Referenced by draw. |
|
Drawing the instance.
Definition at line 57 of file ModelDraw.cpp. References children, doMaterial, geometry, getLocalToWorldMatrix, Teddy::MixIn::Options::isEnabled, material, and OPT_VISIBLE. |
|
Move Model foward.
Definition at line 156 of file ModelTransform.cpp. References attitude, Teddy::Maths::Quaternion::getViewAxis, and translate. |
|
Definition at line 42 of file ModelTransform.cpp. References attitude. Referenced by Teddy::Materials::Light::applyLight. |
|
Definition at line 218 of file Model.cpp. References children. |
|
Definition at line 203 of file Model.cpp. References clip_radius. Referenced by Teddy::Imports::LWModel::layer_U2_U2_S0, and Teddy::Imports::LWModel::layer_U2_U2_VEC12_S0_U2. |
|
Definition at line 213 of file Model.cpp. References geometry. |
|
Simple transformation matrix from local coordinates to world coordinates. No tricks. localToWolrd() is usually used for model matrices. Definition at line 56 of file ModelMatrices.cpp. References attitude, and position. Referenced by draw. |
|
Return the effective material used for this Model.
Definition at line 100 of file Model.cpp. References material. |
|
Return model matrix, which works by applying camera positioning into objects' model matrices Definition at line 84 of file ModelMatrices.cpp. References attitude, and position. Referenced by getScaledModelMatrix. |
|
Get position relative to parent.
Definition at line 54 of file ModelTransform.cpp. References position. Referenced by Teddy::Materials::Light::applyLight. |
|
Definition at line 97 of file ModelMatrices.cpp. References getModelMatrix, Teddy::Maths::TVector< double >::magnitude, position, and Vector. |
|
Camera matrix which only contains rotations; translations are expexted to be applied into objects' model matrices instead. Definition at line 70 of file ModelMatrices.cpp. References attitude. |
|
Simple transformation matrix from world coordinates to local coordinates. No tricks. worldToLocal() is usually used for camera matrices. Definition at line 39 of file ModelMatrices.cpp. References attitude, position, and Teddy::Maths::TVector< double >::v. Referenced by Teddy::Scenes::Camera::doCamera. |
|
Concatenate heading.
Definition at line 144 of file ModelTransform.cpp. References attitude, Teddy::Maths::Quaternion::getUpAxis, and Teddy::Maths::Quaternion::rotate. Referenced by Teddy::Behaviour::ModelAnimator::tick. |
|
Concatenate pitch.
Definition at line 133 of file ModelTransform.cpp. References attitude, Teddy::Maths::Quaternion::getRightAxis, and Teddy::Maths::Quaternion::rotate. Referenced by Teddy::Behaviour::ModelAnimator::tick. |
|
Remove child Model.
Definition at line 88 of file Model.cpp. References children. |
|
Concatenate roll.
Definition at line 122 of file ModelTransform.cpp. References attitude, Teddy::Maths::Quaternion::getViewAxis, and Teddy::Maths::Quaternion::rotate. Referenced by Teddy::Behaviour::ModelAnimator::tick. |
|
Definition at line 198 of file Model.cpp. References clip_radius. Referenced by Teddy::Models::Grid::Grid, Teddy::Imports::LWModel::layer_U2_U2_S0, Teddy::Imports::LWModel::layer_U2_U2_VEC12_S0_U2, Model, Teddy::Models::Ring::Ring, and setupClipRadius. |
|
Definition at line 208 of file Model.cpp. References geometry. Referenced by Teddy::Models::Grid::Grid. |
|
Set Model Material.
Definition at line 109 of file Model.cpp. References children, and material. Referenced by Teddy::Imports::LWModel::LWModel. |
|
|
|
Definition at line 46 of file ModelTransform.cpp. References position, and Teddy::Maths::TVector< double >::v. |
|
|
|
|
|
|
|
|
Referenced by foward, and Teddy::Behaviour::ModelAnimator::tick. |
|
|
|
Return vector to other Model.
Definition at line 97 of file ModelTransform.cpp. References position. |
|
Attitude (orientation).
Definition at line 124 of file Model.h. Referenced by copyAttitude, foward, getAttitude, getLocalToWorldMatrix, getModelMatrix, getViewMatrix, getWorldToLocalMatrix, heading, pitch, and roll. |
|
Hierarchial.
Definition at line 127 of file Model.h. Referenced by add, clearTraversal, draw, getChildren, Teddy::Imports::LWLayer::processLayer, remove, setMaterial, and setupClipRadius. |
|
For view volume clipping.
Definition at line 126 of file Model.h. Referenced by getClipRadius, and setClipRadius. |
|
|
|
Definition at line 128 of file Model.h. Referenced by add, clearTraversal, draw, getGeometry, setGeometry, and setupClipRadius. |
|
Material property for this Model.
Definition at line 129 of file Model.h. Referenced by doMaterial, draw, getMaterial, and setMaterial. |
|
|
|
Definition at line 43 of file Model.cpp. Referenced by draw. |
|
Position (location).
Definition at line 125 of file Model.h. Referenced by distanceTo, getLocalToWorldMatrix, getModelMatrix, getPosition, getScaledModelMatrix, getWorldToLocalMatrix, setPosition, and vectorTo. |