Showing the changes to interface/src/MetavoxelSystem.cpp (1 of 14 files). Show all
Unified · Split
| @@ -37,8 +37,6 @@ REGISTER_META_OBJECT(SphereRenderer) · 36 unmodified lines | ||
| 37 | 37 | REGISTER_META_OBJECT(CuboidRenderer) |
| 38 | 38 | REGISTER_META_OBJECT(StaticModelRenderer) |
| 39 | 39 | |
| 40 | −static int bufferPointVectorMetaTypeId = qRegisterMetaType<BufferPointVector>(); | |
| 41 | − | |
| 42 | 40 | MetavoxelSystem::NetworkSimulation::NetworkSimulation(float dropRate, float repeatRate, |
| 43 | 41 | int minimumDelay, int maximumDelay, int bandwidthLimit) : |
| 44 | 42 | dropRate(dropRate), |
| @@ -59,8 +57,6 @@ void MetavoxelSystem::init() { · 14 unmodified lines | ||
| 59 | 57 | MetavoxelClientManager::init(); |
| 60 | 58 | DefaultMetavoxelRendererImplementation::init(); |
| 61 | 59 | |
| 62 | − _pointBufferAttribute = AttributeRegistry::getInstance()->registerAttribute(new BufferDataAttribute("pointBuffer")); | |
| 63 | − | |
| 64 | 60 | _heightfieldBufferAttribute = AttributeRegistry::getInstance()->registerAttribute( |
| 65 | 61 | new BufferDataAttribute("heightfieldBuffer")); |
| 66 | 62 | _heightfieldBufferAttribute->setLODThresholdMultiplier( |
| @@ -920,36 +916,6 @@ void MetavoxelSystemClient::sendDatagram(const QByteArray& data) { · 853 unmodified lines | ||
| 920 | 916 | BufferData::~BufferData() { |
| 921 | 917 | } |
| 922 | 918 | |
| 923 | −PointBuffer::PointBuffer(const BufferPointVector& points) : | |
| 924 | − _points(points) { | |
| 925 | −} | |
| 926 | − | |
| 927 | −void PointBuffer::render(bool cursor) { | |
| 928 | − // initialize buffer, etc. on first render | |
| 929 | − if (!_buffer.isCreated()) { | |
| 930 | − _buffer.setUsagePattern(QOpenGLBuffer::StaticDraw); | |
| 931 | − _buffer.create(); | |
| 932 | − _buffer.bind(); | |
| 933 | − _pointCount = _points.size(); | |
| 934 | − _buffer.allocate(_points.constData(), _pointCount * sizeof(BufferPoint)); | |
| 935 | − _points.clear(); | |
| 936 | − _buffer.release(); | |
| 937 | − } | |
| 938 | − if (_pointCount == 0) { | |
| 939 | − return; | |
| 940 | − } | |
| 941 | − _buffer.bind(); | |
| 942 | − | |
| 943 | − BufferPoint* point = 0; | |
| 944 | − glVertexPointer(4, GL_FLOAT, sizeof(BufferPoint), &point->vertex); | |
| 945 | − glColorPointer(3, GL_UNSIGNED_BYTE, sizeof(BufferPoint), &point->color); | |
| 946 | − glNormalPointer(GL_BYTE, sizeof(BufferPoint), &point->normal); | |
| 947 | − | |
| 948 | − glDrawArrays(GL_POINTS, 0, _pointCount); | |
| 949 | − | |
| 950 | − _buffer.release(); | |
| 951 | −} | |
| 952 | − | |
| 953 | 919 | const int HeightfieldBuffer::HEIGHT_BORDER = 1; |
| 954 | 920 | const int HeightfieldBuffer::SHARED_EDGE = 1; |
| 955 | 921 | const int HeightfieldBuffer::HEIGHT_EXTENSION = 2 * HeightfieldBuffer::HEIGHT_BORDER + HeightfieldBuffer::SHARED_EDGE; |
| @@ -1576,17 +1542,7 @@ AttributeValue BufferDataAttribute::inherit(const AttributeValue& parentValue) c · 620 unmodified lines | ||
| 1576 | 1542 | } |
| 1577 | 1543 | |
| 1578 | 1544 | void DefaultMetavoxelRendererImplementation::init() { |
| 1579 | − if (!_pointProgram.isLinked()) { | |
| 1580 | − _pointProgram.addShaderFromSourceFile(QGLShader::Vertex, Application::resourcesPath() + | |
| 1581 | − "shaders/metavoxel_point.vert"); | |
| 1582 | − _pointProgram.addShaderFromSourceFile(QGLShader::Fragment, Application::resourcesPath() + | |
| 1583 | − "shaders/metavoxel_voxel_base.frag"); | |
| 1584 | − _pointProgram.link(); | |
| 1585 | − | |
| 1586 | − _pointProgram.bind(); | |
| 1587 | − _pointScaleLocation = _pointProgram.uniformLocation("pointScale"); | |
| 1588 | − _pointProgram.release(); | |
| 1589 | − | |
| 1545 | + if (!_baseHeightfieldProgram.isLinked()) { | |
| 1590 | 1546 | _baseHeightfieldProgram.addShaderFromSourceFile(QGLShader::Vertex, Application::resourcesPath() + |
| 1591 | 1547 | "shaders/metavoxel_heightfield_base.vert"); |
| 1592 | 1548 | _baseHeightfieldProgram.addShaderFromSourceFile(QGLShader::Fragment, Application::resourcesPath() + |
| @@ -1631,76 +1587,6 @@ void DefaultMetavoxelRendererImplementation::init() { · 38 unmodified lines | ||
| 1631 | 1587 | DefaultMetavoxelRendererImplementation::DefaultMetavoxelRendererImplementation() { |
| 1632 | 1588 | } |
| 1633 | 1589 | |
| 1634 | −class PointAugmentVisitor : public MetavoxelVisitor { | |
| 1635 | −public: | |
| 1636 | − | |
| 1637 | − PointAugmentVisitor(const MetavoxelLOD& lod); | |
| 1638 | − | |
| 1639 | − virtual void prepare(MetavoxelData* data); | |
| 1640 | − virtual int visit(MetavoxelInfo& info); | |
| 1641 | − virtual bool postVisit(MetavoxelInfo& info); | |
| 1642 | − | |
| 1643 | −private: | |
| 1644 | − | |
| 1645 | − BufferPointVector _points; | |
| 1646 | − float _pointLeafSize; | |
| 1647 | −}; | |
| 1648 | − | |
| 1649 | −PointAugmentVisitor::PointAugmentVisitor(const MetavoxelLOD& lod) : | |
| 1650 | − MetavoxelVisitor(QVector<AttributePointer>() << AttributeRegistry::getInstance()->getColorAttribute() << | |
| 1651 | − AttributeRegistry::getInstance()->getNormalAttribute(), QVector<AttributePointer>() << | |
| 1652 | − Application::getInstance()->getMetavoxels()->getPointBufferAttribute(), lod) { | |
| 1653 | −} | |
| 1654 | − | |
| 1655 | −const int ALPHA_RENDER_THRESHOLD = 0; | |
| 1656 | − | |
| 1657 | −void PointAugmentVisitor::prepare(MetavoxelData* data) { | |
| 1658 | − MetavoxelVisitor::prepare(data); | |
| 1659 | − const float MAX_POINT_LEAF_SIZE = 64.0f; | |
| 1660 | − _pointLeafSize = qMin(data->getSize(), MAX_POINT_LEAF_SIZE); | |
| 1661 | −} | |
| 1662 | − | |
| 1663 | −int PointAugmentVisitor::visit(MetavoxelInfo& info) { | |
| 1664 | − if (!info.isLeaf) { | |
| 1665 | − return (info.size > _pointLeafSize) ? DEFAULT_ORDER : (DEFAULT_ORDER | ALL_NODES_REST); | |
| 1666 | − } | |
| 1667 | − QRgb color = info.inputValues.at(0).getInlineValue<QRgb>(); | |
| 1668 | − quint8 alpha = qAlpha(color); | |
| 1669 | − if (alpha > ALPHA_RENDER_THRESHOLD) { | |
| 1670 | − QRgb normal = info.inputValues.at(1).getInlineValue<QRgb>(); | |
| 1671 | − BufferPoint point = { glm::vec4(info.minimum + glm::vec3(info.size, info.size, info.size) * 0.5f, info.size), | |
| 1672 | − { quint8(qRed(color)), quint8(qGreen(color)), quint8(qBlue(color)) }, | |
| 1673 | − { quint8(qRed(normal)), quint8(qGreen(normal)), quint8(qBlue(normal)) } }; | |
| 1674 | − _points.append(point); | |
| 1675 | − } | |
| 1676 | − if (info.size >= _pointLeafSize) { | |
| 1677 | − PointBuffer* buffer = NULL; | |
| 1678 | − if (!_points.isEmpty()) { | |
| 1679 | − BufferPointVector swapPoints; | |
| 1680 | − _points.swap(swapPoints); | |
| 1681 | − buffer = new PointBuffer(swapPoints); | |
| 1682 | − } | |
| 1683 | − BufferDataPointer pointer(buffer); | |
| 1684 | − info.outputValues[0] = AttributeValue(_outputs.at(0), encodeInline(pointer)); | |
| 1685 | − } | |
| 1686 | − return STOP_RECURSION; | |
| 1687 | −} | |
| 1688 | − | |
| 1689 | −bool PointAugmentVisitor::postVisit(MetavoxelInfo& info) { | |
| 1690 | − if (info.size != _pointLeafSize) { | |
| 1691 | − return false; | |
| 1692 | − } | |
| 1693 | − PointBuffer* buffer = NULL; | |
| 1694 | − if (!_points.isEmpty()) { | |
| 1695 | − BufferPointVector swapPoints; | |
| 1696 | − _points.swap(swapPoints); | |
| 1697 | − buffer = new PointBuffer(swapPoints); | |
| 1698 | − } | |
| 1699 | − BufferDataPointer pointer(buffer); | |
| 1700 | − info.outputValues[0] = AttributeValue(_outputs.at(0), encodeInline(pointer)); | |
| 1701 | − return true; | |
| 1702 | −} | |
| 1703 | − | |
| 1704 | 1590 | class HeightfieldFetchVisitor : public MetavoxelVisitor { |
| 1705 | 1591 | public: |
| 1706 | 1592 | |
| @@ -2749,15 +2635,9 @@ void DefaultMetavoxelRendererImplementation::augment(MetavoxelData& data, const · 1042 unmodified lines | ||
| 2749 | 2635 | while (expandedPrevious.getSize() < data.getSize()) { |
| 2750 | 2636 | expandedPrevious.expand(); |
| 2751 | 2637 | } |
| 2752 | − const AttributePointer& pointBufferAttribute = Application::getInstance()->getMetavoxels()->getPointBufferAttribute(); | |
| 2753 | − MetavoxelNode* root = expandedPrevious.getRoot(pointBufferAttribute); | |
| 2754 | − if (root) { | |
| 2755 | − data.setRoot(pointBufferAttribute, root); | |
| 2756 | − root->incrementReferenceCount(); | |
| 2757 | − } | |
| 2758 | 2638 | const AttributePointer& heightfieldBufferAttribute = |
| 2759 | 2639 | Application::getInstance()->getMetavoxels()->getHeightfieldBufferAttribute(); |
| 2760 | − root = expandedPrevious.getRoot(heightfieldBufferAttribute); | |
| 2640 | + MetavoxelNode* root = expandedPrevious.getRoot(heightfieldBufferAttribute); | |
| 2761 | 2641 | if (root) { |
| 2762 | 2642 | data.setRoot(heightfieldBufferAttribute, root); |
| 2763 | 2643 | root->incrementReferenceCount(); |
| @@ -2769,10 +2649,6 @@ void DefaultMetavoxelRendererImplementation::augment(MetavoxelData& data, const · 5 unmodified lines | ||
| 2769 | 2649 | data.setRoot(voxelBufferAttribute, root); |
| 2770 | 2650 | root->incrementReferenceCount(); |
| 2771 | 2651 | } |
| 2772 | − | |
| 2773 | − PointAugmentVisitor pointAugmentVisitor(lod); | |
| 2774 | − data.guideToDifferent(expandedPrevious, pointAugmentVisitor); | |
| 2775 | − | |
| 2776 | 2652 | HeightfieldRegionVisitor heightfieldRegionVisitor(lod); |
| 2777 | 2653 | data.guideToDifferent(expandedPrevious, heightfieldRegionVisitor); |
| 2778 | 2654 | |
| @@ -2789,7 +2665,7 @@ public: · 10 unmodified lines | ||
| 2789 | 2665 | |
| 2790 | 2666 | SpannerSimulateVisitor(float deltaTime, const MetavoxelLOD& lod); |
| 2791 | 2667 | |
| 2792 | − virtual bool visit(Spanner* spanner, const glm::vec3& clipMinimum, float clipSize); | |
| 2668 | + virtual bool visit(Spanner* spanner); | |
| 2793 | 2669 | |
| 2794 | 2670 | private: |
| 2795 | 2671 | |
| @@ -2798,11 +2674,11 @@ private: · 2 unmodified lines | ||
| 2798 | 2674 | |
| 2799 | 2675 | SpannerSimulateVisitor::SpannerSimulateVisitor(float deltaTime, const MetavoxelLOD& lod) : |
| 2800 | 2676 | SpannerVisitor(QVector<AttributePointer>() << AttributeRegistry::getInstance()->getSpannersAttribute(), |
| 2801 | − QVector<AttributePointer>(), QVector<AttributePointer>(), QVector<AttributePointer>(), lod), | |
| 2677 | + QVector<AttributePointer>(), QVector<AttributePointer>(), lod), | |
| 2802 | 2678 | _deltaTime(deltaTime) { |
| 2803 | 2679 | } |
| 2804 | 2680 | |
| 2805 | −bool SpannerSimulateVisitor::visit(Spanner* spanner, const glm::vec3& clipMinimum, float clipSize) { | |
| 2681 | +bool SpannerSimulateVisitor::visit(Spanner* spanner) { | |
| 2806 | 2682 | spanner->getRenderer()->simulate(_deltaTime); |
| 2807 | 2683 | return true; |
| 2808 | 2684 | } |
| @@ -2819,7 +2695,7 @@ public: · 10 unmodified lines | ||
| 2819 | 2695 | SpannerRenderVisitor(const MetavoxelLOD& lod); |
| 2820 | 2696 | |
| 2821 | 2697 | virtual int visit(MetavoxelInfo& info); |
| 2822 | − virtual bool visit(Spanner* spanner, const glm::vec3& clipMinimum, float clipSize); | |
| 2698 | + virtual bool visit(Spanner* spanner); | |
| 2823 | 2699 | |
| 2824 | 2700 | private: |
| 2825 | 2701 | |
| @@ -2828,8 +2704,8 @@ private: · 2 unmodified lines | ||
| 2828 | 2704 | |
| 2829 | 2705 | SpannerRenderVisitor::SpannerRenderVisitor(const MetavoxelLOD& lod) : |
| 2830 | 2706 | SpannerVisitor(QVector<AttributePointer>() << AttributeRegistry::getInstance()->getSpannersAttribute(), |
| 2831 | − QVector<AttributePointer>(), QVector<AttributePointer>(), QVector<AttributePointer>(), | |
| 2832 | − lod, encodeOrder(Application::getInstance()->getDisplayViewFrustum()->getDirection())), | |
| 2707 | + QVector<AttributePointer>(), QVector<AttributePointer>(), lod, | |
| 2708 | + encodeOrder(Application::getInstance()->getDisplayViewFrustum()->getDirection())), | |
| 2833 | 2709 | _containmentDepth(INT_MAX) { |
| 2834 | 2710 | } |
| 2835 | 2711 | |
| @@ -2845,9 +2721,9 @@ int SpannerRenderVisitor::visit(MetavoxelInfo& info) { · 9 unmodified lines | ||
| 2845 | 2721 | return SpannerVisitor::visit(info); |
| 2846 | 2722 | } |
| 2847 | 2723 | |
| 2848 | −bool SpannerRenderVisitor::visit(Spanner* spanner, const glm::vec3& clipMinimum, float clipSize) { | |
| 2724 | +bool SpannerRenderVisitor::visit(Spanner* spanner) { | |
| 2849 | 2725 | const glm::vec4 OPAQUE_WHITE(1.0f, 1.0f, 1.0f, 1.0f); |
| 2850 | − spanner->getRenderer()->render(OPAQUE_WHITE, SpannerRenderer::DEFAULT_MODE, clipMinimum, clipSize); | |
| 2726 | + spanner->getRenderer()->render(OPAQUE_WHITE, SpannerRenderer::DEFAULT_MODE); | |
| 2851 | 2727 | return true; |
| 2852 | 2728 | } |
| 2853 | 2729 | |
| @@ -2893,40 +2769,10 @@ void DefaultMetavoxelRendererImplementation::render(MetavoxelData& data, Metavox · 39 unmodified lines | ||
| 2893 | 2769 | SpannerRenderVisitor spannerRenderVisitor(lod); |
| 2894 | 2770 | data.guide(spannerRenderVisitor); |
| 2895 | 2771 | |
| 2896 | − int viewport[4]; | |
| 2897 | − glGetIntegerv(GL_VIEWPORT, viewport); | |
| 2898 | − const int VIEWPORT_WIDTH_INDEX = 2; | |
| 2899 | − const int VIEWPORT_HEIGHT_INDEX = 3; | |
| 2900 | − float viewportWidth = viewport[VIEWPORT_WIDTH_INDEX]; | |
| 2901 | − float viewportHeight = viewport[VIEWPORT_HEIGHT_INDEX]; | |
| 2902 | − float viewportDiagonal = sqrtf(viewportWidth * viewportWidth + viewportHeight * viewportHeight); | |
| 2903 | − float worldDiagonal = glm::distance(Application::getInstance()->getDisplayViewFrustum()->getNearBottomLeft(), | |
| 2904 | − Application::getInstance()->getDisplayViewFrustum()->getNearTopRight()); | |
| 2905 | − | |
| 2906 | − _pointProgram.bind(); | |
| 2907 | − _pointProgram.setUniformValue(_pointScaleLocation, viewportDiagonal * | |
| 2908 | − Application::getInstance()->getDisplayViewFrustum()->getNearClip() / worldDiagonal); | |
| 2909 | − | |
| 2910 | − glEnableClientState(GL_VERTEX_ARRAY); | |
| 2911 | − glEnableClientState(GL_COLOR_ARRAY); | |
| 2912 | − glEnableClientState(GL_NORMAL_ARRAY); | |
| 2913 | − | |
| 2914 | − glEnable(GL_VERTEX_PROGRAM_POINT_SIZE_ARB); | |
| 2915 | − | |
| 2916 | − glDisable(GL_BLEND); | |
| 2917 | − | |
| 2918 | − BufferRenderVisitor pointRenderVisitor(Application::getInstance()->getMetavoxels()->getPointBufferAttribute()); | |
| 2919 | − data.guide(pointRenderVisitor); | |
| 2920 | − | |
| 2921 | − glDisable(GL_VERTEX_PROGRAM_POINT_SIZE_ARB); | |
| 2922 | − | |
| 2923 | − glDisableClientState(GL_COLOR_ARRAY); | |
| 2924 | − glDisableClientState(GL_NORMAL_ARRAY); | |
| 2925 | − | |
| 2926 | − _pointProgram.release(); | |
| 2927 | − | |
| 2928 | 2772 | Application::getInstance()->getTextureCache()->setPrimaryDrawBuffers(true, true); |
| 2929 | 2773 | |
| 2774 | + glEnableClientState(GL_VERTEX_ARRAY); | |
| 2775 | + glDisable(GL_BLEND); | |
| 2930 | 2776 | glEnable(GL_CULL_FACE); |
| 2931 | 2777 | glEnable(GL_ALPHA_TEST); |
| 2932 | 2778 | glAlphaFunc(GL_EQUAL, 0.0f); |
| @@ -2994,8 +2840,6 @@ void DefaultMetavoxelRendererImplementation::loadSplatProgram(const char* type, · 61 unmodified lines | ||
| 2994 | 2840 | program.release(); |
| 2995 | 2841 | } |
| 2996 | 2842 | |
| 2997 | −ProgramObject DefaultMetavoxelRendererImplementation::_pointProgram; | |
| 2998 | −int DefaultMetavoxelRendererImplementation::_pointScaleLocation; | |
| 2999 | 2843 | ProgramObject DefaultMetavoxelRendererImplementation::_baseHeightfieldProgram; |
| 3000 | 2844 | int DefaultMetavoxelRendererImplementation::_baseHeightScaleLocation; |
| 3001 | 2845 | int DefaultMetavoxelRendererImplementation::_baseColorScaleLocation; |
| @@ -3007,55 +2851,10 @@ ProgramObject DefaultMetavoxelRendererImplementation::_splatVoxelProgram; · 5 unmodified lines | ||
| 3007 | 2851 | DefaultMetavoxelRendererImplementation::SplatLocations DefaultMetavoxelRendererImplementation::_splatVoxelLocations; |
| 3008 | 2852 | ProgramObject DefaultMetavoxelRendererImplementation::_voxelCursorProgram; |
| 3009 | 2853 | |
| 3010 | −static void enableClipPlane(GLenum plane, float x, float y, float z, float w) { | |
| 3011 | − GLdouble coefficients[] = { x, y, z, w }; | |
| 3012 | − glClipPlane(plane, coefficients); | |
| 3013 | − glEnable(plane); | |
| 3014 | −} | |
| 3015 | − | |
| 3016 | −void ClippedRenderer::render(const glm::vec4& color, Mode mode, const glm::vec3& clipMinimum, float clipSize) { | |
| 3017 | − if (clipSize == 0.0f) { | |
| 3018 | − renderUnclipped(color, mode); | |
| 3019 | − return; | |
| 3020 | − } | |
| 3021 | − enableClipPlane(GL_CLIP_PLANE0, -1.0f, 0.0f, 0.0f, clipMinimum.x + clipSize); | |
| 3022 | − enableClipPlane(GL_CLIP_PLANE1, 1.0f, 0.0f, 0.0f, -clipMinimum.x); | |
| 3023 | − enableClipPlane(GL_CLIP_PLANE2, 0.0f, -1.0f, 0.0f, clipMinimum.y + clipSize); | |
| 3024 | − enableClipPlane(GL_CLIP_PLANE3, 0.0f, 1.0f, 0.0f, -clipMinimum.y); | |
| 3025 | − enableClipPlane(GL_CLIP_PLANE4, 0.0f, 0.0f, -1.0f, clipMinimum.z + clipSize); | |
| 3026 | − enableClipPlane(GL_CLIP_PLANE5, 0.0f, 0.0f, 1.0f, -clipMinimum.z); | |
| 3027 | − | |
| 3028 | − renderUnclipped(color, mode); | |
| 3029 | − | |
| 3030 | − glDisable(GL_CLIP_PLANE0); | |
| 3031 | − glDisable(GL_CLIP_PLANE1); | |
| 3032 | − glDisable(GL_CLIP_PLANE2); | |
| 3033 | − glDisable(GL_CLIP_PLANE3); | |
| 3034 | − glDisable(GL_CLIP_PLANE4); | |
| 3035 | − glDisable(GL_CLIP_PLANE5); | |
| 3036 | −} | |
| 3037 | − | |
| 3038 | 2854 | SphereRenderer::SphereRenderer() { |
| 3039 | 2855 | } |
| 3040 | 2856 | |
| 3041 | −void SphereRenderer::render(const glm::vec4& color, Mode mode, const glm::vec3& clipMinimum, float clipSize) { | |
| 3042 | − if (clipSize == 0.0f) { | |
| 3043 | − renderUnclipped(color, mode); | |
| 3044 | − return; | |
| 3045 | − } | |
| 3046 | − // slight performance optimization: don't render if clip bounds are entirely within sphere | |
| 3047 | − Sphere* sphere = static_cast<Sphere*>(_spanner); | |
| 3048 | − Box clipBox(clipMinimum, clipMinimum + glm::vec3(clipSize, clipSize, clipSize)); | |
| 3049 | − for (int i = 0; i < Box::VERTEX_COUNT; i++) { | |
| 3050 | − const float CLIP_PROPORTION = 0.95f; | |
| 3051 | − if (glm::distance(sphere->getTranslation(), clipBox.getVertex(i)) >= sphere->getScale() * CLIP_PROPORTION) { | |
| 3052 | − ClippedRenderer::render(color, mode, clipMinimum, clipSize); | |
| 3053 | − return; | |
| 3054 | − } | |
| 3055 | − } | |
| 3056 | −} | |
| 3057 | − | |
| 3058 | −void SphereRenderer::renderUnclipped(const glm::vec4& color, Mode mode) { | |
| 2857 | +void SphereRenderer::render(const glm::vec4& color, Mode mode) { | |
| 3059 | 2858 | Sphere* sphere = static_cast<Sphere*>(_spanner); |
| 3060 | 2859 | const QColor& ownColor = sphere->getColor(); |
| 3061 | 2860 | glColor4f(ownColor.redF() * color.r, ownColor.greenF() * color.g, ownColor.blueF() * color.b, ownColor.alphaF() * color.a); |
| @@ -3075,7 +2874,7 @@ void SphereRenderer::renderUnclipped(const glm::vec4& color, Mode mode) { · 13 unmodified lines | ||
| 3075 | 2874 | CuboidRenderer::CuboidRenderer() { |
| 3076 | 2875 | } |
| 3077 | 2876 | |
| 3078 | −void CuboidRenderer::renderUnclipped(const glm::vec4& color, Mode mode) { | |
| 2877 | +void CuboidRenderer::render(const glm::vec4& color, Mode mode) { | |
| 3079 | 2878 | Cuboid* cuboid = static_cast<Cuboid*>(_spanner); |
| 3080 | 2879 | const QColor& ownColor = cuboid->getColor(); |
| 3081 | 2880 | glColor4f(ownColor.redF() * color.r, ownColor.greenF() * color.g, ownColor.blueF() * color.b, ownColor.alphaF() * color.a); |
| @@ -3126,7 +2925,7 @@ void StaticModelRenderer::simulate(float deltaTime) { · 44 unmodified lines | ||
| 3126 | 2925 | _model->simulate(deltaTime); |
| 3127 | 2926 | } |
| 3128 | 2927 | |
| 3129 | −void StaticModelRenderer::renderUnclipped(const glm::vec4& color, Mode mode) { | |
| 2928 | +void StaticModelRenderer::render(const glm::vec4& color, Mode mode) { | |
| 3130 | 2929 | switch (mode) { |
| 3131 | 2930 | case DIFFUSE_MODE: |
| 3132 | 2931 | _model->render(color.a, Model::DIFFUSE_RENDER_MODE); |
| @@ -3143,8 +2942,7 @@ void StaticModelRenderer::renderUnclipped(const glm::vec4& color, Mode mode) { · 10 unmodified lines | ||
| 3143 | 2942 | _model->render(color.a); |
| 3144 | 2943 | } |
| 3145 | 2944 | |
| 3146 | −bool StaticModelRenderer::findRayIntersection(const glm::vec3& origin, const glm::vec3& direction, | |
| 3147 | − const glm::vec3& clipMinimum, float clipSize, float& distance) const { | |
| 2945 | +bool StaticModelRenderer::findRayIntersection(const glm::vec3& origin, const glm::vec3& direction, float& distance) const { | |
| 3148 | 2946 | RayIntersectionInfo info; |
| 3149 | 2947 | info._rayStart = origin; |
| 3150 | 2948 | info._rayDirection = direction; |