mirror of
				https://github.com/OpenMW/openmw.git
				synced 2025-11-04 06:56:39 +00:00 
			
		
		
		
	Merge remote-tracking branch 'origin/openmw-37' into openmw-37
This commit is contained in:
		
						commit
						f614187cd4
					
				
					 6 changed files with 13 additions and 5 deletions
				
			
		| 
						 | 
					@ -1062,9 +1062,9 @@ namespace MWPhysics
 | 
				
			||||||
    void PhysicsSystem::updateScale(const MWWorld::Ptr &ptr)
 | 
					    void PhysicsSystem::updateScale(const MWWorld::Ptr &ptr)
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        ObjectMap::iterator found = mObjects.find(ptr);
 | 
					        ObjectMap::iterator found = mObjects.find(ptr);
 | 
				
			||||||
        float scale = ptr.getCellRef().getScale();
 | 
					 | 
				
			||||||
        if (found != mObjects.end())
 | 
					        if (found != mObjects.end())
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
 | 
					            float scale = ptr.getCellRef().getScale();
 | 
				
			||||||
            found->second->setScale(scale);
 | 
					            found->second->setScale(scale);
 | 
				
			||||||
            mCollisionWorld->updateSingleAabb(found->second->getCollisionObject());
 | 
					            mCollisionWorld->updateSingleAabb(found->second->getCollisionObject());
 | 
				
			||||||
            return;
 | 
					            return;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -125,6 +125,11 @@ void Objects::insertBegin(const MWWorld::Ptr& ptr)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    insert->setPosition(osg::Vec3(f[0], f[1], f[2]));
 | 
					    insert->setPosition(osg::Vec3(f[0], f[1], f[2]));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    const float scale = ptr.getCellRef().getScale();
 | 
				
			||||||
 | 
					    osg::Vec3f scaleVec(scale, scale, scale);
 | 
				
			||||||
 | 
					    ptr.getClass().adjustScale(ptr, scaleVec, true);
 | 
				
			||||||
 | 
					    insert->setScale(scaleVec);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    ptr.getRefData().setBaseNode(insert);
 | 
					    ptr.getRefData().setBaseNode(insert);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -168,8 +168,8 @@ namespace MWSound
 | 
				
			||||||
        SoundMap::const_iterator snditer = mActiveSounds.begin();
 | 
					        SoundMap::const_iterator snditer = mActiveSounds.begin();
 | 
				
			||||||
        while(snditer != mActiveSounds.end())
 | 
					        while(snditer != mActiveSounds.end())
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            if(snditer->second.first == ptr && snditer->second.second == id)
 | 
					            if(snditer->second.first == ptr && snditer->second.second == id && snditer->first->isPlaying())
 | 
				
			||||||
                return snditer->first->isPlaying();
 | 
					                return true;
 | 
				
			||||||
            ++snditer;
 | 
					            ++snditer;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        return false;
 | 
					        return false;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -73,6 +73,8 @@ namespace
 | 
				
			||||||
            osg::Vec3f scaleVec (scale, scale, scale);
 | 
					            osg::Vec3f scaleVec (scale, scale, scale);
 | 
				
			||||||
            ptr.getClass().adjustScale(ptr, scaleVec, true);
 | 
					            ptr.getClass().adjustScale(ptr, scaleVec, true);
 | 
				
			||||||
            rendering.scaleObject(ptr, scaleVec);
 | 
					            rendering.scaleObject(ptr, scaleVec);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            physics.updateScale(ptr);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -114,7 +116,6 @@ namespace
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                addObject(ptr, mPhysics, mRendering);
 | 
					                addObject(ptr, mPhysics, mRendering);
 | 
				
			||||||
                updateObjectRotation(ptr, mPhysics, mRendering, false);
 | 
					                updateObjectRotation(ptr, mPhysics, mRendering, false);
 | 
				
			||||||
                updateObjectScale(ptr, mPhysics, mRendering);
 | 
					 | 
				
			||||||
                ptr.getClass().adjustPosition (ptr, false);
 | 
					                ptr.getClass().adjustPosition (ptr, false);
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
            catch (const std::exception& e)
 | 
					            catch (const std::exception& e)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -680,7 +680,7 @@ void WeatherManager::update(float duration, bool paused)
 | 
				
			||||||
        if ( !is_night ) {
 | 
					        if ( !is_night ) {
 | 
				
			||||||
            theta = M_PI * (adjustedHour - mSunriseTime) / dayDuration;
 | 
					            theta = M_PI * (adjustedHour - mSunriseTime) / dayDuration;
 | 
				
			||||||
        } else {
 | 
					        } else {
 | 
				
			||||||
            theta = M_PI * (adjustedHour - adjustedNightStart) / nightDuration;
 | 
					            theta = M_PI * (1.f - (adjustedHour - adjustedNightStart) / nightDuration);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        osg::Vec3f final(
 | 
					        osg::Vec3f final(
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -843,6 +843,8 @@ namespace NifOsg
 | 
				
			||||||
                partsys->getOrCreateUserDataContainer()->addDescription("worldspace");
 | 
					                partsys->getOrCreateUserDataContainer()->addDescription("worldspace");
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            partsys->setParticleScaleReferenceFrame(osgParticle::ParticleSystem::LOCAL_COORDINATES);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            handleParticleInitialState(nifNode, partsys, partctrl);
 | 
					            handleParticleInitialState(nifNode, partsys, partctrl);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            partsys->setQuota(partctrl->numParticles);
 | 
					            partsys->setQuota(partctrl->numParticles);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in a new issue