A first person character controller for the Three.js graphics library

Overview

charactercontroller

A first person character controller for the Three.js graphics library

GitHub Workflow Status

npm bundle size npm NPM

Demo

Installation

npm install charactercontroller

Usage

import CharacterController from "charactercontroller";

new CharacterController(scene, options);
  • scene

    • An instance of THREE.Scene that the Character Controller is to become a child of.
  • options

    • An object defining options for the Character Controller. The valid fields are described below

Constructor Options

  • speed
    • The rate at which the controller is translated in the scene in response to player inputs.
    • Can be interpreted as the speed at which the controller walks.
    • Default: 5
  • floorDistance
    • How far above a surface the controller can get before stopping falling.
    • Could be interpreted as the height of the player.
    • Default: 1
  • gravity
    • How quickly the controller is pulled down when there is no surface beneath it.
    • Default: 9.8
  • jumpPower
    • With how much force the controller is projected upwards when a jump is initiated.
    • Default: 8
  • jumpDuration
    • How long the player stays in the air during a jump.
    • Internally this is in frames, however it is recommended that this should be treated as an arbitary unit due to the variable and unpredictable nature of the length of time of an animation frame.
    • Default: 120
  • sensitivity
    • x
      • How much the camera should move in response to the player moving the mouse left and right.
      • Default: 0.1
    • y
      • How much the camera should move in response to the player moving the mouse up and down.
      • Default: 0.1
  • lookLimit
    • down
      • The angle in degrees that the camera's x rotation should be clamped to when looking down
      • Default: 0
    • up
      • The angle in degrees that the camera's x rotation should be clamped to when looking up
      • Default: 180
  • cameraFov
    • The field of view of the camera attatched to the character controller.
    • Default: 75
You might also like...

When a person that doesn't know how to create a programming language tries to create a programming language

When a person that doesn't know how to create a programming language tries to create a programming language

Kochanowski Online Spróbuj Kochanowskiego bez konfiguracji projektu! https://mmusielik.xyz/projects/kochanowski Instalacja Stwórz nowy projekt przez n

Dec 4, 2022

Digital Identifier is a secure, decentralized, anonymous and tampered proof way of maintaining and verifying all essential identity-based documents to create a unique digital identity of a person.

Digital Identifier is a secure, decentralized, anonymous and tampered proof way of maintaining and verifying all essential identity-based documents to create a unique digital identity of a person.

Digital Identifier 🧐 To design and develop a secure, decentralized, anonymous and tampered proof way of maintaining and verifying all essential ident

Dec 17, 2022

JQuery charCounter - jQuery Character Counter Plugin

JQuery charCounter - jQuery Character Counter Plugin

jQuery Character Counter A jQuery based character counter for input and textarea HTML tags. What is this? This simple plugin allows you to add a c

Aug 10, 2022

A Discord Bot that connects to your AzerothCore server so you / users can manage the server / character

A Discord Bot that connects to your AzerothCore server so you / users can manage the server / character. Made for AzerothCore / azerothcore-tools

Sep 24, 2022

Lets you add a character to Hacker News links to add social media and OpenGraph previews for sharing on things like Slack or Twitter.

Lets you add a character to Hacker News links to add social media and OpenGraph previews for sharing on things like Slack or Twitter.

news.ycombinator1.com Lets you add a character to Hacker News links to add social media and OpenGraph previews for sharing on things like Slack or Dis

Sep 18, 2022

An open, collaborative and evolving character creator project for the open metaverse.

An open, collaborative and evolving character creator project for the open metaverse.

Avatar Creator An open, collaborative and evolving 3D avatar creator for the open metaverse. Want to contribute? Please check out the issues, or submi

Dec 17, 2022

Regular expression for Character classes

Regular expression for Character classes

Regular expression for Character classes

Aug 21, 2022

A simple and useful jquery plugin that allows you to create a Text Area Character Count Effect with limited warning.

A simple and useful jquery plugin that allows you to create a Text Area Character Count Effect with limited warning.

