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


C++ TypedEntityPointer类代码示例

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


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

示例1: updateHazeFromEntity

void ZoneEntityRenderer::updateHazeFromEntity(const TypedEntityPointer& entity) {
    setHazeMode((ComponentMode)entity->getHazeMode());

    const auto& haze = editHaze();

    const uint32_t hazeMode = entity->getHazeMode();
    haze->setHazeActive(hazeMode == COMPONENT_MODE_ENABLED);
    haze->setAltitudeBased(_hazeProperties.getHazeAltitudeEffect());

    haze->setHazeRangeFactor(graphics::Haze::convertHazeRangeToHazeRangeFactor(_hazeProperties.getHazeRange()));
    glm::u8vec3 hazeColor = _hazeProperties.getHazeColor();
    haze->setHazeColor(toGlm(hazeColor));
    glm::u8vec3 hazeGlareColor = _hazeProperties.getHazeGlareColor();
    haze->setHazeGlareColor(toGlm(hazeGlareColor));
    haze->setHazeEnableGlare(_hazeProperties.getHazeEnableGlare());
    haze->setHazeGlareBlend(graphics::Haze::convertGlareAngleToPower(_hazeProperties.getHazeGlareAngle()));

    float hazeAltitude = _hazeProperties.getHazeCeiling() - _hazeProperties.getHazeBaseRef();
    haze->setHazeAltitudeFactor(graphics::Haze::convertHazeAltitudeToHazeAltitudeFactor(hazeAltitude));
    haze->setHazeBaseReference(_hazeProperties.getHazeBaseRef());

    haze->setHazeBackgroundBlend(_hazeProperties.getHazeBackgroundBlend());

    haze->setHazeAttenuateKeyLight(_hazeProperties.getHazeAttenuateKeyLight());
    haze->setHazeKeyLightRangeFactor(graphics::Haze::convertHazeRangeToHazeRangeFactor(_hazeProperties.getHazeKeyLightRange()));
    haze->setHazeKeyLightAltitudeFactor(graphics::Haze::convertHazeAltitudeToHazeAltitudeFactor(_hazeProperties.getHazeKeyLightAltitude()));

    haze->setTransform(entity->getTransform().getMatrix());
}
开发者ID:Nex-Pro,项目名称:hifi,代码行数:29,代码来源:RenderableZoneEntityItem.cpp

示例2: doRenderUpdateSynchronousTyped

void ShapeEntityRenderer::doRenderUpdateSynchronousTyped(const ScenePointer& scene, Transaction& transaction, const TypedEntityPointer& entity) {
    withWriteLock([&] {
        auto userData = entity->getUserData();
        if (_lastUserData != userData) {
            _lastUserData = userData;
            _procedural.setProceduralData(ProceduralData::parse(_lastUserData));
        }

        _shape = entity->getShape();
        _pulseProperties = entity->getPulseProperties();
    });

    void* key = (void*)this;
    AbstractViewStateInterface::instance()->pushPostUpdateLambda(key, [this] () {
        withWriteLock([&] {
            auto entity = getEntity();
            _position = entity->getWorldPosition();
            _dimensions = entity->getUnscaledDimensions(); // get unscaled to avoid scaling twice
            _orientation = entity->getWorldOrientation();
            updateModelTransformAndBound();
            _renderTransform = getModelTransform(); // contains parent scale, if this entity scales with its parent
            if (_shape == entity::Sphere) {
                _renderTransform.postScale(SPHERE_ENTITY_SCALE);
            }

            _renderTransform.postScale(_dimensions);
        });;
    });
}
开发者ID:AndrewMeadows,项目名称:hifi,代码行数:29,代码来源:RenderableShapeEntityItem.cpp

示例3: doRenderUpdateAsynchronousTyped

void TextEntityRenderer::doRenderUpdateAsynchronousTyped(const TypedEntityPointer& entity) {
    _textColor = toGlm(entity->getTextColor());
    _backgroundColor = toGlm(entity->getBackgroundColor());
    _faceCamera = entity->getFaceCamera();
    _lineHeight = entity->getLineHeight();
    _text = entity->getText();
}
开发者ID:Nex-Pro,项目名称:hifi,代码行数:7,代码来源:RenderableTextEntityItem.cpp

