mirror of
				https://github.com/OpenMW/openmw.git
				synced 2025-11-04 01:26:39 +00:00 
			
		
		
		
	pos accum without conformity with animation bug/creature speed
This commit is contained in:
		
							parent
							
								
									80d8aa4030
								
							
						
					
					
						commit
						b85a4dd35e
					
				
					 1 changed files with 9 additions and 2 deletions
				
			
		| 
						 | 
					@ -301,8 +301,9 @@ void CharacterController::refreshCurrentAnims(CharacterState idle, CharacterStat
 | 
				
			||||||
        if(!mCurrentMovement.empty())
 | 
					        if(!mCurrentMovement.empty())
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            float vel, speedmult = 1.0f;
 | 
					            float vel, speedmult = 1.0f;
 | 
				
			||||||
            if(mMovementSpeed > 0.0f && (vel=mAnimation->getVelocity(mCurrentMovement)) > 1.0f)
 | 
					            if(mPtr.getClass().isNpc() && mMovementSpeed > 0.0f && (vel=mAnimation->getVelocity(mCurrentMovement)) > 1.0f)
 | 
				
			||||||
                speedmult = mMovementSpeed / vel;
 | 
					                speedmult = mMovementSpeed / vel;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            mAnimation->play(mCurrentMovement, Priority_Movement, movegroup, false,
 | 
					            mAnimation->play(mCurrentMovement, Priority_Movement, movegroup, false,
 | 
				
			||||||
                             speedmult, ((mode!=2)?"start":"loop start"), "stop", 0.0f, ~0ul);
 | 
					                             speedmult, ((mode!=2)?"start":"loop start"), "stop", 0.0f, ~0ul);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
| 
						 | 
					@ -1120,8 +1121,14 @@ void CharacterController::update(float duration)
 | 
				
			||||||
            else //avoid z-rotating for knockdown
 | 
					            else //avoid z-rotating for knockdown
 | 
				
			||||||
                world->rotateObject(mPtr, rot.x, rot.y, 0.0f, true);
 | 
					                world->rotateObject(mPtr, rot.x, rot.y, 0.0f, true);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            // all actual movement in 3rd person controlled by animations, except for jump
 | 
				
			||||||
 | 
					            // !mAnimation->hasAnimation("death1") identifies 1st person mode
 | 
				
			||||||
 | 
					            if(mJumpState != JumpState_None || vec.z > 0 
 | 
				
			||||||
 | 
					                || (mPtr.getRefData().getHandle() == "player" && !mAnimation->hasAnimation("death1")))
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
                world->queueMovement(mPtr, vec);
 | 
					                world->queueMovement(mPtr, vec);
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        movement = vec;
 | 
					        movement = vec;
 | 
				
			||||||
        cls.getMovementSettings(mPtr).mPosition[0] = cls.getMovementSettings(mPtr).mPosition[1] = cls.getMovementSettings(mPtr).mPosition[2] = 0;
 | 
					        cls.getMovementSettings(mPtr).mPosition[0] = cls.getMovementSettings(mPtr).mPosition[1] = cls.getMovementSettings(mPtr).mPosition[2] = 0;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in a new issue