Skip to content

Commit

Permalink
Update readme.
Browse files Browse the repository at this point in the history
  • Loading branch information
n3vu0r committed Nov 30, 2023
1 parent 7bf17e0 commit c93232e
Showing 1 changed file with 23 additions and 10 deletions.
33 changes: 23 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,14 @@ Run simple and advanced [examples] in your browser using [WebAssembly] and [WebG
[WebAssembly]: https://en.wikipedia.org/wiki/WebAssembly
[WebGL]: https://en.wikipedia.org/wiki/WebGL

## Camera Modes

Supports multiple camera modes:

* Trackball mode rotates camera around target.
* First-Person mode rotates target around camera.
* Spectator mode translates target and camera.

## Coherence Features

This is an alternative trackball technique using exponential map and parallel transport to
Expand All @@ -38,7 +46,7 @@ away from the screen’s center (e.g., the rotation accelerates towards the edge
* Coherent and intuitive orbiting via the exponential map, see the underlying [`trackball`]
crate which follows the recipe given in the paper of Stantchev, G.. “Virtual Trackball
Modeling and the Exponential Map.”. [S2CID] [44199608]. See the [`exponential_map`] example.
* Coherent first person view aka free look or mouse look with the world trackball centered at
* Coherent first-person mode aka free look or mouse look with the world trackball centered at
eye instead of target.
* Coherent scaling by translating mouse wheel device units, see [`TrackballWheelUnit`]. Scales
eye distance from current cursor position or centroid of finger positions projected onto
Expand All @@ -52,9 +60,9 @@ away from the screen’s center (e.g., the rotation accelerates towards the edge
[S2CID]: https://en.wikipedia.org/wiki/S2CID_(identifier)
[44199608]: https://api.semanticscholar.org/CorpusID:44199608

[`trackball`]: https://docs.rs/trackball/latest/trackball/
[`TrackballWheelUnit`]: https://docs.rs/bevy_trackball/latest/bevy_trackball/struct.TrackballWheelUnit.html
[`TrackballVelocity`]: https://docs.rs/bevy_trackball/latest/bevy_trackball/struct.TrackballVelocity.html
[`trackball`]: https://qu1x.github.io/bevy_trackball/doc/trackball/index.html
[`TrackballWheelUnit`]: https://qu1x.github.io/bevy_trackball/doc/bevy_trackball/enum.TrackballWheelUnit.html
[`TrackballVelocity`]: https://qu1x.github.io/bevy_trackball/doc/bevy_trackball/enum.TrackballVelocity.html

## Additional Features

Expand Down Expand Up @@ -98,15 +106,20 @@ Mouse (Buttons) | Touch (Fingers) | Keyboard | Operation
----------------------- | ----------------------- | -------- | ---------------------------------
Left Press + Drag | One + Drag | `ijkl` | Orbits around target.
↳ at trackball's border | Two + Roll | `uo` | Rolls about view direction.
Middle Press + Drag | Any + Drag + Left Shift | `↑←↓→` | First person view.
Middle Press + Drag | Any + Drag + Left Shift | `↑←↓→` | First-person mode.
Right Press + Drag | Two + Drag | `esdf` | Slides trackball on focus plane.
  |   | `gv` | Slides trackball in/out.
Scroll In/Out | Two + Pinch Out/In | `hn` | Scales distance zooming in/out.
Left Press + Release | Any + Release |   | Slides to cursor/finger position.
  |   | `m` | Toggle `esdf`/`wasd` mapping.
  |   | `p` | Toggle orthographic/perspective.
  |   | `Return` | Reset camera transform.

[`TrackballInput`]: https://docs.rs/bevy_trackball/latest/bevy_trackball/struct.TrackballInput.html
Alternatively, [`TrackballInput::map_wasd`] maps `wasd`/`Space`/`ControlLeft` to slide
operations where `wd` slides in/out and `Space`/`ControlLeft` slides up/down (jump/crouch).

[`TrackballInput`]: https://qu1x.github.io/bevy_trackball/doc/bevy_trackball/struct.TrackballInput.html
[`TrackballInput::map_wasd`]: https://qu1x.github.io/bevy_trackball/doc/bevy_trackball/struct.TrackballInput.html#method.map_wasd

## Usage

Expand Down Expand Up @@ -139,10 +152,10 @@ fn setup(mut commands: Commands) {
}
```

[`TrackballPlugin`]: https://docs.rs/bevy_trackball/latest/bevy_trackball/struct.TrackballPlugin.html
[`TrackballController`]: https://docs.rs/bevy_trackball/latest/bevy_trackball/struct.TrackballController.html
[`TrackballCamera`]: https://docs.rs/bevy_trackball/latest/bevy_trackball/struct.TrackballCamera.html
[`Camera3dBundle`]: https://docs.rs/bevy/latest/bevy/core_pipeline/core_3d/struct.Camera3dBundle.html
[`TrackballPlugin`]: https://qu1x.github.io/bevy_trackball/doc/bevy_trackball/struct.TrackballPlugin.html
[`TrackballController`]: https://qu1x.github.io/bevy_trackball/doc/bevy_trackball/struct.TrackballController.html
[`TrackballCamera`]: https://qu1x.github.io/bevy_trackball/doc/bevy_trackball/struct.TrackballCamera.html
[`Camera3dBundle`]: https://qu1x.github.io/bevy_trackball/doc/bevy/core_pipeline/core_3d/struct.Camera3dBundle.html

[examples]: https://qu1x.github.io/bevy_trackball/examples
[`exponential_map`]: https://qu1x.github.io/bevy_trackball/examples/exponential_map.html
Expand Down

0 comments on commit c93232e

Please sign in to comment.