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 🙏

© 2024 – Pkg Stats / Ryan Hefner

three-fpecontrols

v1.0.3

Published

First Person Controls for three.js inspired by Unity's scene editor controls

Downloads

3

Readme

FirstPersonEditorControls

This class is an alternative implementation of FirstPersonControls, inspired by Unity's scene editor camera controls.

Constructor

FirstPersonEditorControls( object : camera, domElement : HTMLElement )

object: The camera to be controlled.

domElement: The HTML element used for event listeners.

Creates a new instance of FirstPersonEditorControls.

Properties

.activeLook : Boolean

Whether or not it's possible to look around. Default is true.

.autoForward : Boolean

Whether or not the camera is automatically moved forward. Default is false.

.captureMouse : Boolean

Whether or not looking around locks the pointer. Default is true.

.constrainVertical : Boolean

Whether or not looking around is vertically constrained by [.verticalMin, .verticalMax]. Default is false.

.domElement : HTMLElement

The HTMLElement used to listen for mouse / touch events. This must be passed in the constructor; changing it here will not set up new event listeners.

enabled : Boolean

Whether or not the controls are enabled. Default is true.

heightCoef : Number

Determines how much faster the camera moves when it's y-component is near .heightMax. Default is 1.

heightMax : Number

Upper camera height limit used for movement speed adjustment. Default is 1.

heightMin : Number

Lower camera height limit used for movement speed adjustment. Default is 0.

heightSpeed : Boolean

Whether or not the camera's height influences the forward movement speed. Default is false. Use the properties .heightCoef, .heightMin and .heightMax for configuration.

lookVertical : Boolean

Whether or not it's possible to vertically look around. Default is true.

lookSpeed : Number

The look around speed. Default is 0.005.

maxMovementSpeed : Number

The maximum movement speed, useful when sprint acceleration is enabled. Default is 2.0.

movementAcceleration : Number

The movement acceleration when sprinting. Default is 0.15.

movementSpeed : Number

The movement speed. Default is 1.

object : Camera

The camera to be controlled.

verticalMax : Number

How far you can vertically look around, upper limit. Range is 0 to Math.PI radians. Default is Math.PI.

verticalMin : Number

How far you can vertically look around, lower limit. Range is 0 to Math.PI radians. Default is 0.

Methods

dispose () : null

Should be called if the controls is no longer required.

.lookAt ( vector : Vector3 ) : FirstPersonEditorControls

.lookAt ( x : Number, y : Number, z : Number ) : FirstPersonEditorControls

vector - A vector representing the target position.

Optionally, the x, y, z components of the world space position.

Ensures the controls orient the camera towards the defined target position.

.update ( delta : Number ) : null

delta: Time delta value.

Updates the controls. Usually called in the animation loop.