本文整理汇总了C++中TypedEntityPointer类的典型用法代码示例。如果您正苦于以下问题:C++ TypedEntityPointer类的具体用法?C++ TypedEntityPointer怎么用?C++ TypedEntityPointer使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了TypedEntityPointer类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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
示例16: 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
示例17: updateKeyZoneItemFromEntity
void ZoneEntityRenderer::updateKeyZoneItemFromEntity(const TypedEntityPointer& entity) {
// Update rotation values
editSkybox()->setOrientation(entity->getTransform().getRotation());
/* TODO: Implement the sun model behavior / Keep this code here for reference, this is how we
{
// Set the stage
bool isSunModelEnabled = this->getStageProperties().getSunModelEnabled();
sceneStage->setSunModelEnable(isSunModelEnabled);
if (isSunModelEnabled) {
sceneStage->setLocation(this->getStageProperties().getLongitude(),
this->getStageProperties().getLatitude(),
this->getStageProperties().getAltitude());
auto sceneTime = sceneStage->getTime();
sceneTime->setHour(this->getStageProperties().calculateHour());
sceneTime->setDay(this->getStageProperties().calculateDay());
}
}*/
}
开发者ID:Nex-Pro,项目名称:hifi,代码行数:20,代码来源:RenderableZoneEntityItem.cpp
示例18: 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
示例19: doRenderUpdateAsynchronousTyped
void ZoneEntityRenderer::doRenderUpdateAsynchronousTyped(const TypedEntityPointer& entity) {
if (entity->getShapeType() == SHAPE_TYPE_SPHERE) {
_renderTransform = getModelTransform();
_renderTransform.postScale(SPHERE_ENTITY_SCALE);
}
}
开发者ID:Nex-Pro,项目名称:hifi,代码行数:6,代码来源:RenderableZoneEntityItem.cpp
示例20: doRenderUpdateAsynchronousTyped
void PolyLineEntityRenderer::doRenderUpdateAsynchronousTyped(const TypedEntityPointer& entity) {
PolyLineUniforms uniforms;
uniforms.color = toGlm(entity->getXColor());
memcpy(&_uniformBuffer.edit<PolyLineUniforms>(), &uniforms, sizeof(PolyLineUniforms));
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->getXColor()) });
}
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:SeijiEmery,项目名称:hifi,代码行数:37,代码来源:RenderablePolyLineEntityItem.cpp
注:本文中的TypedEntityPointer类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论