示例4: updateKeyBackgroundFromEntity

void ZoneEntityRenderer::updateKeyBackgroundFromEntity(const TypedEntityPointer& entity) {
    setSkyboxMode((ComponentMode)entity->getSkyboxMode());

    editBackground();
    setSkyboxColor(toGlm(_skyboxProperties.getColor()));
    setProceduralUserData(entity->getUserData());
    setSkyboxURL(_skyboxProperties.getURL());
}
开发者ID:Nex-Pro,项目名称:hifi,代码行数:8,代码来源:RenderableZoneEntityItem.cpp

示例5: needsRenderUpdateFromTypedEntity

bool PolyLineEntityRenderer::needsRenderUpdateFromTypedEntity(const TypedEntityPointer& entity) const {
    return (
        entity->pointsChanged() ||
        entity->strokeWidthsChanged() ||
        entity->normalsChanged() ||
        entity->texturesChanged() ||
        entity->strokeColorsChanged()
    );
}
开发者ID:SeijiEmery,项目名称:hifi,代码行数:9,代码来源:RenderablePolyLineEntityItem.cpp

示例6: 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

示例7: needsRenderUpdateFromTypedEntity

bool ZoneEntityRenderer::needsRenderUpdateFromTypedEntity(const TypedEntityPointer& entity) const {
    if (entity->keyLightPropertiesChanged() ||
        entity->ambientLightPropertiesChanged() ||
        entity->hazePropertiesChanged() ||
        entity->bloomPropertiesChanged() ||
        entity->skyboxPropertiesChanged()) {

        return true;
    }

    if (_skyboxTextureURL != entity->getSkyboxProperties().getURL()) {
        return true;
    }

    if (entity->getWorldPosition() != _lastPosition) {
        return true;
    }
    if (entity->getScaledDimensions() != _lastDimensions) {
        return true;
    }
    if (entity->getWorldOrientation() != _lastRotation) {
        return true;
    }

    if (entity->getUserData() != _proceduralUserData) {
        return true;
    }

#if 0
    if (_typedEntity->getCompoundShapeURL() != _lastShapeURL) {
        return true;
    }

    if (_model) {
        if (!_model->needsFixupInScene() && (!ZoneEntityItem::getDrawZoneBoundaries() || _entity->getShapeType() != SHAPE_TYPE_COMPOUND)) {
            return true;
        }

        if (_model->needsFixupInScene() && (ZoneEntityItem::getDrawZoneBoundaries() || _entity->getShapeType() == SHAPE_TYPE_COMPOUND)) {
            return true;
        }

        if (_lastModelActive != _model->isActive()) {
            return true;
        }
    }
#endif

    return false;
}
开发者ID:Nex-Pro,项目名称:hifi,代码行数:50,代码来源:RenderableZoneEntityItem.cpp

示例8: updateKeySunFromEntity

void ZoneEntityRenderer::updateKeySunFromEntity(const TypedEntityPointer& entity) {
    setKeyLightMode((ComponentMode)entity->getKeyLightMode());

    const auto& sunLight = editSunLight();
    sunLight->setType(graphics::Light::SUN);
    sunLight->setPosition(_lastPosition);
    sunLight->setOrientation(_lastRotation);

    // Set the keylight
    sunLight->setColor(ColorUtils::toVec3(_keyLightProperties.getColor()));
    sunLight->setIntensity(_keyLightProperties.getIntensity());
    sunLight->setDirection(entity->getTransform().getRotation() * _keyLightProperties.getDirection());
    sunLight->setCastShadows(_keyLightProperties.getCastShadows());
}
开发者ID:Nex-Pro,项目名称:hifi,代码行数:14,代码来源:RenderableZoneEntityItem.cpp

示例9: doRenderUpdateSynchronousTyped

