Passenger/driver sit still in moving cars: seat pose sent relative to the vehicle (backward-compatible), no backward pull; remote cars/traffic extrapolate in physics time and interpolate; UI polish (shadows, borders, gradient buttons, server list hover, fill bars, colored ping)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
33a415139b
commit
ce2fbdfc10
+18
-1
@@ -1789,6 +1789,10 @@ namespace MSCO
|
||||
if (p.Avatar == null) continue;
|
||||
try
|
||||
{
|
||||
// Sitzt der Mitspieler in einem Fahrzeug, die Figur an unsere Kopie dieses Fahrzeugs hängen
|
||||
int seatId = p.Avatar.LastState.SeatId;
|
||||
SyncedBody seat = seatId != 0 ? objects.Get(seatId) : null;
|
||||
p.Avatar.Seat = seat != null && seat.Rb != null && seat.IsVehicle ? seat.Rb.transform : null;
|
||||
p.Avatar.Tick(Time.unscaledDeltaTime);
|
||||
|
||||
// Gehaltenes Item an die Hand der Figur setzen
|
||||
@@ -2057,9 +2061,22 @@ namespace MSCO
|
||||
CamRot = head.rotation,
|
||||
Seated = passenger.IsRiding || objects.IsDriving,
|
||||
FeetY = GroundBelowPlayer(head.position),
|
||||
HeldLocalRot = Quaternion.identity
|
||||
HeldLocalRot = Quaternion.identity,
|
||||
SeatView = Quaternion.identity
|
||||
};
|
||||
|
||||
// Im Fahrzeug: Kopf und Blick relativ zum Fahrzeug mitschicken
|
||||
SyncedBody seat = passenger.IsRiding ? passenger.Vehicle : objects.Driven;
|
||||
if (seat != null && seat.Rb != null)
|
||||
{
|
||||
Transform vt = seat.Rb.transform;
|
||||
state.SeatId = seat.Id;
|
||||
// Beifahrer: der Sitz ist bekannt - die Weltposition stammt noch vom letzten Frame, das Auto ist seitdem
|
||||
// weitergefahren (bei Tempo ein halber Meter)
|
||||
state.SeatHead = passenger.IsRiding ? passenger.SeatHeadLocal : vt.InverseTransformPoint(head.position);
|
||||
state.SeatView = Quaternion.Inverse(vt.rotation) * head.rotation;
|
||||
}
|
||||
|
||||
SyncedBody held = objects.Held;
|
||||
if (held != null)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user