Monstrofil / replays_unpack

51 stars 19 forks source link

Reticle position? #9

Closed imkindaprogrammermyself closed 4 years ago

imkindaprogrammermyself commented 4 years ago

Any idea on how to get the reticle position. This is the only property that changes alot when the reticle moves. Entity.subscribe_property_change('Vehicle', 'targetLocalPos', self.testMethod)

It's a 16bit value. Maybe another packed value?

DeckerCHAN commented 4 years ago

If you are talking about crosshair, you can calculate it from camera packages.

imkindaprogrammermyself commented 4 years ago

@DeckerCHAN You're right, 0x24's size is 56 bytes which is the size of Camera packet. @Monstrofil haven't mapped it yet.

Monstrofil commented 4 years ago

I tried to map it, but there were to many uknown properties. https://github.com/Monstrofil/replays_unpack/blob/master/replay_unpack/core/packets/Camera.py

imkindaprogrammermyself commented 4 years ago

@Monstrofil Quaternions maybe? https://www.youtube.com/watch?v=8Z1D64qfrxM&list=PLhixgUqwRTjzzBeFSHXrw9DnQtssdAwgG&index=26

Monstrofil commented 4 years ago

No idea, all I know is how to get pos, dir and fov:

    self.unknown1, = struct.unpack('f', stream.read(4))
    self.unknown2, = struct.unpack('f', stream.read(4))
    self.unknown3, = struct.unpack('f', stream.read(4))

    self.unknown4, = struct.unpack('f', stream.read(4))

    self.position = Vector3(stream)

    self.fov, = struct.unpack('f', stream.read(4))

    self.unknown5, = struct.unpack('f', stream.read(4))
    self.unknown6, = struct.unpack('f', stream.read(4))
    self.unknown7, = struct.unpack('f', stream.read(4))

    self.direction = Vector3(stream)
DeckerCHAN commented 4 years ago
            self.unknown1, = struct.unpack('f', stream.read(4))
            self.unknown2, = struct.unpack('f', stream.read(4))
            self.unknown3, = struct.unpack('f', stream.read(4))
            self.unknown4, = struct.unpack('f', stream.read(4))

            self.position = Vector3(stream)

            self.fov, = struct.unpack('f', stream.read(4))
            self.relative_position = Vector3(stream)
            self.relative_direction = Vector3(stream)