void PolyLineEntityRenderer::doRenderUpdateSynchronousTyped(const ScenePointer& scene, Transaction& transaction, const TypedEntityPointer& entity) {
    static const QUrl DEFAULT_POLYLINE_TEXTURE = QUrl(PathUtils::resourcesPath() + "images/paintStroke.png");
    QUrl entityTextures = DEFAULT_POLYLINE_TEXTURE;
    if (entity->texturesChanged()) {
        entity->resetTexturesChanged();
        auto textures = entity->getTextures();
        if (!textures.isEmpty()) {
            entityTextures = QUrl(textures);
        }
        _texture = DependencyManager::get<TextureCache>()->getTexture(entityTextures);
    }
    
    
    if (!_texture) {
        _texture = DependencyManager::get<TextureCache>()->getTexture(entityTextures);
    }
}
开发者ID:SeijiEmery,项目名称:hifi,代码行数:17,代码来源:RenderablePolyLineEntityItem.cpp

示例10: updateBloomFromEntity

void ZoneEntityRenderer::updateBloomFromEntity(const TypedEntityPointer& entity) {
    setBloomMode((ComponentMode)entity->getBloomMode());

    const auto& bloom = editBloom();

    bloom->setBloomIntensity(_bloomProperties.getBloomIntensity());
    bloom->setBloomThreshold(_bloomProperties.getBloomThreshold());
    bloom->setBloomSize(_bloomProperties.getBloomSize());
}
开发者ID:Nex-Pro,项目名称:hifi,代码行数:9,代码来源:RenderableZoneEntityItem.cpp

示例11: doRenderUpdateSynchronousTyped

void TextEntityRenderer::doRenderUpdateSynchronousTyped(const ScenePointer& scene, Transaction& transaction, const TypedEntityPointer& entity) {
    void* key = (void*)this;
    AbstractViewStateInterface::instance()->pushPostUpdateLambda(key, [this, entity] () {
        withWriteLock([&] {
            _dimensions = entity->getScaledDimensions();
            updateModelTransformAndBound();
            _renderTransform = getModelTransform();
        });
    });
}
开发者ID:Nex-Pro,项目名称:hifi,代码行数:10,代码来源:RenderableTextEntityItem.cpp

示例12: updateAmbientLightFromEntity

void ZoneEntityRenderer::updateAmbientLightFromEntity(const TypedEntityPointer& entity) {
    setAmbientLightMode((ComponentMode)entity->getAmbientLightMode());

    const auto& ambientLight = editAmbientLight();
    ambientLight->setType(graphics::Light::AMBIENT);
    ambientLight->setPosition(_lastPosition);
    ambientLight->setOrientation(_lastRotation);


    // Set the ambient light
    ambientLight->setAmbientIntensity(_ambientLightProperties.getAmbientIntensity());

    if (_ambientLightProperties.getAmbientURL().isEmpty()) {
        setAmbientURL(_skyboxProperties.getURL());
    } else {
        setAmbientURL(_ambientLightProperties.getAmbientURL());
    }

    ambientLight->setTransform(entity->getTransform().getInverseMatrix());
}
开发者ID:Nex-Pro,项目名称:hifi,代码行数:20,代码来源:RenderableZoneEntityItem.cpp

示例13: 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

示例14: 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

示例15: needsRenderUpdateFromTypedEntity

bool TextEntityRenderer::needsRenderUpdateFromTypedEntity(const TypedEntityPointer& entity) const {
    if (_text != entity->getText()) {
        return true;
    }

    if (_lineHeight != entity->getLineHeight()) {
        return true;
    }

    if (_textColor != toGlm(entity->getTextColor())) {
        return true;
    }

    if (_backgroundColor != toGlm(entity->getBackgroundColor())) {
        return true;
    }

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

    if (_faceCamera != entity->getFaceCamera()) {
        return true;
    }
    return false;
}
开发者ID:Nex-Pro,项目名称:hifi,代码行数:26,代码来源:RenderableTextEntityItem.cpp


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