public void SyncTo(IGameComponent characterBoneComponent) { var value = characterBoneComponent as CharacterBoneComponent; if (null == value) { return; } value.PitchHeadAngle = FollowRotHelper.PitchHeadAngle(); value.RotHeadAngle = FollowRotHelper.YawHeadAngle(); value.HeadRotProcess = FollowRotHelper.HeadRotProcess(); value.PitchHandAngle = FollowRotHelper.PitchHandAngle(); value.IsHeadRotCW = FollowRotHelper.IsHeadRotCw(); }
public void SyncTo(ICharacterBoneState state) { //state.NeckP3Pitch = FollowPitch(FollowRotHelper.PitchHeadAngle(), _neckP3); //state.HeadP3Pitch = FollowPitch(FollowRotHelper.PitchHeadAngle(), _headP3); //var yaw = SlerpHeadRot(FollowRotHelper.HeadRotProcess(), FollowRotHelper.YawHeadAngle(), FollowRotHelper.IsHeadRotCW()); //state.NeckP3Yaw = FollowYaw(yaw, _neckP3); //state.HeadP3Yaw = FollowYaw(yaw, _headP3); state.PitchHeadAngle = FollowRotHelper.PitchHeadAngle(); state.RotHeadAngle = FollowRotHelper.YawHeadAngle(); state.HeadRotProcess = FollowRotHelper.HeadRotProcess(); state.PitchHandAngle = FollowRotHelper.PitchHandAngle(); state.IsHeadRotCW = FollowRotHelper.IsHeadRotCw(); }
public void PreUpdate(FollowRotParam param, ICharacterBone characterBone, float deltaTime) { //人物正向和载具正向相差180度 var curAngle = param.CameraFreeYaw; var needReverse = FollowRotHelper.NeedReverse(); if (needReverse) { curAngle = curAngle + (curAngle > 0 ? -180 : 180); } if (curAngle > NoHeadRotStart) { curAngle = 0; } if (curAngle < -NoHeadRotStart) { curAngle = 0; } if (FollowRotHelper.ForbidRot()) { characterBone.ForbidRot = true; } else { characterBone.ForbidRot = false; } var aimAngle = characterBone.ForbidRot ? 0 : curAngle; characterBone.LastHeadRotAngle = CalcuStepRotAngle(aimAngle, characterBone.LastHeadRotAngle, deltaTime); CalcCurrentHandPitch(FollowRotHelper.PitchHandAngle(), deltaTime); }