fix pack/unpack data for AIControllerData's (though we still send nothing, we do need to mark it clientside as false)

more pitchwork for flying vehicle drivers
when flocking is irrelevant just path to next node
This commit is contained in:
AzaezelX 2025-04-25 18:50:16 -05:00
parent 6efb3843f6
commit 675bdfe6b3
4 changed files with 20 additions and 17 deletions

View file

@ -777,17 +777,18 @@ void AIFlyingVehicleControllerData::resolvePitch(AIController* obj, Point3F loca
Point3F toTarg = location - aimLoc;
toTarg.normalize();
F32 lastPitch = fvo->getSteering().y;
movePtr->pitch = 0.0f;
F32 dotPitch = -mDot(up, toTarg);
F32 dotPitch = mDot(up, toTarg);
FlyingVehicleData* db = static_cast<FlyingVehicleData*>(fvo->getDataBlock());
F32 rollAmt = mFabs(fvo->getThrottle()* movePtr->yaw * db->steeringRollForce);
F32 rollAmt = mFabs(fvo->getThrottle()* movePtr->yaw / (db->steeringRollForce+1.0));
dotPitch *= 1.0-(mClampF(rollAmt, 0.0,1.0)); // reduce pitch by how much we're rolling
dotPitch *= M_PI_F;
dotPitch *= M_2PI_F;
if (mFabs(dotPitch) > 0.05f)
movePtr->pitch = dotPitch - lastPitch;
movePtr->pitch = dotPitch;
}
@ -803,9 +804,7 @@ void AIFlyingVehicleControllerData::resolveSpeed(AIController* obj, Point3F loca
}
if (!fvo) return;//not a FlyingVehicle
Parent::resolveSpeed(obj, location, movePtr);
movePtr->x = 0;
movePtr->y = mMax(movePtr->y, 0.0f);
movePtr->y = obj->mMovement.mMoveSpeed;
}
#endif //_AICONTROLLER_H_