mirror of
https://github.com/RandomityGuy/MBHaxe.git
synced 2025-10-30 08:11:25 +00:00
replay fixes and network last contact normal
This commit is contained in:
parent
aedffdc2c3
commit
9b8b908524
3 changed files with 10 additions and 0 deletions
|
|
@ -2068,6 +2068,7 @@ class Marble extends GameObject {
|
|||
marbleUpdate.position = this.newPos;
|
||||
marbleUpdate.velocity = this.velocity;
|
||||
marbleUpdate.omega = this.omega;
|
||||
marbleUpdate.lastContactNormal = this.lastContactNormal;
|
||||
marbleUpdate.move = move;
|
||||
marbleUpdate.moveQueueSize = this.connection != null ? this.connection.moveManager.getQueueSize() : 255;
|
||||
marbleUpdate.blastAmount = this.blastTicks;
|
||||
|
|
@ -2106,6 +2107,7 @@ class Marble extends GameObject {
|
|||
this.collider.transform.setPosition(p.position);
|
||||
this.velocity = p.velocity;
|
||||
this.omega = p.omega;
|
||||
this.lastContactNormal = p.lastContactNormal;
|
||||
this.blastTicks = p.blastAmount;
|
||||
this.blastUseTick = p.blastTick;
|
||||
this.helicopterUseTick = p.heliTick;
|
||||
|
|
@ -2384,6 +2386,8 @@ class Marble extends GameObject {
|
|||
move = level.currentInputMoves[1].move;
|
||||
|
||||
if (this.level.isWatching) {
|
||||
move = new Move();
|
||||
move.d = new Vector(0, 0);
|
||||
if (this.level.replay.currentPlaybackFrame.marbleStateFlags.has(Jumped))
|
||||
move.jump = true;
|
||||
if (this.level.replay.currentPlaybackFrame.marbleStateFlags.has(UsedPowerup))
|
||||
|
|
|
|||
|
|
@ -85,6 +85,7 @@ class ReplayFrame {
|
|||
interpFrame.marbleVelocity = Util.lerpThreeVectors(this.marbleVelocity, next.marbleVelocity, t);
|
||||
interpFrame.marbleOrientation = new Quat();
|
||||
interpFrame.marbleOrientation.slerp(this.marbleOrientation, next.marbleOrientation, t);
|
||||
interpFrame.marbleOrientation.normalize();
|
||||
interpFrame.marbleAngularVelocity = Util.lerpThreeVectors(this.marbleAngularVelocity, next.marbleAngularVelocity, t);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -62,6 +62,7 @@ class MarbleUpdatePacket implements NetPacket {
|
|||
var position:Vector;
|
||||
var velocity:Vector;
|
||||
var omega:Vector;
|
||||
var lastContactNormal:Vector;
|
||||
var blastAmount:Int;
|
||||
var blastTick:Int;
|
||||
var megaTick:Int;
|
||||
|
|
@ -93,6 +94,9 @@ class MarbleUpdatePacket implements NetPacket {
|
|||
b.writeFloat(omega.x);
|
||||
b.writeFloat(omega.y);
|
||||
b.writeFloat(omega.z);
|
||||
b.writeFloat(lastContactNormal.x);
|
||||
b.writeFloat(lastContactNormal.y);
|
||||
b.writeFloat(lastContactNormal.z);
|
||||
b.writeInt(blastAmount, 11);
|
||||
if (netFlags & MarbleNetFlags.DoBlast > 0) {
|
||||
b.writeFlag(true);
|
||||
|
|
@ -172,6 +176,7 @@ class MarbleUpdatePacket implements NetPacket {
|
|||
position = new Vector(b.readFloat(), b.readFloat(), b.readFloat());
|
||||
velocity = new Vector(b.readFloat(), b.readFloat(), b.readFloat());
|
||||
omega = new Vector(b.readFloat(), b.readFloat(), b.readFloat());
|
||||
lastContactNormal = new Vector(b.readFloat(), b.readFloat(), b.readFloat());
|
||||
blastAmount = b.readInt(11);
|
||||
this.netFlags = 0;
|
||||
if (b.readFlag()) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue