mirror of
				https://github.com/OpenMW/openmw.git
				synced 2025-11-04 04:26:42 +00:00 
			
		
		
		
	Revert "Merge branch 'offset_the_deads' into 'master'"
This reverts commit 7dd02076f5
			
			
This commit is contained in:
		
							parent
							
								
									ff7ac7192b
								
							
						
					
					
						commit
						de3092f014
					
				
					 3 changed files with 8 additions and 5 deletions
				
			
		| 
						 | 
					@ -158,9 +158,6 @@ namespace MWPhysics
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        bool canMoveToWaterSurface(float waterlevel, const btCollisionWorld* world) const;
 | 
					        bool canMoveToWaterSurface(float waterlevel, const btCollisionWorld* world) const;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        /// Returns the mesh translation, scaled and rotated as necessary
 | 
					 | 
				
			||||||
        osg::Vec3f getScaledMeshTranslation() const;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    private:
 | 
					    private:
 | 
				
			||||||
        MWWorld::Ptr mStandingOnPtr;
 | 
					        MWWorld::Ptr mStandingOnPtr;
 | 
				
			||||||
        /// Removes then re-adds the collision object to the dynamics world
 | 
					        /// Removes then re-adds the collision object to the dynamics world
 | 
				
			||||||
| 
						 | 
					@ -168,6 +165,9 @@ namespace MWPhysics
 | 
				
			||||||
        void addCollisionMask(int collisionMask);
 | 
					        void addCollisionMask(int collisionMask);
 | 
				
			||||||
        int getCollisionMask() const;
 | 
					        int getCollisionMask() const;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        /// Returns the mesh translation, scaled and rotated as necessary
 | 
				
			||||||
 | 
					        osg::Vec3f getScaledMeshTranslation() const;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        bool mCanWaterWalk;
 | 
					        bool mCanWaterWalk;
 | 
				
			||||||
        bool mWalkingOnWater;
 | 
					        bool mWalkingOnWater;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -134,6 +134,8 @@ namespace MWPhysics
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        // Adjust for collision mesh offset relative to actor's "location"
 | 
					        // Adjust for collision mesh offset relative to actor's "location"
 | 
				
			||||||
        // (doTrace doesn't take local/interior collision shape translation into account, so we have to do it on our own)
 | 
					        // (doTrace doesn't take local/interior collision shape translation into account, so we have to do it on our own)
 | 
				
			||||||
 | 
					        // for compatibility with vanilla assets, we have to derive this from the vertical half extent instead of from internal hull translation
 | 
				
			||||||
 | 
					        // if not for this hack, the "correct" collision hull position would be physicActor->getScaledMeshTranslation()
 | 
				
			||||||
        actor.mPosition.z() += actor.mHalfExtentsZ; // vanilla-accurate
 | 
					        actor.mPosition.z() += actor.mHalfExtentsZ; // vanilla-accurate
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        float swimlevel = actor.mSwimLevel + actor.mHalfExtentsZ;
 | 
					        float swimlevel = actor.mSwimLevel + actor.mHalfExtentsZ;
 | 
				
			||||||
| 
						 | 
					@ -463,6 +465,8 @@ namespace MWPhysics
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        // use vanilla-accurate collision hull position hack (do same hitbox offset hack as movement solver)
 | 
				
			||||||
 | 
					        // if vanilla compatibility didn't matter, the "correct" collision hull position would be physicActor->getScaledMeshTranslation()
 | 
				
			||||||
        const auto verticalHalfExtent = osg::Vec3f(0.0, 0.0, actor.mHalfExtentsZ);
 | 
					        const auto verticalHalfExtent = osg::Vec3f(0.0, 0.0, actor.mHalfExtentsZ);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        // use a 3d approximation of the movement vector to better judge player intent
 | 
					        // use a 3d approximation of the movement vector to better judge player intent
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -939,8 +939,7 @@ namespace MWPhysics
 | 
				
			||||||
        , mRotation()
 | 
					        , mRotation()
 | 
				
			||||||
        , mMovement(actor.velocity())
 | 
					        , mMovement(actor.velocity())
 | 
				
			||||||
        , mWaterlevel(waterlevel)
 | 
					        , mWaterlevel(waterlevel)
 | 
				
			||||||
        // for compatibility with vanilla assets, mesh offset is the actor halfextent for dead actors
 | 
					        , mHalfExtentsZ(actor.getHalfExtents().z())
 | 
				
			||||||
        , mHalfExtentsZ(actor.getPtr().getClass().getCreatureStats(actor.getPtr()).isDead() ? actor.getHalfExtents().z() : actor.getScaledMeshTranslation().z())
 | 
					 | 
				
			||||||
        , mOldHeight(0)
 | 
					        , mOldHeight(0)
 | 
				
			||||||
        , mStuckFrames(0)
 | 
					        , mStuckFrames(0)
 | 
				
			||||||
        , mFlying(MWBase::Environment::get().getWorld()->isFlying(actor.getPtr()))
 | 
					        , mFlying(MWBase::Environment::get().getWorld()->isFlying(actor.getPtr()))
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in a new issue