mirror of
https://github.com/overte-org/overte.git
synced 2025-04-19 15:03:53 +02:00
namechanges: setFooInMeters() --> setFoo()
also fixed some warnings, made code abide to standard, and moved some variables to be closer to where they're used
This commit is contained in:
parent
c3a8c44545
commit
e418872f7b
2 changed files with 11 additions and 13 deletions
|
@ -31,9 +31,6 @@ RenderableParticleEffectEntityItem::RenderableParticleEffectEntityItem(const Ent
|
|||
void RenderableParticleEffectEntityItem::render(RenderArgs* args) {
|
||||
PerformanceTimer perfTimer("RenderableParticleEffectEntityItem::render");
|
||||
assert(getType() == EntityTypes::ParticleEffect);
|
||||
glm::vec3 position = getPositionInMeters();
|
||||
glm::vec3 center = getCenterInMeters();
|
||||
glm::quat rotation = getRotation();
|
||||
float pa_rad = getParticleRadius();
|
||||
|
||||
const float MAX_COLOR = 255.0f;
|
||||
|
@ -75,13 +72,14 @@ void RenderableParticleEffectEntityItem::render(RenderArgs* args) {
|
|||
DependencyManager::get<GeometryCache>()->updateVertices(_cacheID, *pointVec, paColor);
|
||||
|
||||
glPushMatrix();
|
||||
glm::vec3 position = getPosition();
|
||||
glTranslatef(position.x, position.y, position.z);
|
||||
glm::quat rotation = getRotation();
|
||||
glm::vec3 axis = glm::axis(rotation);
|
||||
glRotatef(glm::degrees(glm::angle(rotation)), axis.x, axis.y, axis.z);
|
||||
|
||||
|
||||
glPushMatrix();
|
||||
glm::vec3 positionToCenter = center - position;
|
||||
glm::vec3 positionToCenter = getCenter() - position;
|
||||
glTranslatef(positionToCenter.x, positionToCenter.y, positionToCenter.z);
|
||||
|
||||
DependencyManager::get<GeometryCache>()->renderVertices(gpu::QUADS, _cacheID);
|
||||
|
|
|
@ -268,10 +268,10 @@ void ParticleEffectEntityItem::update(const quint64& now) {
|
|||
|
||||
// update the dimensions
|
||||
glm::vec3 dims;
|
||||
dims.x = glm::max(glm::abs(_paXmin), glm::abs(_paXmax)) * 2.0;
|
||||
dims.y = glm::max(glm::abs(_paYmin), glm::abs(_paYmax)) * 2.0;
|
||||
dims.z = glm::max(glm::abs(_paZmin), glm::abs(_paZmax)) * 2.0;
|
||||
setDimensionsInMeters(dims);
|
||||
dims.x = glm::max(glm::abs(_paXmin), glm::abs(_paXmax)) * 2.0f;
|
||||
dims.y = glm::max(glm::abs(_paYmin), glm::abs(_paYmax)) * 2.0f;
|
||||
dims.z = glm::max(glm::abs(_paZmin), glm::abs(_paZmax)) * 2.0f;
|
||||
setDimensions(dims);
|
||||
|
||||
EntityItem::update(now); // let our base class handle it's updates...
|
||||
}
|
||||
|
@ -418,8 +418,8 @@ QString ParticleEffectEntityItem::getAnimationSettings() const {
|
|||
}
|
||||
|
||||
void ParticleEffectEntityItem::stepSimulation(float deltaTime) {
|
||||
_paXmin = _paYmin = _paZmin = -1.0;
|
||||
_paXmax = _paYmax = _paZmax = 1.0;
|
||||
_paXmin = _paYmin = _paZmin = -1.0f;
|
||||
_paXmax = _paYmax = _paZmax = 1.0f;
|
||||
|
||||
// update particles
|
||||
quint32 updateIter = _paHead;
|
||||
|
@ -493,8 +493,8 @@ void ParticleEffectEntityItem::stepSimulation(float deltaTime) {
|
|||
}
|
||||
|
||||
void ParticleEffectEntityItem::resetSimulation() {
|
||||
for (int i = 0; i < _maxParticles; i++) {
|
||||
int j = i * XYZ_STRIDE;
|
||||
for (quint32 i = 0; i < _maxParticles; i++) {
|
||||
quint32 j = i * XYZ_STRIDE;
|
||||
_paLife[i] = -1.0f;
|
||||
_paPosition[j] = 0.0f;
|
||||
_paPosition[j+1] = 0.0f;
|
||||
|
|
Loading…
Reference in a new issue