当前位置: 首页>>代码示例>>C++>>正文


C++ TypedEntityPointer::getColor方法代码示例

本文整理汇总了C++中TypedEntityPointer::getColor方法的典型用法代码示例。如果您正苦于以下问题:C++ TypedEntityPointer::getColor方法的具体用法?C++ TypedEntityPointer::getColor怎么用?C++ TypedEntityPointer::getColor使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在TypedEntityPointer的用法示例。


在下文中一共展示了TypedEntityPointer::getColor方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: needsRenderUpdateFromTypedEntity

bool ShapeEntityRenderer::needsRenderUpdateFromTypedEntity(const TypedEntityPointer& entity) const {
    if (_lastUserData != entity->getUserData()) {
        return true;
    }

    if (_color != entity->getColor()) {
        return true;
    }
    if (_alpha != entity->getAlpha()) {
        return true;
    }

    if (_shape != entity->getShape()) {
        return true;
    }

    if (_dimensions != entity->getScaledDimensions()) {
        return true;
    }

    if (_pulseProperties != entity->getPulseProperties()) {
        return true;
    }

    return false;
}
开发者ID:AndrewMeadows,项目名称:hifi,代码行数:26,代码来源:RenderableShapeEntityItem.cpp

示例2: needsRenderUpdateFromTypedEntity

bool GridEntityRenderer::needsRenderUpdateFromTypedEntity(const TypedEntityPointer& entity) const {
    bool needsUpdate = resultWithReadLock<bool>([&] {
        if (_color != entity->getColor()) {
            return true;
        }

        if (_alpha != entity->getAlpha()) {
            return true;
        }

        if (_followCamera != entity->getFollowCamera()) {
            return true;
        }

        if (_majorGridEvery != entity->getMajorGridEvery()) {
            return true;
        }

        if (_minorGridEvery != entity->getMinorGridEvery()) {
            return true;
        }

        if (_pulseProperties != entity->getPulseProperties()) {
            return true;
        }

        return false;
    });

    return needsUpdate;
}
开发者ID:Menithal,项目名称:hifi,代码行数:31,代码来源:RenderableGridEntityItem.cpp

示例3: doRenderUpdateAsynchronousTyped

void LineEntityRenderer::doRenderUpdateAsynchronousTyped(const TypedEntityPointer& entity) {
    entity->resetPointsChanged();
    _linePoints = entity->getLinePoints();
    auto geometryCache = DependencyManager::get<GeometryCache>();
    if (_lineVerticesID == GeometryCache::UNKNOWN_ID) {
        _lineVerticesID = geometryCache->allocateID();
    }
    glm::vec4 lineColor(toGlm(entity->getColor()), entity->getLocalRenderAlpha());
    geometryCache->updateVertices(_lineVerticesID, _linePoints, lineColor);
}
开发者ID:Nex-Pro,项目名称:hifi,代码行数:10,代码来源:RenderableLineEntityItem.cpp

示例4: doRenderUpdateSynchronousTyped

void GridEntityRenderer::doRenderUpdateSynchronousTyped(const ScenePointer& scene, Transaction& transaction, const TypedEntityPointer& entity) {
    withWriteLock([&] {
        _color = entity->getColor();
        _alpha = entity->getAlpha();
        _pulseProperties = entity->getPulseProperties();

        _followCamera = entity->getFollowCamera();
        _majorGridEvery = entity->getMajorGridEvery();
        _minorGridEvery = entity->getMinorGridEvery();
    });

    void* key = (void*)this;
    AbstractViewStateInterface::instance()->pushPostUpdateLambda(key, [this, entity]() {
        withWriteLock([&] {
            _dimensions = entity->getScaledDimensions();
            updateModelTransformAndBound();
            _renderTransform = getModelTransform();
        });
    });
}
开发者ID:Menithal,项目名称:hifi,代码行数:20,代码来源:RenderableGridEntityItem.cpp

示例5: doRenderUpdateAsynchronousTyped

void ShapeEntityRenderer::doRenderUpdateAsynchronousTyped(const TypedEntityPointer& entity) {
    withReadLock([&] {
        if (_procedural.isEnabled() && _procedural.isFading()) {
            float isFading = Interpolate::calculateFadeRatio(_procedural.getFadeStartTime()) < 1.0f;
            _procedural.setIsFading(isFading);
        }
    });

    glm::u8vec3 color = entity->getColor();
    float alpha = entity->getAlpha();
    if (_color != color || _alpha != alpha) {
        _color = color;
        _alpha = alpha;
        _material->setAlbedo(toGlm(_color));
        _material->setOpacity(_alpha);

        auto materials = _materials.find("0");
        if (materials != _materials.end()) {
            materials->second.setNeedsUpdate(true);
        }
    }
}
开发者ID:AndrewMeadows,项目名称:hifi,代码行数:22,代码来源:RenderableShapeEntityItem.cpp

示例6: doRenderUpdateAsynchronousTyped

void PolyLineEntityRenderer::doRenderUpdateAsynchronousTyped(const TypedEntityPointer& entity) {
    auto pointsChanged = entity->pointsChanged();
    auto strokeWidthsChanged = entity->strokeWidthsChanged();
    auto normalsChanged = entity->normalsChanged();
    auto strokeColorsChanged = entity->strokeColorsChanged();
    

    bool isUVModeStretch = entity->getIsUVModeStretch();
    entity->resetPolyLineChanged();

    _polylineTransform = Transform();
    _polylineTransform.setTranslation(entity->getWorldPosition());
    _polylineTransform.setRotation(entity->getWorldOrientation());

    if (pointsChanged) {
        _lastPoints = entity->getLinePoints();
    }
    if (strokeWidthsChanged) {
        _lastStrokeWidths = entity->getStrokeWidths();
    }
    if (normalsChanged) {
        _lastNormals = entity->getNormals();
    }
    if (strokeColorsChanged) {
        _lastStrokeColors = entity->getStrokeColors();
        _lastStrokeColors = _lastNormals.size() == _lastStrokeColors.size() ? _lastStrokeColors : QVector<glm::vec3>({ toGlm(entity->getColor()) });
    }
    if (pointsChanged || strokeWidthsChanged || normalsChanged || strokeColorsChanged) {
        _empty = std::min(_lastPoints.size(), std::min(_lastNormals.size(), _lastStrokeWidths.size())) < 2;
        if (!_empty) {
            updateGeometry(updateVertices(_lastPoints, _lastNormals, _lastStrokeWidths, _lastStrokeColors, isUVModeStretch, _textureAspectRatio));
        }
    }
}
开发者ID:Nex-Pro,项目名称:hifi,代码行数:34,代码来源:RenderablePolyLineEntityItem.cpp


注:本文中的TypedEntityPointer::getColor方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。