|
|
@ -91,6 +91,11 @@ CVector vecPedVanRearDoorAnimOffset;
|
|
|
|
CVector vecPedQuickDraggedOutCarAnimOffset;
|
|
|
|
CVector vecPedQuickDraggedOutCarAnimOffset;
|
|
|
|
CVector vecPedDraggedOutCarAnimOffset;
|
|
|
|
CVector vecPedDraggedOutCarAnimOffset;
|
|
|
|
CVector vecPedTrainDoorAnimOffset;
|
|
|
|
CVector vecPedTrainDoorAnimOffset;
|
|
|
|
|
|
|
|
CVector vecPedStdBikeJumpRhsAnimOffset;
|
|
|
|
|
|
|
|
CVector vecPedVespaBikeJumpRhsAnimOffset;
|
|
|
|
|
|
|
|
CVector vecPedHarleyBikeJumpRhsAnimOffset;
|
|
|
|
|
|
|
|
CVector vecPedDirtBikeJumpRhsAnimOffset;
|
|
|
|
|
|
|
|
CVector vecPedBikeKickAnimOffset;
|
|
|
|
|
|
|
|
|
|
|
|
bool CPed::bNastyLimbsCheat;
|
|
|
|
bool CPed::bNastyLimbsCheat;
|
|
|
|
bool CPed::bPedCheat2;
|
|
|
|
bool CPed::bPedCheat2;
|
|
|
@ -686,7 +691,7 @@ CPed::ApplyHeadShot(eWeaponType weaponType, CVector pos, bool evenOnPlayer)
|
|
|
|
|
|
|
|
|
|
|
|
// BUG: This condition will always return true. Even fixing it won't work, because these states are unused.
|
|
|
|
// BUG: This condition will always return true. Even fixing it won't work, because these states are unused.
|
|
|
|
// if (m_nPedState != PED_PASSENGER || m_nPedState != PED_TAXI_PASSENGER) {
|
|
|
|
// if (m_nPedState != PED_PASSENGER || m_nPedState != PED_TAXI_PASSENGER) {
|
|
|
|
CPed::SetDie(ANIM_KO_SHOT_FRONT1, 4.0f, 0.0f);
|
|
|
|
SetDie();
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
bBodyPartJustCameOff = true;
|
|
|
|
bBodyPartJustCameOff = true;
|
|
|
@ -1848,6 +1853,7 @@ CPed::GetPositionToOpenCarDoor(CVehicle *veh, uint32 component, float offset)
|
|
|
|
return veh->GetPosition() + doorPos;
|
|
|
|
return veh->GetPosition() + doorPos;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// --MIAMI: Done
|
|
|
|
void
|
|
|
|
void
|
|
|
|
CPed::LineUpPedWithCar(PedLineUpPhase phase)
|
|
|
|
CPed::LineUpPedWithCar(PedLineUpPhase phase)
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -1856,29 +1862,59 @@ CPed::LineUpPedWithCar(PedLineUpPhase phase)
|
|
|
|
float seatPosMult = 0.0f;
|
|
|
|
float seatPosMult = 0.0f;
|
|
|
|
float currentZ;
|
|
|
|
float currentZ;
|
|
|
|
float adjustedTimeStep;
|
|
|
|
float adjustedTimeStep;
|
|
|
|
|
|
|
|
CVector autoZPos;
|
|
|
|
|
|
|
|
|
|
|
|
if (CReplay::IsPlayingBack())
|
|
|
|
if (CReplay::IsPlayingBack())
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
|
|
if (!bChangedSeat && phase != LINE_UP_TO_CAR_2) {
|
|
|
|
if (!bChangedSeat && phase != LINE_UP_TO_CAR_2) {
|
|
|
|
if (RpAnimBlendClumpGetAssociation(GetClump(), ANIM_CAR_SIT)) {
|
|
|
|
if (m_pMyVehicle->IsBike()) {
|
|
|
|
SetPedPositionInCar();
|
|
|
|
if (RpAnimBlendClumpGetAssociation(GetClump(), ANIM_BIKE_RIDE) ||
|
|
|
|
return;
|
|
|
|
RpAnimBlendClumpGetAssociation(GetClump(), ANIM_BIKE_PASSENGER)) {
|
|
|
|
}
|
|
|
|
SetPedPositionInCar();
|
|
|
|
if (RpAnimBlendClumpGetAssociation(GetClump(), ANIM_CAR_LSIT)) {
|
|
|
|
return;
|
|
|
|
SetPedPositionInCar();
|
|
|
|
}
|
|
|
|
return;
|
|
|
|
} else {
|
|
|
|
}
|
|
|
|
if (RpAnimBlendClumpGetAssociation(GetClump(), ANIM_CAR_SIT)) {
|
|
|
|
if (RpAnimBlendClumpGetAssociation(GetClump(), ANIM_CAR_SITP)) {
|
|
|
|
SetPedPositionInCar();
|
|
|
|
SetPedPositionInCar();
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (RpAnimBlendClumpGetAssociation(GetClump(), ANIM_CAR_LSIT)) {
|
|
|
|
if (RpAnimBlendClumpGetAssociation(GetClump(), ANIM_CAR_SITPLO)) {
|
|
|
|
SetPedPositionInCar();
|
|
|
|
SetPedPositionInCar();
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (RpAnimBlendClumpGetAssociation(GetClump(), ANIM_CAR_SITP)) {
|
|
|
|
|
|
|
|
SetPedPositionInCar();
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (RpAnimBlendClumpGetAssociation(GetClump(), ANIM_CAR_SITPLO)) {
|
|
|
|
|
|
|
|
SetPedPositionInCar();
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
bChangedSeat = true;
|
|
|
|
bChangedSeat = true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (phase == LINE_UP_TO_CAR_FALL) {
|
|
|
|
|
|
|
|
SetPedPositionInCar();
|
|
|
|
|
|
|
|
autoZPos = GetPosition();
|
|
|
|
|
|
|
|
CPedPlacement::FindZCoorForPed(&autoZPos);
|
|
|
|
|
|
|
|
if (m_pVehicleAnim && (m_pVehicleAnim->animId == ANIM_CAR_ROLLOUT_LHS || m_pVehicleAnim->animId == ANIM_CAR_ROLLOUT_RHS)
|
|
|
|
|
|
|
|
&& autoZPos.z > GetPosition().z) {
|
|
|
|
|
|
|
|
m_matrix.GetPosition().z = autoZPos.z;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (m_pVehicleAnim && m_pVehicleAnim->animId == ANIM_BIKE_HIT) {
|
|
|
|
|
|
|
|
if (autoZPos.z > GetPosition().z)
|
|
|
|
|
|
|
|
m_matrix.GetPosition().z += m_pVehicleAnim->GetProgress() * (autoZPos.z - GetPosition().z);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} else if (m_pVehicleAnim) {
|
|
|
|
|
|
|
|
if (m_pVehicleAnim->animId == ANIM_BIKE_GETOFF_BACK) {
|
|
|
|
|
|
|
|
if (autoZPos.z > GetPosition().z) {
|
|
|
|
|
|
|
|
m_matrix.GetPosition().z += (m_pVehicleAnim->currentTime * (20.f / 7.f)) * (autoZPos.z - GetPosition().z);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
}
|
|
|
|
if (phase == LINE_UP_TO_CAR_START) {
|
|
|
|
if (phase == LINE_UP_TO_CAR_START) {
|
|
|
|
m_vecMoveSpeed = CVector(0.0f, 0.0f, 0.0f);
|
|
|
|
m_vecMoveSpeed = CVector(0.0f, 0.0f, 0.0f);
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -1916,14 +1952,9 @@ CPed::LineUpPedWithCar(PedLineUpPhase phase)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (!bInVehicle)
|
|
|
|
|
|
|
|
seatPosMult = 1.0f;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef VC_PED_PORTS
|
|
|
|
|
|
|
|
bool multExtractedFromAnim = false;
|
|
|
|
bool multExtractedFromAnim = false;
|
|
|
|
bool multExtractedFromAnimBus = false;
|
|
|
|
bool multExtractedFromAnimBus = false;
|
|
|
|
float zBlend;
|
|
|
|
float zBlend;
|
|
|
|
#endif
|
|
|
|
|
|
|
|
if (m_pVehicleAnim) {
|
|
|
|
if (m_pVehicleAnim) {
|
|
|
|
vehAnim = m_pVehicleAnim->animId;
|
|
|
|
vehAnim = m_pVehicleAnim->animId;
|
|
|
|
|
|
|
|
|
|
|
@ -1934,38 +1965,38 @@ CPed::LineUpPedWithCar(PedLineUpPhase phase)
|
|
|
|
case ANIM_CAR_LJACKED_LHS:
|
|
|
|
case ANIM_CAR_LJACKED_LHS:
|
|
|
|
case ANIM_VAN_GETIN_L:
|
|
|
|
case ANIM_VAN_GETIN_L:
|
|
|
|
case ANIM_VAN_GETIN:
|
|
|
|
case ANIM_VAN_GETIN:
|
|
|
|
#ifdef VC_PED_PORTS
|
|
|
|
|
|
|
|
multExtractedFromAnim = true;
|
|
|
|
multExtractedFromAnim = true;
|
|
|
|
zBlend = Max(m_pVehicleAnim->GetProgress() - 0.3f, 0.0f) / (1.0f - 0.3f);
|
|
|
|
zBlend = Max(m_pVehicleAnim->GetProgress() - 0.3f, 0.0f) / (1.0f - 0.3f);
|
|
|
|
// fall through
|
|
|
|
// fall through
|
|
|
|
#endif
|
|
|
|
|
|
|
|
case ANIM_CAR_QJACKED:
|
|
|
|
case ANIM_CAR_QJACKED:
|
|
|
|
case ANIM_CAR_GETOUT_LHS:
|
|
|
|
case ANIM_CAR_GETOUT_LHS:
|
|
|
|
case ANIM_CAR_GETOUT_LOW_LHS:
|
|
|
|
case ANIM_CAR_GETOUT_LOW_LHS:
|
|
|
|
case ANIM_CAR_GETOUT_RHS:
|
|
|
|
case ANIM_CAR_GETOUT_RHS:
|
|
|
|
case ANIM_CAR_GETOUT_LOW_RHS:
|
|
|
|
case ANIM_CAR_GETOUT_LOW_RHS:
|
|
|
|
#ifdef VC_PED_PORTS
|
|
|
|
|
|
|
|
if (!multExtractedFromAnim) {
|
|
|
|
if (!multExtractedFromAnim) {
|
|
|
|
multExtractedFromAnim = true;
|
|
|
|
multExtractedFromAnim = true;
|
|
|
|
zBlend = Max(m_pVehicleAnim->GetProgress() - 0.5f, 0.0f) / (1.0f - 0.5f);
|
|
|
|
zBlend = Max(m_pVehicleAnim->GetProgress() - 0.5f, 0.0f) / (1.0f - 0.5f);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// fall through
|
|
|
|
// fall through
|
|
|
|
#endif
|
|
|
|
|
|
|
|
case ANIM_CAR_CRAWLOUT_RHS:
|
|
|
|
case ANIM_CAR_CRAWLOUT_RHS:
|
|
|
|
case ANIM_CAR_CRAWLOUT_RHS2:
|
|
|
|
case ANIM_CAR_CRAWLOUT_RHS2:
|
|
|
|
case ANIM_VAN_GETOUT_L:
|
|
|
|
case ANIM_VAN_GETOUT_L:
|
|
|
|
case ANIM_VAN_GETOUT:
|
|
|
|
case ANIM_VAN_GETOUT:
|
|
|
|
|
|
|
|
case ANIM_BIKE_GETOFF_RHS:
|
|
|
|
|
|
|
|
case ANIM_BIKE_GETOFF_LHS:
|
|
|
|
seatPosMult = m_pVehicleAnim->GetProgress();
|
|
|
|
seatPosMult = m_pVehicleAnim->GetProgress();
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case ANIM_CAR_GETIN_RHS:
|
|
|
|
case ANIM_CAR_GETIN_RHS:
|
|
|
|
case ANIM_CAR_GETIN_LHS:
|
|
|
|
case ANIM_CAR_GETIN_LHS:
|
|
|
|
#ifdef VC_PED_PORTS
|
|
|
|
|
|
|
|
if (veh && veh->IsCar() && veh->bIsBus) {
|
|
|
|
if (veh && veh->IsCar() && veh->bIsBus) {
|
|
|
|
multExtractedFromAnimBus = true;
|
|
|
|
multExtractedFromAnimBus = true;
|
|
|
|
zBlend = Min(m_pVehicleAnim->GetProgress(), 0.5f) / 0.5f;
|
|
|
|
zBlend = Min(m_pVehicleAnim->GetProgress(), 0.5f) / 0.5f;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// fall through
|
|
|
|
// fall through
|
|
|
|
#endif
|
|
|
|
|
|
|
|
case ANIM_CAR_QJACK:
|
|
|
|
case ANIM_CAR_QJACK:
|
|
|
|
case ANIM_CAR_GETIN_LOW_LHS:
|
|
|
|
case ANIM_CAR_GETIN_LOW_LHS:
|
|
|
|
case ANIM_CAR_GETIN_LOW_RHS:
|
|
|
|
case ANIM_CAR_GETIN_LOW_RHS:
|
|
|
@ -1980,6 +2011,12 @@ CPed::LineUpPedWithCar(PedLineUpPhase phase)
|
|
|
|
case ANIM_CAR_LSHUFFLE_RHS:
|
|
|
|
case ANIM_CAR_LSHUFFLE_RHS:
|
|
|
|
seatPosMult = 0.0f;
|
|
|
|
seatPosMult = 0.0f;
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case ANIM_CAR_JUMPIN_LHS:
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
float animLength = m_pVehicleAnim->hierarchy->totalLength;
|
|
|
|
|
|
|
|
seatPosMult = Max(0.0f, 0.5f * animLength - m_pVehicleAnim->currentTime) / animLength;
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
}
|
|
|
|
case ANIM_CAR_CLOSE_LHS:
|
|
|
|
case ANIM_CAR_CLOSE_LHS:
|
|
|
|
case ANIM_CAR_CLOSE_RHS:
|
|
|
|
case ANIM_CAR_CLOSE_RHS:
|
|
|
|
case ANIM_COACH_OPEN_L:
|
|
|
|
case ANIM_COACH_OPEN_L:
|
|
|
@ -1990,8 +2027,25 @@ CPed::LineUpPedWithCar(PedLineUpPhase phase)
|
|
|
|
seatPosMult = 1.0f;
|
|
|
|
seatPosMult = 1.0f;
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
default:
|
|
|
|
|
|
|
|
if (veh->IsBike()) {
|
|
|
|
|
|
|
|
seatPosMult = 0.0f;
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
if (bInVehicle)
|
|
|
|
|
|
|
|
seatPosMult = 0.0f;
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
seatPosMult = 1.0f;
|
|
|
|
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
if (veh->IsBike()) {
|
|
|
|
|
|
|
|
seatPosMult = 0.0f;
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
if (bInVehicle)
|
|
|
|
|
|
|
|
seatPosMult = 0.0f;
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
seatPosMult = 1.0f;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
CVector neededPos;
|
|
|
|
CVector neededPos;
|
|
|
@ -2002,7 +2056,7 @@ CPed::LineUpPedWithCar(PedLineUpPhase phase)
|
|
|
|
neededPos = GetPositionToOpenCarDoor(veh, m_vehEnterType, seatPosMult);
|
|
|
|
neededPos = GetPositionToOpenCarDoor(veh, m_vehEnterType, seatPosMult);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
CVector autoZPos = neededPos;
|
|
|
|
autoZPos = neededPos;
|
|
|
|
|
|
|
|
|
|
|
|
if (veh->bIsInWater) {
|
|
|
|
if (veh->bIsInWater) {
|
|
|
|
if (veh->m_vehType == VEHICLE_TYPE_BOAT && veh->IsUpsideDown())
|
|
|
|
if (veh->m_vehType == VEHICLE_TYPE_BOAT && veh->IsUpsideDown())
|
|
|
@ -2032,11 +2086,24 @@ CPed::LineUpPedWithCar(PedLineUpPhase phase)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (autoZPos.z > neededPos.z) {
|
|
|
|
if (autoZPos.z > neededPos.z) {
|
|
|
|
#ifdef VC_PED_PORTS
|
|
|
|
vehAnim = m_pVehicleAnim->animId;
|
|
|
|
if (multExtractedFromAnim) {
|
|
|
|
if (veh->IsBike() && (m_pVehicleAnim && vehAnim != ANIM_BIKE_KICK)) {
|
|
|
|
|
|
|
|
float zBlend;
|
|
|
|
|
|
|
|
if (vehAnim != ANIM_BIKE_GETOFF_RHS && vehAnim != ANIM_BIKE_GETOFF_LHS) {
|
|
|
|
|
|
|
|
if (vehAnim != ANIM_BIKE_JUMPON_R && vehAnim != ANIM_BIKE_JUMPON_L) {
|
|
|
|
|
|
|
|
zBlend = 0.0f;
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
float animLength = m_pVehicleAnim->hierarchy->totalLength;
|
|
|
|
|
|
|
|
zBlend = Min(1.0f, 2.0f * m_pVehicleAnim->currentTime / animLength);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
zBlend = 1.0f - seatPosMult;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
float curZ = veh->GetPosition().z + FEET_OFFSET;
|
|
|
|
|
|
|
|
neededPos.z = ((curZ - autoZPos.z) - veh->GetHeightAboveRoad()) * zBlend + autoZPos.z;
|
|
|
|
|
|
|
|
} else if (multExtractedFromAnim) {
|
|
|
|
neededPos.z += (autoZPos.z - neededPos.z) * zBlend;
|
|
|
|
neededPos.z += (autoZPos.z - neededPos.z) * zBlend;
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
#endif
|
|
|
|
|
|
|
|
currentZ = GetPosition().z;
|
|
|
|
currentZ = GetPosition().z;
|
|
|
|
if (m_pVehicleAnim && vehAnim != ANIM_VAN_GETIN_L && vehAnim != ANIM_VAN_CLOSE_L && vehAnim != ANIM_VAN_CLOSE && vehAnim != ANIM_VAN_GETIN) {
|
|
|
|
if (m_pVehicleAnim && vehAnim != ANIM_VAN_GETIN_L && vehAnim != ANIM_VAN_CLOSE_L && vehAnim != ANIM_VAN_CLOSE && vehAnim != ANIM_VAN_GETIN) {
|
|
|
|
neededPos.z = autoZPos.z;
|
|
|
|
neededPos.z = autoZPos.z;
|
|
|
@ -2047,20 +2114,16 @@ CPed::LineUpPedWithCar(PedLineUpPhase phase)
|
|
|
|
// Smoothly change ped position
|
|
|
|
// Smoothly change ped position
|
|
|
|
neededPos.z = currentZ - (currentZ - neededPos.z) / (m_pVehicleAnim->GetTimeLeft() / adjustedTimeStep);
|
|
|
|
neededPos.z = currentZ - (currentZ - neededPos.z) / (m_pVehicleAnim->GetTimeLeft() / adjustedTimeStep);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#ifdef VC_PED_PORTS
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
// We may need to raise up the ped
|
|
|
|
// We may need to raise up the ped
|
|
|
|
if (phase == LINE_UP_TO_CAR_START) {
|
|
|
|
if (phase == LINE_UP_TO_CAR_START) {
|
|
|
|
currentZ = GetPosition().z;
|
|
|
|
currentZ = GetPosition().z;
|
|
|
|
|
|
|
|
|
|
|
|
if (neededPos.z > currentZ) {
|
|
|
|
if (neededPos.z > currentZ) {
|
|
|
|
#ifdef VC_PED_PORTS
|
|
|
|
|
|
|
|
if (multExtractedFromAnimBus) {
|
|
|
|
if (multExtractedFromAnimBus) {
|
|
|
|
neededPos.z = (neededPos.z - currentZ) * zBlend + currentZ;
|
|
|
|
neededPos.z = (neededPos.z - currentZ) * zBlend + currentZ;
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
#endif
|
|
|
|
|
|
|
|
if (m_pVehicleAnim &&
|
|
|
|
if (m_pVehicleAnim &&
|
|
|
|
(vehAnim == ANIM_CAR_GETIN_RHS || vehAnim == ANIM_CAR_GETIN_LOW_RHS || vehAnim == ANIM_CAR_GETIN_LHS || vehAnim == ANIM_CAR_GETIN_LOW_LHS
|
|
|
|
(vehAnim == ANIM_CAR_GETIN_RHS || vehAnim == ANIM_CAR_GETIN_LOW_RHS || vehAnim == ANIM_CAR_GETIN_LHS || vehAnim == ANIM_CAR_GETIN_LOW_LHS
|
|
|
|
|| vehAnim == ANIM_CAR_QJACK || vehAnim == ANIM_VAN_GETIN_L || vehAnim == ANIM_VAN_GETIN)) {
|
|
|
|
|| vehAnim == ANIM_CAR_QJACK || vehAnim == ANIM_VAN_GETIN_L || vehAnim == ANIM_VAN_GETIN)) {
|
|
|
@ -2068,12 +2131,10 @@ CPed::LineUpPedWithCar(PedLineUpPhase phase)
|
|
|
|
|
|
|
|
|
|
|
|
// Smoothly change ped position
|
|
|
|
// Smoothly change ped position
|
|
|
|
neededPos.z = (neededPos.z - currentZ) / (m_pVehicleAnim->GetTimeLeft() / adjustedTimeStep) + currentZ;
|
|
|
|
neededPos.z = (neededPos.z - currentZ) / (m_pVehicleAnim->GetTimeLeft() / adjustedTimeStep) + currentZ;
|
|
|
|
} else if (EnteringCar()) {
|
|
|
|
} else if (EnteringCar() || m_nPedState == PED_DRIVING && veh->IsBike()) {
|
|
|
|
neededPos.z = Max(currentZ, autoZPos.z);
|
|
|
|
neededPos.z = Max(currentZ, autoZPos.z);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#ifdef VC_PED_PORTS
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -2104,14 +2165,26 @@ CPed::LineUpPedWithCar(PedLineUpPhase phase)
|
|
|
|
m_fRotationCur -= (m_fRotationCur - limitedDest) * (1.0f - timeUntilStateChange);
|
|
|
|
m_fRotationCur -= (m_fRotationCur - limitedDest) * (1.0f - timeUntilStateChange);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (seatPosMult > 0.2f || vehIsUpsideDown) {
|
|
|
|
if (seatPosMult > 0.2f || vehIsUpsideDown || veh->IsBike()) {
|
|
|
|
SetPosition(neededPos);
|
|
|
|
SetPosition(neededPos);
|
|
|
|
|
|
|
|
|
|
|
|
SetHeading(m_fRotationCur);
|
|
|
|
SetHeading(m_fRotationCur);
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
CMatrix vehDoorMat(veh->GetMatrix());
|
|
|
|
CMatrix vehDoorMat(veh->GetMatrix());
|
|
|
|
vehDoorMat.GetPosition() += Multiply3x3(vehDoorMat, GetLocalPositionToOpenCarDoor(veh, m_vehEnterType, 0.0f));
|
|
|
|
vehDoorMat.GetPosition() += Multiply3x3(vehDoorMat, GetLocalPositionToOpenCarDoor(veh, m_vehEnterType, 0.0f));
|
|
|
|
// VC couch anims are inverted, so they're fixing it here.
|
|
|
|
|
|
|
|
|
|
|
|
// Cool huh? Entering from windscreen
|
|
|
|
|
|
|
|
if (m_vehEnterType == CAR_WINDSCREEN || veh->bIsBus) {
|
|
|
|
|
|
|
|
CMatrix correctionMat;
|
|
|
|
|
|
|
|
if (veh->bIsBus && (m_vehEnterType == CAR_DOOR_LF || m_vehEnterType == CAR_DOOR_LR))
|
|
|
|
|
|
|
|
correctionMat.SetRotateZ(-HALFPI);
|
|
|
|
|
|
|
|
else if (veh->bIsBus && (m_vehEnterType == CAR_DOOR_RF || m_vehEnterType == CAR_DOOR_RR))
|
|
|
|
|
|
|
|
correctionMat.SetRotateZ(HALFPI);
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
correctionMat.SetRotateZ(PI);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vehDoorMat = vehDoorMat * correctionMat;
|
|
|
|
|
|
|
|
}
|
|
|
|
GetMatrix() = vehDoorMat;
|
|
|
|
GetMatrix() = vehDoorMat;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -6691,11 +6764,12 @@ CPed::EndFight(uint8 endType)
|
|
|
|
m_nWaitTimer = 0;
|
|
|
|
m_nWaitTimer = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// --MIAMI: Done
|
|
|
|
void
|
|
|
|
void
|
|
|
|
CPed::EnterCar(void)
|
|
|
|
CPed::EnterCar(void)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (IsNotInWreckedVehicle() && m_fHealth > 0.0f) {
|
|
|
|
if (IsNotInWreckedVehicle() && m_fHealth > 0.0f) {
|
|
|
|
CVehicle *veh = (CVehicle*)m_pSeekTarget;
|
|
|
|
CVehicle *veh = m_pMyVehicle;
|
|
|
|
|
|
|
|
|
|
|
|
// Not used.
|
|
|
|
// Not used.
|
|
|
|
// CVector posForDoor = GetPositionToOpenCarDoor(veh, m_vehEnterType);
|
|
|
|
// CVector posForDoor = GetPositionToOpenCarDoor(veh, m_vehEnterType);
|
|
|
@ -6709,9 +6783,32 @@ CPed::EnterCar(void)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
bIsInTheAir = false;
|
|
|
|
bIsInTheAir = false;
|
|
|
|
LineUpPedWithCar(LINE_UP_TO_CAR_START);
|
|
|
|
LineUpPedWithCar(LINE_UP_TO_CAR_START);
|
|
|
|
|
|
|
|
if (veh->IsBike()) {
|
|
|
|
|
|
|
|
CBike *bike = (CBike*)veh;
|
|
|
|
|
|
|
|
if (bike->GetStatus() != STATUS_ABANDONED || bike->m_bike_flag08 || !m_pVehicleAnim) {
|
|
|
|
|
|
|
|
if (m_nPedState == PED_CARJACK && m_pVehicleAnim) {
|
|
|
|
|
|
|
|
if (m_pVehicleAnim->currentTime > 0.4f && m_pVehicleAnim->currentTime - m_pVehicleAnim->timeStep <= 0.4f) {
|
|
|
|
|
|
|
|
int anim = m_pVehicleAnim->animId;
|
|
|
|
|
|
|
|
if (anim == ANIM_BIKE_KICK) {
|
|
|
|
|
|
|
|
DMAudio.PlayOneShot(m_audioEntityId, SOUND_187, 3.0f);
|
|
|
|
|
|
|
|
} else if (anim == ANIM_BIKE_ELBOW_R || anim == ANIM_BIKE_ELBOW_L) {
|
|
|
|
|
|
|
|
DMAudio.PlayOneShot(m_audioEntityId, SOUND_186, 3.0f);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
int anim = m_pVehicleAnim->animId;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// One is pickup and other one is pullup, not same :p
|
|
|
|
|
|
|
|
if ((anim == ANIM_BIKE_PICKUP_R || anim == ANIM_BIKE_PICKUP_L) && m_pVehicleAnim->currentTime > 0.4667f)
|
|
|
|
|
|
|
|
bike->m_bike_flag08 = true;
|
|
|
|
|
|
|
|
else if ((anim == ANIM_BIKE_PULLUP_R || anim == ANIM_BIKE_PULLUP_L) && m_pVehicleAnim->currentTime > 0.4667f)
|
|
|
|
|
|
|
|
bike->m_bike_flag08 = true;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
QuitEnteringCar();
|
|
|
|
QuitEnteringCar();
|
|
|
|
SetDie(ANIM_KO_SHOT_FRONT1, 4.0f, 0.0f);
|
|
|
|
SetDie();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -8570,15 +8667,28 @@ CPed::Initialise(void)
|
|
|
|
debug("CPed ready\n");
|
|
|
|
debug("CPed ready\n");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// --MIAMI: Done
|
|
|
|
void
|
|
|
|
void
|
|
|
|
CPed::SetAnimOffsetForEnterOrExitVehicle(void)
|
|
|
|
CPed::SetAnimOffsetForEnterOrExitVehicle(void)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
// FIX: If there were no translations on enter anims, there were overflows all over this function.
|
|
|
|
// FIX: If there were no translations on enter anims, there were overflows all over this function.
|
|
|
|
|
|
|
|
|
|
|
|
int vanBlock = CAnimManager::GetAnimationBlockIndex("van");
|
|
|
|
int vanBlock = CAnimManager::GetAnimationBlockIndex("van");
|
|
|
|
|
|
|
|
int bikesBlock = CAnimManager::GetAnimationBlockIndex("bikes");
|
|
|
|
|
|
|
|
int bikevBlock = CAnimManager::GetAnimationBlockIndex("bikev");
|
|
|
|
|
|
|
|
int bikehBlock = CAnimManager::GetAnimationBlockIndex("bikeh");
|
|
|
|
|
|
|
|
int bikedBlock = CAnimManager::GetAnimationBlockIndex("biked");
|
|
|
|
CStreaming::RequestAnim(vanBlock, STREAMFLAGS_DEPENDENCY);
|
|
|
|
CStreaming::RequestAnim(vanBlock, STREAMFLAGS_DEPENDENCY);
|
|
|
|
|
|
|
|
CStreaming::RequestAnim(bikesBlock, STREAMFLAGS_DEPENDENCY);
|
|
|
|
|
|
|
|
CStreaming::RequestAnim(bikevBlock, STREAMFLAGS_DEPENDENCY);
|
|
|
|
|
|
|
|
CStreaming::RequestAnim(bikehBlock, STREAMFLAGS_DEPENDENCY);
|
|
|
|
|
|
|
|
CStreaming::RequestAnim(bikedBlock, STREAMFLAGS_DEPENDENCY);
|
|
|
|
CStreaming::LoadAllRequestedModels(false);
|
|
|
|
CStreaming::LoadAllRequestedModels(false);
|
|
|
|
CAnimManager::AddAnimBlockRef(vanBlock);
|
|
|
|
CAnimManager::AddAnimBlockRef(vanBlock);
|
|
|
|
|
|
|
|
CAnimManager::AddAnimBlockRef(bikesBlock);
|
|
|
|
|
|
|
|
CAnimManager::AddAnimBlockRef(bikevBlock);
|
|
|
|
|
|
|
|
CAnimManager::AddAnimBlockRef(bikehBlock);
|
|
|
|
|
|
|
|
CAnimManager::AddAnimBlockRef(bikedBlock);
|
|
|
|
|
|
|
|
|
|
|
|
CAnimBlendHierarchy *enterAssoc = CAnimManager::GetAnimAssociation(ASSOCGRP_STD, ANIM_CAR_JACKED_LHS)->hierarchy;
|
|
|
|
CAnimBlendHierarchy *enterAssoc = CAnimManager::GetAnimAssociation(ASSOCGRP_STD, ANIM_CAR_JACKED_LHS)->hierarchy;
|
|
|
|
CAnimBlendSequence *seq = enterAssoc->sequences;
|
|
|
|
CAnimBlendSequence *seq = enterAssoc->sequences;
|
|
|
@ -8639,8 +8749,8 @@ CPed::SetAnimOffsetForEnterOrExitVehicle(void)
|
|
|
|
vecPedVanRearDoorAnimOffset = lastFrame->translation;
|
|
|
|
vecPedVanRearDoorAnimOffset = lastFrame->translation;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#ifdef GTA_TRAIN
|
|
|
|
// I think this is leftover and ANIM_TRAIN_GETOUT
|
|
|
|
enterAssoc = CAnimManager::GetAnimAssociation(ASSOCGRP_STD, ANIM_TRAIN_GETOUT)->hierarchy;
|
|
|
|
enterAssoc = CAnimManager::GetAnimAssociation(ASSOCGRP_STD, ANIM_IDLE_STANCE3)->hierarchy;
|
|
|
|
seq = enterAssoc->sequences;
|
|
|
|
seq = enterAssoc->sequences;
|
|
|
|
CAnimManager::UncompressAnimation(enterAssoc);
|
|
|
|
CAnimManager::UncompressAnimation(enterAssoc);
|
|
|
|
if (seq->numFrames > 0) {
|
|
|
|
if (seq->numFrames > 0) {
|
|
|
@ -8651,7 +8761,72 @@ CPed::SetAnimOffsetForEnterOrExitVehicle(void)
|
|
|
|
vecPedTrainDoorAnimOffset = lastFrame->translation;
|
|
|
|
vecPedTrainDoorAnimOffset = lastFrame->translation;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
enterAssoc = CAnimManager::GetAnimAssociation(ASSOCGRP_BIKE_STANDARD, ANIM_BIKE_JUMPON_R)->hierarchy;
|
|
|
|
|
|
|
|
seq = enterAssoc->sequences;
|
|
|
|
|
|
|
|
CAnimManager::UncompressAnimation(enterAssoc);
|
|
|
|
|
|
|
|
if (seq->numFrames > 0) {
|
|
|
|
|
|
|
|
if (!seq->HasTranslation())
|
|
|
|
|
|
|
|
vecPedStdBikeJumpRhsAnimOffset = CVector(0.0f, 0.0f, 0.0f);
|
|
|
|
|
|
|
|
else {
|
|
|
|
|
|
|
|
KeyFrameTrans* lastFrame = (KeyFrameTrans*)seq->GetKeyFrame(seq->numFrames - 1);
|
|
|
|
|
|
|
|
vecPedStdBikeJumpRhsAnimOffset = lastFrame->translation;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
enterAssoc = CAnimManager::GetAnimAssociation(ASSOCGRP_BIKE_VESPA, ANIM_BIKE_JUMPON_R)->hierarchy;
|
|
|
|
|
|
|
|
seq = enterAssoc->sequences;
|
|
|
|
|
|
|
|
CAnimManager::UncompressAnimation(enterAssoc);
|
|
|
|
|
|
|
|
if (seq->numFrames > 0) {
|
|
|
|
|
|
|
|
if (!seq->HasTranslation())
|
|
|
|
|
|
|
|
vecPedVespaBikeJumpRhsAnimOffset = CVector(0.0f, 0.0f, 0.0f);
|
|
|
|
|
|
|
|
else {
|
|
|
|
|
|
|
|
KeyFrameTrans* lastFrame = (KeyFrameTrans*)seq->GetKeyFrame(seq->numFrames - 1);
|
|
|
|
|
|
|
|
vecPedVespaBikeJumpRhsAnimOffset = lastFrame->translation;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
enterAssoc = CAnimManager::GetAnimAssociation(ASSOCGRP_BIKE_HARLEY, ANIM_BIKE_JUMPON_R)->hierarchy;
|
|
|
|
|
|
|
|
seq = enterAssoc->sequences;
|
|
|
|
|
|
|
|
CAnimManager::UncompressAnimation(enterAssoc);
|
|
|
|
|
|
|
|
if (seq->numFrames > 0) {
|
|
|
|
|
|
|
|
if (!seq->HasTranslation())
|
|
|
|
|
|
|
|
vecPedHarleyBikeJumpRhsAnimOffset = CVector(0.0f, 0.0f, 0.0f);
|
|
|
|
|
|
|
|
else {
|
|
|
|
|
|
|
|
KeyFrameTrans* lastFrame = (KeyFrameTrans*)seq->GetKeyFrame(seq->numFrames - 1);
|
|
|
|
|
|
|
|
vecPedHarleyBikeJumpRhsAnimOffset = lastFrame->translation;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
enterAssoc = CAnimManager::GetAnimAssociation(ASSOCGRP_BIKE_DIRT, ANIM_BIKE_JUMPON_R)->hierarchy;
|
|
|
|
|
|
|
|
seq = enterAssoc->sequences;
|
|
|
|
|
|
|
|
CAnimManager::UncompressAnimation(enterAssoc);
|
|
|
|
|
|
|
|
if (seq->numFrames > 0) {
|
|
|
|
|
|
|
|
if (!seq->HasTranslation())
|
|
|
|
|
|
|
|
vecPedDirtBikeJumpRhsAnimOffset = CVector(0.0f, 0.0f, 0.0f);
|
|
|
|
|
|
|
|
else {
|
|
|
|
|
|
|
|
KeyFrameTrans* lastFrame = (KeyFrameTrans*)seq->GetKeyFrame(seq->numFrames - 1);
|
|
|
|
|
|
|
|
vecPedDirtBikeJumpRhsAnimOffset = lastFrame->translation;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
enterAssoc = CAnimManager::GetAnimAssociation(ASSOCGRP_BIKE_HARLEY, ANIM_BIKE_KICK)->hierarchy;
|
|
|
|
|
|
|
|
seq = enterAssoc->sequences;
|
|
|
|
|
|
|
|
CAnimManager::UncompressAnimation(enterAssoc);
|
|
|
|
|
|
|
|
if (seq->numFrames > 0) {
|
|
|
|
|
|
|
|
if (!seq->HasTranslation())
|
|
|
|
|
|
|
|
vecPedBikeKickAnimOffset = CVector(0.0f, 0.0f, 0.0f);
|
|
|
|
|
|
|
|
else {
|
|
|
|
|
|
|
|
KeyFrameTrans* lastFrame = (KeyFrameTrans*)seq->GetKeyFrame(seq->numFrames - 1);
|
|
|
|
|
|
|
|
vecPedBikeKickAnimOffset = lastFrame->translation;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
CAnimManager::RemoveAnimBlockRef(vanBlock);
|
|
|
|
|
|
|
|
CAnimManager::RemoveAnimBlockRef(bikesBlock);
|
|
|
|
|
|
|
|
CAnimManager::RemoveAnimBlockRef(bikevBlock);
|
|
|
|
|
|
|
|
CAnimManager::RemoveAnimBlockRef(bikehBlock);
|
|
|
|
|
|
|
|
CAnimManager::RemoveAnimBlockRef(bikedBlock);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
void
|
|
|
@ -9828,7 +10003,7 @@ CPed::ProcessControl(void)
|
|
|
|
++m_panicCounter;
|
|
|
|
++m_panicCounter;
|
|
|
|
|
|
|
|
|
|
|
|
if (m_fHealth <= 1.0f && m_nPedState <= PED_STATES_NO_AI && !bIsInTheAir && !bIsLanding)
|
|
|
|
if (m_fHealth <= 1.0f && m_nPedState <= PED_STATES_NO_AI && !bIsInTheAir && !bIsLanding)
|
|
|
|
SetDie(ANIM_KO_SHOT_FRONT1, 4.0f, 0.0f);
|
|
|
|
SetDie();
|
|
|
|
|
|
|
|
|
|
|
|
bCollidedWithMyVehicle = false;
|
|
|
|
bCollidedWithMyVehicle = false;
|
|
|
|
|
|
|
|
|
|
|
@ -17041,10 +17216,11 @@ CPed::UpdateFromLeader(void)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// --MIAMI: Done
|
|
|
|
void
|
|
|
|
void
|
|
|
|
CPed::UpdatePosition(void)
|
|
|
|
CPed::UpdatePosition(void)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (CReplay::IsPlayingBack() || !bIsStanding)
|
|
|
|
if (CReplay::IsPlayingBack() || !bIsStanding || m_attachedTo)
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
|
|
CVector2D velocityChange;
|
|
|
|
CVector2D velocityChange;
|
|
|
@ -17091,7 +17267,7 @@ CPed::UpdatePosition(void)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Take time step into account
|
|
|
|
// Take time step into account
|
|
|
|
if (m_pCurrentPhysSurface) {
|
|
|
|
if (m_pCurrentPhysSurface && (!m_pCurrentPhysSurface->bInfiniteMass || m_pCurrentPhysSurface->m_phy_flagA08)) {
|
|
|
|
float speedChange = velocityChange.Magnitude();
|
|
|
|
float speedChange = velocityChange.Magnitude();
|
|
|
|
float changeMult = speedChange;
|
|
|
|
float changeMult = speedChange;
|
|
|
|
if (m_nPedState != PED_DIE || !m_pCurrentPhysSurface->IsVehicle()) {
|
|
|
|
if (m_nPedState != PED_DIE || !m_pCurrentPhysSurface->IsVehicle()) {
|
|
|
@ -17109,27 +17285,39 @@ CPed::UpdatePosition(void)
|
|
|
|
m_vecMoveSpeed.y += velocityChange.y;
|
|
|
|
m_vecMoveSpeed.y += velocityChange.y;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// --MIAMI: Done
|
|
|
|
void
|
|
|
|
void
|
|
|
|
CPed::SetPedPositionInCar(void)
|
|
|
|
CPed::SetPedPositionInCar(void)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
bool notYet = false;
|
|
|
|
if (CReplay::IsPlayingBack())
|
|
|
|
if (CReplay::IsPlayingBack())
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
|
|
if (bChangedSeat) {
|
|
|
|
if (bChangedSeat) {
|
|
|
|
bool notYet = false;
|
|
|
|
if (m_pMyVehicle->IsBike()) {
|
|
|
|
if (RpAnimBlendClumpGetAssociation(GetClump(), ANIM_CAR_GETIN_LHS)
|
|
|
|
if (RpAnimBlendClumpGetAssociation(GetClump(), ANIM_BIKE_JUMPON_R)
|
|
|
|
|| RpAnimBlendClumpGetAssociation(GetClump(), ANIM_CAR_GETIN_LOW_LHS)
|
|
|
|
|| RpAnimBlendClumpGetAssociation(GetClump(), ANIM_BIKE_JUMPON_L)
|
|
|
|
|| RpAnimBlendClumpGetAssociation(GetClump(), ANIM_CAR_CLOSEDOOR_LHS)
|
|
|
|
|| RpAnimBlendClumpGetAssociation(GetClump(), ANIM_BIKE_KICK)) {
|
|
|
|
|| RpAnimBlendClumpGetAssociation(GetClump(), ANIM_CAR_CLOSEDOOR_LOW_LHS)
|
|
|
|
LineUpPedWithCar(LINE_UP_TO_CAR_START);
|
|
|
|
|| RpAnimBlendClumpGetAssociation(GetClump(), ANIM_CAR_SHUFFLE_RHS)
|
|
|
|
return;
|
|
|
|
|| RpAnimBlendClumpGetAssociation(GetClump(), ANIM_CAR_LSHUFFLE_RHS)
|
|
|
|
}
|
|
|
|
|| RpAnimBlendClumpGetAssociation(GetClump(), ANIM_VAN_CLOSE_L)
|
|
|
|
bChangedSeat = false;
|
|
|
|
|| RpAnimBlendClumpGetAssociation(GetClump(), ANIM_VAN_CLOSE)
|
|
|
|
} else {
|
|
|
|
|| RpAnimBlendClumpGetAssociation(GetClump(), ANIM_VAN_GETIN_L)
|
|
|
|
if (RpAnimBlendClumpGetAssociation(GetClump(), ANIM_CAR_GETIN_LHS)
|
|
|
|
|| RpAnimBlendClumpGetAssociation(GetClump(), ANIM_VAN_GETIN)
|
|
|
|
|| RpAnimBlendClumpGetAssociation(GetClump(), ANIM_CAR_GETIN_LOW_LHS)
|
|
|
|
|| RpAnimBlendClumpGetAssociation(GetClump(), ANIM_COACH_IN_L)
|
|
|
|
|| RpAnimBlendClumpGetAssociation(GetClump(), ANIM_CAR_CLOSEDOOR_LHS)
|
|
|
|
|| RpAnimBlendClumpGetAssociation(GetClump(), ANIM_COACH_IN_R)) {
|
|
|
|
|| RpAnimBlendClumpGetAssociation(GetClump(), ANIM_CAR_CLOSEDOOR_LOW_LHS)
|
|
|
|
notYet = true;
|
|
|
|
|| RpAnimBlendClumpGetAssociation(GetClump(), ANIM_CAR_SHUFFLE_RHS)
|
|
|
|
|
|
|
|
|| RpAnimBlendClumpGetAssociation(GetClump(), ANIM_CAR_LSHUFFLE_RHS)
|
|
|
|
|
|
|
|
|| RpAnimBlendClumpGetAssociation(GetClump(), ANIM_VAN_CLOSE_L)
|
|
|
|
|
|
|
|
|| RpAnimBlendClumpGetAssociation(GetClump(), ANIM_VAN_CLOSE)
|
|
|
|
|
|
|
|
|| RpAnimBlendClumpGetAssociation(GetClump(), ANIM_VAN_GETIN_L)
|
|
|
|
|
|
|
|
|| RpAnimBlendClumpGetAssociation(GetClump(), ANIM_VAN_GETIN)
|
|
|
|
|
|
|
|
|| RpAnimBlendClumpGetAssociation(GetClump(), ANIM_COACH_IN_L)
|
|
|
|
|
|
|
|
|| RpAnimBlendClumpGetAssociation(GetClump(), ANIM_COACH_IN_R)
|
|
|
|
|
|
|
|
|| RpAnimBlendClumpGetAssociation(GetClump(), ANIM_CAR_JUMPIN_LHS)) {
|
|
|
|
|
|
|
|
notYet = true;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (notYet) {
|
|
|
|
if (notYet) {
|
|
|
|
LineUpPedWithCar(LINE_UP_TO_CAR_START);
|
|
|
|
LineUpPedWithCar(LINE_UP_TO_CAR_START);
|
|
|
@ -17142,14 +17330,16 @@ CPed::SetPedPositionInCar(void)
|
|
|
|
CVector seatPos;
|
|
|
|
CVector seatPos;
|
|
|
|
if (m_pMyVehicle->pDriver == this) {
|
|
|
|
if (m_pMyVehicle->pDriver == this) {
|
|
|
|
seatPos = vehModel->GetFrontSeatPosn();
|
|
|
|
seatPos = vehModel->GetFrontSeatPosn();
|
|
|
|
if (!m_pMyVehicle->IsBoat() && m_pMyVehicle->m_vehType != VEHICLE_TYPE_BIKE)
|
|
|
|
if (!m_pMyVehicle->IsBoat() && !m_pMyVehicle->IsBike())
|
|
|
|
seatPos.x = -seatPos.x;
|
|
|
|
seatPos.x = -seatPos.x;
|
|
|
|
|
|
|
|
|
|
|
|
} else if (m_pMyVehicle->pPassengers[0] == this) {
|
|
|
|
} else if (m_pMyVehicle->pPassengers[0] == this) {
|
|
|
|
seatPos = vehModel->GetFrontSeatPosn();
|
|
|
|
seatPos = m_pMyVehicle->IsBike() ? vehModel->m_positions[CAR_POS_BACKSEAT]: vehModel->GetFrontSeatPosn();
|
|
|
|
|
|
|
|
|
|
|
|
} else if (m_pMyVehicle->pPassengers[1] == this) {
|
|
|
|
} else if (m_pMyVehicle->pPassengers[1] == this) {
|
|
|
|
seatPos = vehModel->m_positions[CAR_POS_BACKSEAT];
|
|
|
|
seatPos = vehModel->m_positions[CAR_POS_BACKSEAT];
|
|
|
|
seatPos.x = -seatPos.x;
|
|
|
|
seatPos.x = -seatPos.x;
|
|
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
if (m_pMyVehicle->pPassengers[2] == this) {
|
|
|
|
if (m_pMyVehicle->pPassengers[2] == this) {
|
|
|
|
seatPos = vehModel->m_positions[CAR_POS_BACKSEAT];
|
|
|
|
seatPos = vehModel->m_positions[CAR_POS_BACKSEAT];
|
|
|
@ -17157,6 +17347,10 @@ CPed::SetPedPositionInCar(void)
|
|
|
|
seatPos = vehModel->GetFrontSeatPosn();
|
|
|
|
seatPos = vehModel->GetFrontSeatPosn();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (m_pMyVehicle->IsBike()) {
|
|
|
|
|
|
|
|
((CBike*)m_pMyVehicle)->CalculateLeanMatrix();
|
|
|
|
|
|
|
|
newMat = ((CBike*)m_pMyVehicle)->m_leanMatrix;
|
|
|
|
|
|
|
|
}
|
|
|
|
newMat.GetPosition() += Multiply3x3(newMat, seatPos);
|
|
|
|
newMat.GetPosition() += Multiply3x3(newMat, seatPos);
|
|
|
|
// Already done below (SetTranslate(0.0f, 0.0f, 0.0f))
|
|
|
|
// Already done below (SetTranslate(0.0f, 0.0f, 0.0f))
|
|
|
|
// tempMat.SetUnity();
|
|
|
|
// tempMat.SetUnity();
|
|
|
@ -18266,10 +18460,8 @@ CPed::AddInCarAnims(CVehicle* car, bool isDriver)
|
|
|
|
} else if (car->IsBike()) {
|
|
|
|
} else if (car->IsBike()) {
|
|
|
|
if (isDriver) {
|
|
|
|
if (isDriver) {
|
|
|
|
m_pVehicleAnim = CAnimManager::BlendAnimation(GetClump(), ((CBike*)car)->m_bikeAnimType, ANIM_BIKE_RIDE, 100.0f);
|
|
|
|
m_pVehicleAnim = CAnimManager::BlendAnimation(GetClump(), ((CBike*)car)->m_bikeAnimType, ANIM_BIKE_RIDE, 100.0f);
|
|
|
|
StopNonPartialAnims();
|
|
|
|
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
m_pVehicleAnim = CAnimManager::BlendAnimation(GetClump(), ((CBike*)car)->m_bikeAnimType, ANIM_BIKE_PASSENGER, 100.0f);
|
|
|
|
m_pVehicleAnim = CAnimManager::BlendAnimation(GetClump(), ((CBike*)car)->m_bikeAnimType, ANIM_BIKE_PASSENGER, 100.0f);
|
|
|
|
StopNonPartialAnims();
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
if (isDriver) {
|
|
|
|
if (isDriver) {
|
|
|
@ -18509,6 +18701,7 @@ CPed::PedShuffle(void)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// --MIAMI: Bike part is done
|
|
|
|
void
|
|
|
|
void
|
|
|
|
CPed::DriveVehicle(void)
|
|
|
|
CPed::DriveVehicle(void)
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -18517,8 +18710,203 @@ CPed::DriveVehicle(void)
|
|
|
|
|
|
|
|
|
|
|
|
CVehicle *veh = m_pMyVehicle;
|
|
|
|
CVehicle *veh = m_pMyVehicle;
|
|
|
|
if (veh->IsBike()) {
|
|
|
|
if (veh->IsBike()) {
|
|
|
|
|
|
|
|
CBike *bike = (CBike*)veh;
|
|
|
|
|
|
|
|
float blendDelta = 1.0f;
|
|
|
|
|
|
|
|
float targetUDLean = 0.0f;
|
|
|
|
|
|
|
|
CAnimBlendAssociation *leftAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_BIKE_LEFT);
|
|
|
|
|
|
|
|
CAnimBlendAssociation *rightAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_BIKE_RIGHT);
|
|
|
|
|
|
|
|
CAnimBlendAssociation *stillAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_BIKE_STILL);
|
|
|
|
|
|
|
|
CAnimBlendAssociation *fwdAssoc, *backAssoc;
|
|
|
|
|
|
|
|
if (IsPlayer()) {
|
|
|
|
|
|
|
|
fwdAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_BIKE_FWD);
|
|
|
|
|
|
|
|
backAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_BIKE_BACK);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
CAnimBlendAssociation *walkbackAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_BIKE_PUSHES);
|
|
|
|
|
|
|
|
CAnimBlendAssociation *drivebyAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_BIKE_DRIVEBY_RHS);
|
|
|
|
|
|
|
|
if (!drivebyAssoc)
|
|
|
|
|
|
|
|
drivebyAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_BIKE_DRIVEBY_LHS);
|
|
|
|
|
|
|
|
if (!drivebyAssoc)
|
|
|
|
|
|
|
|
drivebyAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_BIKE_DRIVEBY_FT);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
float velocityFwdDotProd = DotProduct(bike->m_vecMoveSpeed, bike->GetForward());
|
|
|
|
|
|
|
|
if (m_vecTurnSpeed.MagnitudeSqr() > 0.09f) {
|
|
|
|
|
|
|
|
// TODO(Miami)
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
|
|
|
bike->KnockOffRider(walkbackAssoc, 44, 2, this, 0);
|
|
|
|
|
|
|
|
if (bike->pPassengers[0])
|
|
|
|
|
|
|
|
bike->KnockOffRider(walkbackAssoc, 44, 2, bike->pPassengers[0], 0);
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!drivebyAssoc && Abs(velocityFwdDotProd) < 0.02f) {
|
|
|
|
|
|
|
|
if (!stillAssoc || stillAssoc->blendAmount < 1.0 && stillAssoc->blendDelta <= 0.0) {
|
|
|
|
|
|
|
|
stillAssoc = CAnimManager::BlendAnimation(GetClump(), bike->m_bikeAnimType, ANIM_BIKE_STILL, 2.0f);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
if (velocityFwdDotProd >= 0.0f) {
|
|
|
|
|
|
|
|
if (stillAssoc && stillAssoc->blendDelta >= 0.0f)
|
|
|
|
|
|
|
|
stillAssoc->blendDelta = -4.0f;
|
|
|
|
|
|
|
|
if (walkbackAssoc && walkbackAssoc->blendDelta >= 0.0f)
|
|
|
|
|
|
|
|
walkbackAssoc->blendDelta = -4.0f;
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
float maxReverseSpeed = bike->pHandling->Transmission.fMaxReverseVelocity;
|
|
|
|
|
|
|
|
if (3.5f * maxReverseSpeed > velocityFwdDotProd && (bike->m_nWheelsOnGround || bike->GetUp().z < -0.5f)) {
|
|
|
|
|
|
|
|
// TODO(Miami)
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
|
|
|
bike->KnockOffRider(walkbackAssoc, 44, 2, this, 0);
|
|
|
|
|
|
|
|
if (bike->pPassengers[0])
|
|
|
|
|
|
|
|
bike->KnockOffRider(walkbackAssoc, 44, 2, bike->pPassengers[0], 0);
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (bike->m_fGasPedal >= 0.0 || velocityFwdDotProd <= maxReverseSpeed * 1.5) {
|
|
|
|
|
|
|
|
if (IsPlayer() && velocityFwdDotProd < maxReverseSpeed * 1.5)
|
|
|
|
|
|
|
|
targetUDLean = -1.0f;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (stillAssoc && stillAssoc->blendDelta >= 0.0f)
|
|
|
|
|
|
|
|
stillAssoc->blendDelta = -4.0f;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (walkbackAssoc && walkbackAssoc->blendDelta >= 0.0f) {
|
|
|
|
|
|
|
|
walkbackAssoc->blendDelta = -4.0f;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
} else if (!walkbackAssoc || walkbackAssoc->blendAmount < 1.0f && walkbackAssoc->blendDelta <= 0.0f) {
|
|
|
|
|
|
|
|
walkbackAssoc = CAnimManager::BlendAnimation(GetClump(), bike->m_bikeAnimType, ANIM_BIKE_PUSHES, 4.0f);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (stillAssoc)
|
|
|
|
|
|
|
|
blendDelta -= Min(1.0f, CTimer::GetTimeStepNonClipped() * 0.02f * stillAssoc->blendDelta + stillAssoc->blendAmount);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (drivebyAssoc)
|
|
|
|
|
|
|
|
blendDelta -= Min(blendDelta, CTimer::GetTimeStepNonClipped() * 0.02f * drivebyAssoc->blendDelta + drivebyAssoc->blendAmount);
|
|
|
|
|
|
|
|
|
|
|
|
// TODO(Miami): Bikes
|
|
|
|
if (walkbackAssoc)
|
|
|
|
|
|
|
|
blendDelta -= Min(blendDelta, CTimer::GetTimeStepNonClipped() * 0.02f * walkbackAssoc->blendDelta + walkbackAssoc->blendAmount);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
float targetLRLean, timeBlend, neededAngForWheelie, stoppieAng;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Smooth the lean amount
|
|
|
|
|
|
|
|
if (targetUDLean == -1.0f) {
|
|
|
|
|
|
|
|
targetLRLean = 0.0f;
|
|
|
|
|
|
|
|
timeBlend = Pow(0.86f, CTimer::GetTimeStep());
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
targetLRLean = clamp(bike->m_fLeanLRAngle / bike->pBikeHandling->fFullAnimLean, -1.0f, 1.0f);
|
|
|
|
|
|
|
|
timeBlend = Pow(0.86f, CTimer::GetTimeStep());
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bike->m_fPedLeanAmountLR = bike->m_fPedLeanAmountLR * timeBlend + (1.0 - timeBlend) * targetLRLean;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!IsPlayer()) {
|
|
|
|
|
|
|
|
targetUDLean = 0.0f;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} else if (targetUDLean > -1.0f) {
|
|
|
|
|
|
|
|
targetUDLean = bike->m_fLeanInput;
|
|
|
|
|
|
|
|
bike->m_bike_flag80 = false;
|
|
|
|
|
|
|
|
neededAngForWheelie = 1.0f;
|
|
|
|
|
|
|
|
if (bike->m_aWheelTimer[0] != 0.0f || bike->m_aWheelTimer[1] != 0.0f || bike->GetForward().z <= 0.0f ||
|
|
|
|
|
|
|
|
(0.0f == bike->m_aWheelTimer[2] && 0.0f == bike->m_aWheelTimer[3])) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (0.0f == bike->m_aWheelTimer[2] && 0.0f == bike->m_aWheelTimer[3] &&
|
|
|
|
|
|
|
|
(bike->GetForward().y < 0.0f && (bike->m_aWheelTimer[0] != 0.0f || bike->m_aWheelTimer[1] != 0.0f))) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
stoppieAng = bike->pBikeHandling->fStoppieAng;
|
|
|
|
|
|
|
|
if (stoppieAng - bike->GetForward().z > 0.6f * stoppieAng)
|
|
|
|
|
|
|
|
bike->m_bike_flag80 = true;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
float wheelieAng = bike->pBikeHandling->fWheelieAng;
|
|
|
|
|
|
|
|
neededAngForWheelie = wheelieAng - bike->GetForward().z;
|
|
|
|
|
|
|
|
if (neededAngForWheelie < wheelieAng / 2.f)
|
|
|
|
|
|
|
|
bike->m_bike_flag80 = true;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (neededAngForWheelie >= 0.15f) {
|
|
|
|
|
|
|
|
if (bike->m_fBrakePedal <= 0.5f || velocityFwdDotProd <= 0.01f) {
|
|
|
|
|
|
|
|
if (bike->m_fGasPedal > 0.5f && targetUDLean <= 0.0f && 0.3f * bike->pHandling->Transmission.fUnkMaxVelocity > velocityFwdDotProd) {
|
|
|
|
|
|
|
|
targetUDLean = Min(0.1f, targetUDLean);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
targetUDLean = Max(0.1f, targetUDLean);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
targetUDLean = Max(0.25f, targetUDLean);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
float targetLRLeanABS = Abs(targetLRLean);
|
|
|
|
|
|
|
|
if (targetLRLeanABS > 0.3f) {
|
|
|
|
|
|
|
|
// Yes, UD
|
|
|
|
|
|
|
|
targetUDLean *= Max(0.0f, 1.0f - (targetLRLeanABS - 0.3f) * 50.f / 13.f);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (IsPlayer()) {
|
|
|
|
|
|
|
|
float timeBlend = Pow(0.89f, CTimer::GetTimeStep());
|
|
|
|
|
|
|
|
bike->m_fPedLeanAmountUD = (timeBlend * bike->m_fPedLeanAmountUD) + ((1.0f - timeBlend) * targetUDLean);
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
bike->m_fPedLeanAmountUD = 0.0f;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
float fwdBackLeanAmount, leftRightLeanAmount;
|
|
|
|
|
|
|
|
if (Abs(bike->m_fPedLeanAmountLR) <= 0.56f && IsPlayer()) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (Abs(bike->m_fPedLeanAmountUD) <= 0.56f) {
|
|
|
|
|
|
|
|
CVector2D smoothedLean(bike->m_fPedLeanAmountLR, bike->m_fPedLeanAmountUD);
|
|
|
|
|
|
|
|
float smoothLeanMag = smoothedLean.Magnitude();
|
|
|
|
|
|
|
|
if (smoothLeanMag <= 0.01f) {
|
|
|
|
|
|
|
|
fwdBackLeanAmount = Abs(smoothedLean.y);
|
|
|
|
|
|
|
|
leftRightLeanAmount = Abs(smoothedLean.x);
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
fwdBackLeanAmount = Abs(smoothedLean.y / smoothLeanMag);
|
|
|
|
|
|
|
|
leftRightLeanAmount = Abs(smoothedLean.x / smoothLeanMag);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
fwdBackLeanAmount = 1.0f;
|
|
|
|
|
|
|
|
leftRightLeanAmount = 0.0f;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
fwdBackLeanAmount = 0.0f;
|
|
|
|
|
|
|
|
leftRightLeanAmount = 1.0f;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
float fwdBackBlend = fwdBackLeanAmount * blendDelta;
|
|
|
|
|
|
|
|
float leftRightBlend = leftRightLeanAmount * blendDelta;
|
|
|
|
|
|
|
|
if (IsPlayer()) {
|
|
|
|
|
|
|
|
if (!fwdAssoc)
|
|
|
|
|
|
|
|
fwdAssoc = CAnimManager::AddAnimation(GetClump(), bike->m_bikeAnimType, ANIM_BIKE_FWD);
|
|
|
|
|
|
|
|
if (!backAssoc)
|
|
|
|
|
|
|
|
backAssoc = CAnimManager::AddAnimation(GetClump(), bike->m_bikeAnimType, ANIM_BIKE_BACK);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (bike->m_fPedLeanAmountUD < 0.0f) {
|
|
|
|
|
|
|
|
backAssoc->blendAmount = fwdBackBlend;
|
|
|
|
|
|
|
|
backAssoc->SetCurrentTime(-(bike->m_fPedLeanAmountUD * backAssoc->hierarchy->totalLength));
|
|
|
|
|
|
|
|
backAssoc->flags &= ~ASSOC_RUNNING;
|
|
|
|
|
|
|
|
fwdAssoc->blendAmount = 0.0f;
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
fwdAssoc->blendAmount = fwdBackBlend;
|
|
|
|
|
|
|
|
fwdAssoc->SetCurrentTime(bike->m_fPedLeanAmountUD* fwdAssoc->hierarchy->totalLength);
|
|
|
|
|
|
|
|
fwdAssoc->flags &= ~ASSOC_RUNNING;
|
|
|
|
|
|
|
|
backAssoc->blendAmount = 0.0f;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!leftAssoc)
|
|
|
|
|
|
|
|
leftAssoc = CAnimManager::AddAnimation(GetClump(), bike->m_bikeAnimType, ANIM_BIKE_LEFT);
|
|
|
|
|
|
|
|
if (!rightAssoc)
|
|
|
|
|
|
|
|
rightAssoc = CAnimManager::AddAnimation(GetClump(), bike->m_bikeAnimType, ANIM_BIKE_RIGHT);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (bike->m_fPedLeanAmountLR < 0.0f) {
|
|
|
|
|
|
|
|
leftAssoc->blendAmount = leftRightBlend;
|
|
|
|
|
|
|
|
leftAssoc->SetCurrentTime(-(bike->m_fPedLeanAmountLR * leftAssoc->hierarchy->totalLength));
|
|
|
|
|
|
|
|
leftAssoc->flags &= ~ASSOC_RUNNING;
|
|
|
|
|
|
|
|
rightAssoc->blendAmount = 0.0f;
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
rightAssoc->blendAmount = leftRightBlend;
|
|
|
|
|
|
|
|
rightAssoc->SetCurrentTime(bike->m_fPedLeanAmountLR* rightAssoc->hierarchy->totalLength);
|
|
|
|
|
|
|
|
rightAssoc->flags &= ~ASSOC_RUNNING;
|
|
|
|
|
|
|
|
leftAssoc->blendAmount = 0.0f;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (velocityFwdDotProd > 0.3f) {
|
|
|
|
|
|
|
|
RwV3d Xaxis = { 1.0f, 0.0f, 0.0f };
|
|
|
|
|
|
|
|
RwV3d Yaxis = { 0.0f, 1.0f, 0.0f };
|
|
|
|
|
|
|
|
RtQuatRotate(&m_pFrames[PED_HEAD]->hanimFrame->q, &Xaxis, CGeneral::GetRandomNumberInRange(-6.0f * velocityFwdDotProd, 6.0f * velocityFwdDotProd), rwCOMBINEPOSTCONCAT);
|
|
|
|
|
|
|
|
RtQuatRotate(&m_pFrames[PED_HEAD]->hanimFrame->q, &Yaxis, CGeneral::GetRandomNumberInRange(-6.0f * velocityFwdDotProd, 6.0f * velocityFwdDotProd), rwCOMBINEPOSTCONCAT);
|
|
|
|
|
|
|
|
bDontAcceptIKLookAts = true;
|
|
|
|
|
|
|
|
}
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|