npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

three-floating-controls

v1.4.1

Published

Three.js camera controls

Readme

three-floating-controls

Three.js camera controls.
Demo: https://projects.thibautfoussard.com/lightbulbs/

Install

npm i three-floating-controls

Usage

import FloatingControls from 'three-floating-controls'

let controls = new FloatingControls(camera);

function loop() {
    requestAnimationFrame(loop);
    controls.update();
}

Options

cameraCenter (Vector3)

Initial position of the camera (the camera will move around this point).
Useless if you already have defined the camera position beforehand.
Default is the camera position.
Example:

let controls = new FloatingControls(camera, {
    cameraCenter: new THREE.Vector3(0, 1, 0)
});
// is equivalent to
camera.position.set(0, 1, 0);
let controls = new FloatingControls(camera);

lookAt (Vector3)

Rotates the camera as it moves to look at the position provided.
If set to false, the camera will keep its initial rotation. Default: [0, 0, 0]
Example:

let controls = new FloatingControls(camera, {
    lookAt: new THREE.Vector3(0, 1, 0)
});

axisFactor (array)

Influence factor of the controls on the x and y axes.
Default: [1, 1]

let controls = new FloatingControls(camera, {
    axisFactor: [2, 1] // camera will rotate twice as much on the x axis 
});

amp (float)

Motion amplification. A greater value will make the camera go further.
Default: 1
Example:

let controls = new FloatingControls(camera, {
    amp: .3
});

lerpAmount (float, range is [0,1])

For each iteration of the linear interpolation, the amount to interpolate between the mouse position and the camera position. A smaller value will make the animation smoother.
Default: .1
Example:

let controls = new FloatingControls(camera, {
    lerpAmount: .05
});

absoluteMinX, absoluteMaxX, absoluteMinY, absoluteMaxY

Absolute min & max coordinates of the camera.
Default: null
Example:

let controls = new FloatingControls(camera, {
    absoluteMinX: -10, 
    absoluteMaxX: 10, 
    absoluteMinY: -10, 
    absoluteMaxY: 10
});

Attributes

active

If set to false, the class will not update the camera position when the mouse position changes.
Default is true.

let controls = new FloatingControls(camera, { ... });
controls.active = false;