fleshed out field details of COSM

This commit is contained in:
FateJH 2017-04-20 08:37:51 -04:00
parent 49880ce476
commit 749d2d2c50
2 changed files with 21 additions and 6 deletions

View file

@ -5,9 +5,21 @@ import net.psforever.packet.{GamePacketOpcode, Marshallable, PlanetSideGamePacke
import scodec.Codec
import scodec.codecs._
final case class ChildObjectStateMessage(unk1 : Int,
unk2 : Int,
unk3 : Int)
/**
* na
* @param object_guid the object being manipulated (controlled)
* @param pitch the angle with respect to the sky and the ground towards which the object is directed;
* an 8-bit unsigned value;
* 0 is perfectly level and forward-facing, wrapping around at 255;
* positive rotation is occurs by rotating downwards from forward-facing
* @param yaw the angle with respect to the horizon towards which the object is directed;
* an 8-bit unsigned value;
* 0 is forward-facing, wrapping around at 255;
* positive rotation is clockwise of forward-facing
*/
final case class ChildObjectStateMessage(object_guid : PlanetSideGUID,
pitch : Int,
yaw : Int)
extends PlanetSideGamePacket {
type Packet = ChildObjectStateMessage
def opcode = GamePacketOpcode.ChildObjectStateMessage
@ -16,8 +28,8 @@ final case class ChildObjectStateMessage(unk1 : Int,
object ChildObjectStateMessage extends Marshallable[ChildObjectStateMessage] {
implicit val codec : Codec[ChildObjectStateMessage] = (
("unk1" | uint16L) ::
("unk2" | uint8L) ::
("unk3" | uint8L)
("object_guid" | PlanetSideGUID.codec) ::
("pitch" | uint8L) ::
("yaw" | uint8L)
).as[ChildObjectStateMessage]
}