Trackball Camera

An asset by Goutte
The page banner background of a mountain and forest
Trackball Camera hero image

Quick Information

0 ratings
Trackball Camera icon image
Goutte
Trackball Camera

A Trackball Camera that responds to input from actions, mouse, keyboard, joystick and touch, in order to rotate around its parent node while continuously facing it, kind of like a satellite in orbit.- stays around its parent node, even if the latter moves- no gimbal lock (quaternions ♥)- optional camera inertia for a smoother experience- keep the horizon stable if you want- the parent node does not have to be centered in the camera's view- can be used to look around itself- analog camera control with joystick- smooth and constrained zoom with PGUP / PGDOWN or your own custom action, if you want to use the mouse wheel for example- constrain pitch, or handle headstands by inverting x- a bunch of parameters to configure things as you want them- has been around since Godot 2- made to be extendedCONS:- No panning (merge requests welcome)- No promises (nor patrons)USAGE1. Add a TrackballCamera node as child of the node you want to trackball around.2. Translate the camera along the +Z axis a little bit, so that it faces its parent.3. Configure the camera.

Supported Engine Version
4.0
Version String
9.2
License Version
MIT
Support Level
community
Modified Date
12 months ago
Git URL
Issue URL

TrackballCamera for Godot

README MIT README Release README FeedMePlz

A Godot 4.x addon that adds a TrackballCamera node without gimbal lock.

The TrackballCamera responds to input from mouse, keyboard, joystick and touch, in order to rotate around its parent node while facing it.

A version for Godot 3.x is available as well. A version for Godot 2.x is available as well.

Features

  • stays around its parent node, even if the latter moves
  • no gimbal lock (quaternions 🌟)
  • camera inertia for a smoother experience (can be disabled)
  • the parent node does not have to be centered in the camera's view
  • analog camera control with joystick, courtesy of @marcello505 (in #4)
  • a bunch of parameters to configure everything as you want it

Install

The installation is as usual, through the Assets Library. You can also simply copy the files of this project into yours, it should work.

Then, enable the plugin in Scene > Project Settings > Plugins.

Usage

Make the TrackballCamera a child of the node to trackball around. Make sure your camera initially faces said node, and is at a proper distance from it. The initial position of your camera matters. The node does not need to be in the center.

You can also use this camera to look around you if you place it atop its parent node, spatially. It's going to rotate around itself, and that amounts to looking around. You'll probably want to set mouse_invert and keyboard_invert to true in that case.

Todo

  • Test if touch works on android and html5, try SCREEN_DRAG otherwise. (see #6)

Feedback and contributions are welcome!

A Trackball Camera that responds to input from actions, mouse, keyboard, joystick and touch, in order to rotate around its parent node while continuously facing it, kind of like a satellite in orbit.

- stays around its parent node, even if the latter moves
- no gimbal lock (quaternions ♥)
- optional camera inertia for a smoother experience
- keep the horizon stable if you want
- the parent node does not have to be centered in the camera's view
- can be used to look around itself
- analog camera control with joystick
- smooth and constrained zoom with PGUP / PGDOWN or your own custom action, if you want to use the mouse wheel for example
- constrain pitch, or handle headstands by inverting x
- a bunch of parameters to configure things as you want them
- has been around since Godot 2
- made to be extended

CONS:
- No panning (merge requests welcome)
- No promises (nor patrons)

USAGE
1. Add a TrackballCamera node as child of the node you want to trackball around.
2. Translate the camera along the +Z axis a little bit, so that it faces its parent.
3. Configure the camera.

Reviews

0 ratings

Your Rating

Headline must be at least 3 characters but not more than 50
Review must be at least 5 characters but not more than 500
Please sign in to add a review

Quick Information

0 ratings
Trackball Camera icon image
Goutte
Trackball Camera

A Trackball Camera that responds to input from actions, mouse, keyboard, joystick and touch, in order to rotate around its parent node while continuously facing it, kind of like a satellite in orbit.- stays around its parent node, even if the latter moves- no gimbal lock (quaternions ♥)- optional camera inertia for a smoother experience- keep the horizon stable if you want- the parent node does not have to be centered in the camera's view- can be used to look around itself- analog camera control with joystick- smooth and constrained zoom with PGUP / PGDOWN or your own custom action, if you want to use the mouse wheel for example- constrain pitch, or handle headstands by inverting x- a bunch of parameters to configure things as you want them- has been around since Godot 2- made to be extendedCONS:- No panning (merge requests welcome)- No promises (nor patrons)USAGE1. Add a TrackballCamera node as child of the node you want to trackball around.2. Translate the camera along the +Z axis a little bit, so that it faces its parent.3. Configure the camera.

Supported Engine Version
4.0
Version String
9.2
License Version
MIT
Support Level
community
Modified Date
12 months ago
Git URL
Issue URL

Open Source

Released under the AGPLv3 license

Plug and Play

Browse assets directly from Godot

Community Driven

Created by developers for developers