Upper Body Angle (#292)

* constrain angles on specialized yaw and pitch fields

* integrated new Angular Codec into OCM and OCDM of avatar; corrected tests; wrote shortcut for whether a unit is moving (under its own power)

* apply clamp

* Accessed containers while moving

Removed unintentional code duplication outside of conditional.
This commit is contained in:
Fate-JH 2019-11-29 11:14:25 -05:00 committed by GitHub
parent 9e99dc75e3
commit a5a85e6cc3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
18 changed files with 209 additions and 108 deletions

View file

@ -15,9 +15,9 @@ class PlayerStateMessageUpstreamTest extends Specification {
case PlayerStateMessageUpstream(avatar_guid, pos, vel, facingYaw, facingPitch, facingYawUpper, seq_time, unk1, is_crouching, is_jumping, jump_thrust, is_cloaked, unk2, unk3) =>
avatar_guid mustEqual PlanetSideGUID(75)
pos mustEqual Vector3(3694.1094f, 2735.4531f, 90.84375f)
vel mustEqual Some(Vector3(4.375f, 2.59375f, 0.0f))
vel.contains(Vector3(4.375f, 2.59375f, 0.0f)) mustEqual true
facingYaw mustEqual 61.875f
facingPitch mustEqual 351.5625f
facingPitch mustEqual -8.4375f
facingYawUpper mustEqual 0.0f
seq_time mustEqual 136
unk1 mustEqual 0
@ -33,7 +33,7 @@ class PlayerStateMessageUpstreamTest extends Specification {
}
"encode" in {
val msg = PlayerStateMessageUpstream(PlanetSideGUID(75), Vector3(3694.1094f, 2735.4531f, 90.84375f), Some(Vector3(4.375f, 2.59375f, 0.0f)), 61.875f, 351.5625f, 0.0f, 136, 0, false, false, false, false, 112, 0)
val msg = PlayerStateMessageUpstream(PlanetSideGUID(75), Vector3(3694.1094f, 2735.4531f, 90.84375f), Some(Vector3(4.375f, 2.59375f, 0.0f)), 61.875f, -8.4375f, 0.0f, 136, 0, false, false, false, false, 112, 0)
val pkt = PacketCoding.EncodePacket(msg).require.toByteVector
pkt mustEqual string