Commit 039475cbf11666c46ba79f658149a5920ea7bfee
1 parent
9fe0bbd7
Particle System demo fixes
- fixed analysis hub errors - fixed partial update issue Change-Id: I860b0c4641c7d0ae9ff17a73f20bf400515b71c6
Showing
2 changed files
with
5 additions
and
3 deletions
examples/particle-system/effects/image-effect-source.cpp
| ... | ... | @@ -84,8 +84,8 @@ uint32_t ImageExplodeEffectSource::Update(ParticleList& particleList, uint32_t c |
| 84 | 84 | float particleScale = 4.0f; |
| 85 | 85 | float pixelSize = 2.0f; |
| 86 | 86 | |
| 87 | - uint32_t halfWidth = (mImageWidth/2) * particleScale; | |
| 88 | - uint32_t halfHeight = (mImageHeight/2) * particleScale; | |
| 87 | + auto halfWidth = (float(mImageWidth)*0.5f) * particleScale; | |
| 88 | + auto halfHeight = (float(mImageHeight)*0.5f) * particleScale; | |
| 89 | 89 | |
| 90 | 90 | for(auto y = 0u ; y < mImageHeight; ++y) |
| 91 | 91 | { |
| ... | ... | @@ -103,7 +103,7 @@ uint32_t ImageExplodeEffectSource::Update(ParticleList& particleList, uint32_t c |
| 103 | 103 | auto& scale = particle.Get<Vector3>(ParticleStream::SCALE_STREAM_BIT); |
| 104 | 104 | color = GetColorAt(x, y, mPixelBuffer); |
| 105 | 105 | // Set basePosition |
| 106 | - position = basePosition = Vector3(x* particleScale -halfWidth, y* particleScale -halfHeight, 0); | |
| 106 | + position = basePosition = Vector3(float(x) * particleScale - halfWidth, float(y)* particleScale - halfHeight, 0); | |
| 107 | 107 | scale = Vector3(pixelSize, pixelSize, 1); |
| 108 | 108 | velocity = Vector3::ZERO; |
| 109 | 109 | } | ... | ... |
examples/particle-system/particle-system-example.cpp
| ... | ... | @@ -100,6 +100,8 @@ public: |
| 100 | 100 | emitterActor.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER); |
| 101 | 101 | emitterActor.SetProperty(Actor::Property::POSITION, Vector2(0.0, 0.0f)); |
| 102 | 102 | emitterActor.SetProperty(Actor::Property::SIZE, Vector2(1.0, 1.0f)); |
| 103 | + emitterActor.SetProperty(Actor::Property::UPDATE_AREA_HINT, Vector4(0, 0, window.GetSize().GetWidth(), window.GetSize().GetHeight())); | |
| 104 | + | |
| 103 | 105 | window.Add(emitterActor); |
| 104 | 106 | |
| 105 | 107 | mEmitterActor = emitterActor; | ... | ... |