mirror of
https://github.com/jwetzell/psn-go.git
synced 2026-09-02 04:49:08 +00:00
add crude encoding of PSN chunks
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
package encoders
|
||||
|
||||
import (
|
||||
"encoding/binary"
|
||||
"math"
|
||||
)
|
||||
|
||||
func EncodeDataTrackerAccelChunk(x float32, y float32, z float32) []byte {
|
||||
bytes := make([]byte, 12)
|
||||
|
||||
binary.LittleEndian.PutUint32(bytes[0:4], math.Float32bits(x))
|
||||
binary.LittleEndian.PutUint32(bytes[4:8], math.Float32bits(y))
|
||||
binary.LittleEndian.PutUint32(bytes[8:12], math.Float32bits(z))
|
||||
|
||||
return EncodeChunk(0x0004, bytes, false)
|
||||
}
|
||||
Reference in New Issue
Block a user