Example #1
0
        void EntityRenderer::writeColoredBounds(RenderContext& context, const Model::EntityList& entities) {
            if (entities.empty())
                return;

            Preferences::PreferenceManager& prefs = Preferences::PreferenceManager::preferences();
            Vec3f::List vertices(24);

            for (unsigned int i = 0; i < entities.size(); i++) {
                Model::Entity* entity = entities[i];
                const BBoxf& bounds = entity->bounds();
                const Model::EntityDefinition* definition = entity->definition();
                Color entityColor;
                if (definition != NULL) {
                    entityColor = definition->color();
                    entityColor[3] = prefs.getColor(Preferences::EntityBoundsColor).a();
                } else {
                    entityColor = prefs.getColor(Preferences::EntityBoundsColor);
                }

                bounds.vertices(vertices);
                for (unsigned int j = 0; j < vertices.size(); j++) {
                    m_boundsVertexArray->addAttribute(vertices[j]);
                    m_boundsVertexArray->addAttribute(entityColor);
                }
            }
        }
Example #2
0
        void EntityRenderer::writeBounds(RenderContext& context, const Model::EntityList& entities) {
            if (entities.empty())
                return;

            Vec3f::List vertices(24);
            for (unsigned int i = 0; i < entities.size(); i++) {
                Model::Entity* entity = entities[i];
                const BBoxf& bounds = entity->bounds();
                bounds.vertices(vertices);

                for (unsigned int j = 0; j < vertices.size(); j++)
                    m_boundsVertexArray->addAttribute(vertices[j]);
            }
        }