feat: packing
This commit is contained in:
parent
c3ec69f4ff
commit
dfd2dc2a41
|
@ -372,3 +372,14 @@ export function fromObject(object) {
|
|||
export function toObject(v) {
|
||||
return {x: v[0], y: v[1]};
|
||||
}
|
||||
|
||||
export function unpackFromUint32(uint32) {
|
||||
return [
|
||||
uint32 & 0xFFFF,
|
||||
uint32 >> 16,
|
||||
];
|
||||
}
|
||||
|
||||
export function packToUint32(v) {
|
||||
return (v[1] << 16) | v[0];
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user