AbstractMesh::AbstractMesh(const int primitive, bool owner, const Vector3D& center, IFloatBuffer* vertices, float lineWidth, float pointSize, const Color* flatColor, IFloatBuffer* colors, const float colorsIntensity, bool depthTest, IFloatBuffer* normals) : _primitive(primitive), _owner(owner), _vertices(vertices), _flatColor(flatColor), _colors(colors), _colorsIntensity(colorsIntensity), _boundingVolume(NULL), _center(center), _translationMatrix(( center.isNan() || center.isZero() ) ? NULL : new MutableMatrix44D(MutableMatrix44D::createTranslationMatrix(center)) ), _lineWidth(lineWidth), _pointSize(pointSize), _depthTest(depthTest), _glState(new GLState()), _normals(normals) { createGLState(); }
FlatColorMesh(Mesh* mesh, bool ownedMesh, Color* color, bool ownedColor) : _mesh(mesh), _ownedMesh(ownedMesh), _flatColor(color), _ownedColor(ownedColor), _glState(new GLState()) { createGLState(); }
void BusyMeshRenderer::render(const G3MRenderContext* rc, GLState* glState) { GL* gl = rc->getGL(); createGLState(); gl->clearScreen(*_backgroundColor); Mesh* mesh = getMesh(rc); if (mesh != NULL) { mesh->render(rc, _glState); } }