fix: rotation clampiness
This commit is contained in:
parent
e2fe91dffd
commit
215e73d3f1
|
@ -4,10 +4,11 @@ import {Packet} from '@latus/socket';
|
|||
export default () => class TraitUpdateVisiblePacket extends Packet {
|
||||
|
||||
static pack(data) {
|
||||
const rotation = ((data.rotation % TWO_PI) + TWO_PI) % TWO_PI;
|
||||
return {
|
||||
isVisible: data.isVisible,
|
||||
opacity: Math.floor(data.opacity * 255),
|
||||
rotation: Math.floor(((data.rotation % TWO_PI) / TWO_PI) * 65536),
|
||||
rotation: Math.floor((rotation / TWO_PI) * 65536),
|
||||
};
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user