1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
/// # AgentUpdate
/// <https://wiki.secondlife.com/wiki/AgentUpdate>
///
/// The agent update packet. used for sending the server data about the player's curernt state.
/// Must be sent from the viewer to the server on a regular basis in order to know the agent's position and velocity.
/// Sent up to ten times per second
///
/// ## Header
/// | AgentUpdate | | | | |
/// |--------------|-------------|----------------|-------------------|---------------------|
/// | Packet Header| id:5 | reliable: false| zerocoded: false | frequency: High |
///
/// ## Packet Structure
/// Each AgentUpdate packet sends an AgentData struct, containing information about what is being
/// updated.
/// | AgentData | | | |
/// |---------------|---------|-------------|---|
/// | AgentID |16 bytes | [Uuid](uuid::Uuid) | ID of the user agent |
/// | SessionID |16 bytes | [Uuid](uuid::Uuid) | ID of the user session |
/// | BodyRotation |16 bytes | [Quaternion](glam::Quat) | where the user's body is facing|
/// | HeadRotation |16 bytes | [Quaternion](glam::Quat) | Where the user's head is facing|
/// | State |1 byte | [u8] | Typing or editing states |
/// | CameraCenter |12 bytes | [Vector3](glam::Vec3)[[u8]] | Location of the camera in region local coordinates|
/// | CameraAtAxis |12 bytes | [Vector3](glam::Vec3)[[u8]] | X rotational axis of the camera (forward) |
/// | CameraLeftAxis|12 bytes | [Vector3](glam::Vec3)[[u8]] | Y rotational axis of the camera (Left) |
/// | CameraUpAxis |12 bytes | [Vector3](glam::Vec3)[[u8]] | Z rotational axis of the camera (Up) |
/// | Far |4 bytes | [f32] | Distance the viewer can see in meters |
/// | ControlFlags |4 bytes | [u32] | Events such as movement and standing up |
/// | Flags |1 bytes | [u8] | Flag for hiding group tile in nametag |
/// # CoarseLocationUpdate
/// <https://wiki.secondlife.com/wiki/CoarseLocationUpdate>
///
/// This packet is used to populate the minimap with green indicators to represent where the agents
/// are. Z-azis is multiplied by 4 to obtain true Z location.
/// The "you" and "Prey" tell the client which ones in the index you are, and the person you are
/// following, if you are following someone.
///
/// ## Header
/// | CoarseLocationUpdate | | | | |
/// |--------------|-------------|----------------|-------------------|---------------------|
/// | Packet Header| id:6 | reliable: false| zerocoded: false | frequency: Medium |
///
/// ## Packet Structure
/// Each coarse location update packet comes with a a struct containing an XYZ location of other
/// agents, and an index.
///
/// |CoarseLocationUpdateData| | | |
/// |------------------------|------------------|-------------|-------------------------|
/// | Locations | List of Locations| | |
/// | Locations\[Location\] | 12 bytes | [Vector3](glam::Vec3)[[u8]] | XYZ location of an agent|
/// | You | 2 bytes | [i16] | Index of you in the list|
/// | Prey | 2 bytes | [i16] | Index of who you are following in the list|
/// TODO: UNIMPLEMENTED
/// # Avatar Appearance
/// <https://wiki.secondlife.com/wiki/AvatarAppearance>
///
/// This packet is used to update the appearane of a user's avatar.
/// Contains textures and VisualParams for the avatar
///
/// ## Header
/// | Avatar Appearance | | | | |
/// |--------------|-------------|----------------|-------------------|---------------------|
/// | Packet Header| id:158 | reliable: false| zerocoded: false | frequency: Low |
///
/// ## Packet Structure
/// |Avatar Appearance ||||
/// |--------------|----------|--------------------|----------------|
/// | id | 16 bytes | [Uuid](uuid::Uuid) | ID of the user |
/// | is_trial | 1 byte | [bool] | Is the user a trial user|
/// | texture_len | 2 bytes | [u16] | length of the texture data block |
/// | texture_data | variable bytes | | Texture data for each face |
/// | v_param_len | 1 byte | [u8] | length of visual param block |
/// | visual_param_data | variable byes | | Bytes containing the visual param data |