Improve wired movement rendering and follow sync

This commit is contained in:
Lorenzune
2026-03-25 03:26:27 +01:00
parent 35e7dd9560
commit 296df767ba
8 changed files with 631 additions and 361 deletions
@@ -9,7 +9,7 @@ export class ObjectAvatarUpdateMessage extends ObjectMoveUpdateMessage
constructor(location: IVector3D, targetLocation: IVector3D, direction: IVector3D, headDirection: number, canStandUp: boolean, baseY: number, isSlide: boolean = false, duration: number = ObjectMoveUpdateMessage.DEFAULT_DURATION)
{
super(location, targetLocation, direction, isSlide, duration);
super(location, targetLocation, direction, isSlide, duration, 0);
this._headDirection = headDirection;
this._canStandUp = canStandUp;
@@ -1,4 +1,4 @@
import { IVector3D } from '@nitrots/api';
import { IRoomObjectController, IVector3D } from '@nitrots/api';
import { RoomObjectUpdateMessage } from './RoomObjectUpdateMessage';
export class ObjectMoveUpdateMessage extends RoomObjectUpdateMessage
@@ -8,14 +8,20 @@ export class ObjectMoveUpdateMessage extends RoomObjectUpdateMessage
private _targetLocation: IVector3D;
private _isSlide: boolean;
private _duration: number;
private _elapsed: number;
private _anchorObject: IRoomObjectController;
private _anchorOffset: IVector3D;
constructor(location: IVector3D, targetLocation: IVector3D, direction: IVector3D, isSlide: boolean = false, duration: number = ObjectMoveUpdateMessage.DEFAULT_DURATION)
constructor(location: IVector3D, targetLocation: IVector3D, direction: IVector3D, isSlide: boolean = false, duration: number = ObjectMoveUpdateMessage.DEFAULT_DURATION, elapsed: number = 0, anchorObject: IRoomObjectController = null, anchorOffset: IVector3D = null)
{
super(location, direction);
this._targetLocation = targetLocation;
this._isSlide = isSlide;
this._duration = duration;
this._elapsed = elapsed;
this._anchorObject = anchorObject;
this._anchorOffset = anchorOffset;
}
public get targetLocation(): IVector3D
@@ -34,4 +40,19 @@ export class ObjectMoveUpdateMessage extends RoomObjectUpdateMessage
{
return this._duration;
}
public get elapsed(): number
{
return this._elapsed;
}
public get anchorObject(): IRoomObjectController
{
return this._anchorObject;
}
public get anchorOffset(): IVector3D
{
return this._anchorOffset;
}
}