herm-js-network

0.3.5 • Public • Published

Herm network tools

NPM

Collection of network wrappers for Herm

Network compensator

Allow you to interpolate values based on time thought network calls.

import { NetworkCompensator } from 'herm-js';
 
const characterPosition = {
    x: new NetworkCompensator(0),
    y: new NetworkCompensator(0),
    z: new NetworkCompensator(0),
};
 
network.onValue((position) => {
    characterPosition.x.set(position),
    characterPosition.y.set(position),
    characterPosition.z.set(position),
});
 
...
 
// even if no network update is received, Herm interpolate and guess the next value
 
requestAnimationFrame(() => character.setPosition(characterPosition));

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.3.5
    2
    • latest

Version History

Package Sidebar

Install

npm i herm-js-network

Weekly Downloads

6

Version

0.3.5

License

Apache 2.0

Unpacked Size

4.07 kB

Total Files

8

Last publish

Collaborators

  • azukaar