mirror of
https://github.com/overte-org/overte.git
synced 2025-08-08 06:57:37 +02:00
Merge pull request #6607 from imgntn/particle_system_visibility
Particle Systems Now Respect Visibility Setting
This commit is contained in:
commit
0213426f0c
1 changed files with 8 additions and 8 deletions
|
@ -60,9 +60,6 @@ public:
|
||||||
void setTexture(gpu::TexturePointer texture) { _texture = texture; }
|
void setTexture(gpu::TexturePointer texture) { _texture = texture; }
|
||||||
const gpu::TexturePointer& getTexture() const { return _texture; }
|
const gpu::TexturePointer& getTexture() const { return _texture; }
|
||||||
|
|
||||||
bool getVisibleFlag() const { return _visibleFlag; }
|
|
||||||
void setVisibleFlag(bool visibleFlag) { _visibleFlag = visibleFlag; }
|
|
||||||
|
|
||||||
void render(RenderArgs* args) const {
|
void render(RenderArgs* args) const {
|
||||||
assert(_pipeline);
|
assert(_pipeline);
|
||||||
|
|
||||||
|
@ -82,8 +79,9 @@ public:
|
||||||
batch.drawIndexed(gpu::TRIANGLES, numIndices);
|
batch.drawIndexed(gpu::TRIANGLES, numIndices);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected:
|
|
||||||
EntityItemPointer _entity;
|
EntityItemPointer _entity;
|
||||||
|
|
||||||
|
protected:
|
||||||
Transform _modelTransform;
|
Transform _modelTransform;
|
||||||
AABox _bound;
|
AABox _bound;
|
||||||
gpu::PipelinePointer _pipeline;
|
gpu::PipelinePointer _pipeline;
|
||||||
|
@ -91,13 +89,12 @@ protected:
|
||||||
gpu::BufferPointer _vertexBuffer;
|
gpu::BufferPointer _vertexBuffer;
|
||||||
gpu::BufferPointer _indexBuffer;
|
gpu::BufferPointer _indexBuffer;
|
||||||
gpu::TexturePointer _texture;
|
gpu::TexturePointer _texture;
|
||||||
bool _visibleFlag = true;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
namespace render {
|
namespace render {
|
||||||
template <>
|
template <>
|
||||||
const ItemKey payloadGetKey(const ParticlePayload::Pointer& payload) {
|
const ItemKey payloadGetKey(const ParticlePayload::Pointer& payload) {
|
||||||
if (payload->getVisibleFlag()) {
|
if (payload->_entity->getVisible()) {
|
||||||
return ItemKey::Builder::transparentShape();
|
return ItemKey::Builder::transparentShape();
|
||||||
} else {
|
} else {
|
||||||
return ItemKey::Builder().withInvisible().build();
|
return ItemKey::Builder().withInvisible().build();
|
||||||
|
@ -111,8 +108,11 @@ namespace render {
|
||||||
|
|
||||||
template <>
|
template <>
|
||||||
void payloadRender(const ParticlePayload::Pointer& payload, RenderArgs* args) {
|
void payloadRender(const ParticlePayload::Pointer& payload, RenderArgs* args) {
|
||||||
|
if (payload->_entity->getVisible()) {
|
||||||
payload->render(args);
|
payload->render(args);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue