TimelineImprovements
This commit is contained in:
1 parent
e312131725
commit
f927552adc
2211 files changed
+115416
-540944
No files matched your search
@@ -267,16 +267,40 @@ namespace Code.OfficeGame.BattleMode.Timeline
|
||||
KinematicCharacterSystem.CharacterMotors,
|
||||
KinematicCharacterSystem.PhysicsMovers);
|
||||
|
||||
// ФАЗА 3: Параметры BlendTree ходьбы + шаг аниматоров + RootMotion синхронизация каждый тик
|
||||
// ФАЗА 3: Параметры ходьбы + шаг аниматоров + чистый дельта-перенос RootMotion
|
||||
for (int i = 0; i < _entities.Length; i++)
|
||||
{
|
||||
var entity = _entities[i];
|
||||
UpdateAnimatorLocomotionParams(entity);
|
||||
|
||||
entity.animator.Update(FixedTickDelta);
|
||||
|
||||
if (entity.animator.applyRootMotion)
|
||||
entity.SyncRootMotionToMotor();
|
||||
{
|
||||
Transform animT = entity.animator.transform;
|
||||
Vector3 savedLocalPos = animT.localPosition;
|
||||
Quaternion savedLocalRot = animT.localRotation;
|
||||
Vector3 worldPosBefore = animT.position;
|
||||
Quaternion worldRotBefore = animT.rotation;
|
||||
|
||||
entity.animator.Update(FixedTickDelta);
|
||||
|
||||
Vector3 worldDeltaPos = animT.position - worldPosBefore;
|
||||
Quaternion worldDeltaRot = animT.rotation * Quaternion.Inverse(worldRotBefore);
|
||||
|
||||
// Возвращаем модель на её родной локальный оффсет
|
||||
animT.localPosition = savedLocalPos;
|
||||
animT.localRotation = savedLocalRot;
|
||||
|
||||
var motor = entity.KinematicCharacterMotor;
|
||||
motor.SetPositionAndRotation(
|
||||
motor.TransientPosition + worldDeltaPos,
|
||||
worldDeltaRot * motor.TransientRotation,
|
||||
bypassInterpolation: true);
|
||||
motor.BaseVelocity = Vector3.zero;
|
||||
}
|
||||
else
|
||||
{
|
||||
entity.animator.Update(FixedTickDelta);
|
||||
}
|
||||
}
|
||||
|
||||
// ФАЗА 4: Единый шаг PhysX и синхронизация костей/хитбоксов ДО проверок
|
||||
|
||||
Reference in new issue
Block a user