jquery-character-counter A simple and useful jquery plugin that allows you to create a Text Area Character Count Effect with limited warning. #Demo Us

Dec 28, 2020

Aniso is an open-source ASCII tool built by Studio Freight to generate and customize character-based imagery.

Aniso Aniso is an open-source ASCII tool built by Studio Freight to generate and customize character-based imagery. Features Granularity control Chara

Dec 16, 2022
Comments
  • Restyle 💥 Merge version 3 development branch to main

    Restyle 💥 Merge version 3 development branch to main

    Automated style fixes for #4, created by Restyled.

    The following restylers made fixes:

    To incorporate these changes, merge this Pull Request into the original. We recommend using the Squash or Rebase strategies.

    NOTE: As work continues on the original Pull Request, this process will re-run and update (force-push) this Pull Request with updated style fixes as necessary. If the style is fixed manually at any point (i.e. this process finds no fixes to make), this Pull Request will be closed automatically.

    Sorry if this was unexpected. To disable it, see our documentation.

    opened by restyled-io[bot] 0
  • Add procedural input checking

    Add procedural input checking

    Having functions for every single input action is not based. The usage of the new system should be something like checkInputs(this.inputs.sprint), for example. This would make it much easier to add new input events in the future.

    enhancement 
    opened by ma1ted 0
Releases(v3.0.0)
Owner
Malted
Patent pending.
Malted
A highly portable first person 3D game playable on Desktop or Web!

rust-game Interfaces (*_interface/) are immediately human-playable versions of the game. They use single_player simulations of the game, which in turn

Gerald Nash 2 Jun 7, 2022
Grupprojekt för kurserna 'Javascript med Ramverk' och 'Agil Utveckling'

JavaScript-med-Ramverk-Laboration-3 Grupprojektet för kurserna Javascript med Ramverk och Agil Utveckling. Utvecklingsguide För information om hur utv

Svante Jonsson IT-Högskolan 3 May 18, 2022
Hemsida för personer i Sverige som kan och vill erbjuda boende till människor på flykt

Getting Started with Create React App This project was bootstrapped with Create React App. Available Scripts In the project directory, you can run: np

null 4 May 3, 2022
Kurs-repo för kursen Webbserver och Databaser

Webbserver och databaser This repository is meant for CME students to access exercises and codealongs that happen throughout the course. I hope you wi

null 14 Jan 3, 2023
Text Engraving & Extrusion demo based on Three.js is implemented with Typescript and webpack5. Used THREE-CSGMesh as the core tech to achieve engraving and extrusion results

Text Engraving & Extrusion Text Engraving & Extrusion demo is implemented using Three.js, with Typescript and webpack5. Used THREE-CSGMesh as the core

Jiahong Li 3 Oct 12, 2022
Este projeto acelara o desenvolvimento com express, gerando uma estrutura completa e opções de gerar controller mode e view pelo cmd.

fast-developer-express Este projeto acelara o desenvolvimento com express, gerando uma estrutura completa e opções de gerar controller mode e view pel

Rodrino Adolfo Kupessala 1 Dec 21, 2021
Using a Leap Motion Controller from Ultraleap for finger tracking in VRChat without mods

Leap Motion Controller finger tracking for VRChat OSC Using a Leap Motion Controller from Ultraleap for finger tracking in VRChat without mods. Descri

adeleine 28 Dec 31, 2022
View component and controller of YouTube Player API, for fresh framework.

fresh-youtube View component and controller of YouTube Player API, for fresh framework. Try it now! git clone [email protected]:otiai10/fresh-youtube.git

Hiromu OCHIAI 10 Nov 2, 2022
Missing Person Finder re-design

Missing Person Finder With ReactJs #Technology Used React Routing with React-routing-dom Redux with Redux Persist API calling with axios Ant design UI

Itp Manish 0 Jul 12, 2022
A calculation and tracker tool for one-person business operations

?? Taxemu This is the alpha version of Taxemu. A tracker tool for one-person business operations. The live project can be found here. Development Clon

John Raptis 7 Nov 30, 2022