2126 Commits

Author SHA1 Message Date
haslersn
351b8c91c7 common: Rework volume API
See the doc comments in `common/src/vol.rs` for more information on
the API itself.

The changes include:

* Consistent `Err`/`Error` naming.
  * Types are named `...Error`.
  * `enum` variants are named `...Err`.
* Rename `VolMap{2d, 3d}` -> `VolGrid{2d, 3d}`. This is in preparation
  to an upcoming change where a “map” in the game related sense will
  be added.
* Add volume iterators. There are two types of them:
  * _Position_ iterators obtained from the trait `IntoPosIterator`
    using the method
    `fn pos_iter(self, lower_bound: Vec3<i32>, upper_bound: Vec3<i32>) -> ...`
    which returns an iterator over `Vec3<i32>`.
  * _Volume_ iterators obtained from the trait `IntoVolIterator`
    using the method
    `fn vol_iter(self, lower_bound: Vec3<i32>, upper_bound: Vec3<i32>) -> ...`
    which returns an iterator over `(Vec3<i32>, &Self::Vox)`.
  Those traits will usually be implemented by references to volume
  types (i.e. `impl IntoVolIterator<'a> for &'a T` where `T` is some
  type which usually implements several volume traits, such as `Chunk`).
  * _Position_ iterators iterate over the positions valid for that
    volume.
  * _Volume_ iterators do the same but return not only the position
    but also the voxel at that position, in each iteration.
* Introduce trait `RectSizedVol` for the use case which we have with
  `Chonk`: A `Chonk` is sized only in x and y direction.
* Introduce traits `RasterableVol`, `RectRasterableVol`
  * `RasterableVol` represents a volume that is compile-time sized and has
    its lower bound at `(0, 0, 0)`. The name `RasterableVol` was chosen
    because such a volume can be used with `VolGrid3d`.
  * `RectRasterableVol` represents a volume that is compile-time sized at
    least in x and y direction and has its lower bound at `(0, 0, z)`.
    There's no requirement on he lower bound or size in z direction.
    The name `RectRasterableVol` was chosen because such a volume can be
    used with `VolGrid2d`.
2019-09-06 15:43:31 +02:00
haslersn
fb72faf56b common: prepend/append multiple SubChunks in a batch 2019-09-06 15:33:36 +02:00
haslersn
f16cb02503 common: Calculate magic number in Chonk 2019-09-06 15:33:36 +02:00
haslersn
da40445156 common: Set TerrainChunk::SIZE.z = std::i32::MAX 2019-09-06 15:33:36 +02:00
haslersn
b56de5631f common: For trait ReadVol remove get_unchecked() 2019-09-06 15:33:36 +02:00
Joshua Barretto
fa67696fcd Merge branch 'scott-c/first-person-model' into 'master'
Add first person models

See merge request veloren/veloren!443
2019-09-06 13:02:03 +00:00
scott-c
964f563c35 cleanup comment 2019-09-06 20:22:17 +08:00
scott-c
5f58224f82 Cleanup unused import 2019-09-06 19:35:47 +08:00
scott-c
7838cfa5b2 half camera height when rolling 2019-09-06 19:29:52 +08:00
Joshua Barretto
8ef13f72b7 Merge branch 'desttinghim/sound-effects' into 'master'
Sound Effects

Closes #163 and #97

See merge request veloren/veloren!473
2019-09-06 11:19:32 +00:00
scott-c
df6e611944 Hide player hands when rolling in first person 2019-09-06 19:12:46 +08:00
Louis Pearson
bd52829acb Removed unescessary if statements 2019-09-06 05:02:29 -06:00
scott-c
ad1bccfee0 Simplify model cache key, fixes performance issue 2019-09-06 18:59:05 +08:00
Louis Pearson
c407bc1c2b Change ear pos to Vec3 2019-09-06 04:44:15 -06:00
Louis Pearson
8a1010f9ac Cargo fmt 2019-09-06 04:38:02 -06:00
Louis Pearson
653c633677 Code cleanup 2019-09-06 04:36:42 -06:00
Louis Pearson
322c7ba2b7 Fix warnings 2019-09-06 04:25:17 -06:00
scott-c
84516afff1 Fix first person weapon visible while not wielding 2019-09-06 18:22:26 +08:00
Louis Pearson
561a58fb81 Fix settings move 2019-09-06 04:06:26 -06:00
Joshua Barretto
ca6734b5ba Merge branch 'pfauenauge/flying-rod-axe-pixart' into 'master'
Pixel art for axe and flying rod, shadow for zone names and death message

See merge request veloren/veloren!478
2019-09-05 17:28:33 +00:00
Monty Marz
ed35360945 Pixel art for axe and flying rod, shadow for zone names and death message 2019-09-05 17:28:33 +00:00
Louis Pearson
f57493703a Format files 2019-09-05 03:11:18 -06:00
Louis Pearson
20dd9ef985 Get sound effects working 2019-09-05 03:08:09 -06:00
Louis Pearson
67933c856b Add soundcache
Still getting the stuttering. Time to rethink channels
2019-09-05 03:08:09 -06:00
Louis Pearson
a5b9a2e02c Adds proper 3d sound?
Looks like loading the footstep files every time a sound is played
becomes a problem rather quickly.
2019-09-05 03:08:09 -06:00
Louis Pearson
18d84da929 Change footstep rate 2019-09-05 03:08:09 -06:00
Louis Pearson
dee9918975 Add positional audio
Orientation needs to be set now
2019-09-05 03:08:09 -06:00
Louis Pearson
7321488ff1 Add delay to walking sounds 2019-09-05 03:08:09 -06:00
Louis Pearson
f38d3781b3 Add footstep sounds, implement crude footstep sounding
Sounds are played every tick, which is not good.
2019-09-05 03:08:09 -06:00
Louis Pearson
aa91d0c084 Add play_music call to audiofrontend 2019-09-05 03:08:09 -06:00
Louis Pearson
5bdbbef3fe Remove audio/base.rs 2019-09-05 03:08:09 -06:00
Louis Pearson
b9bcbeea60 Add support for fading sounds 2019-09-05 03:08:09 -06:00
Louis Pearson
50015c8b9a Revamp AudioFrontend
audio::base had a lot of unnescessary abstractions and constructs.
The current code simplifies the API in a way that makes sense and
that will allow sound effects and fading to be added in an incremental
way.
2019-09-05 03:08:09 -06:00
Louis Pearson
7c0aa9611c Use latest version of Rodio instead of custom branch 2019-09-05 03:04:53 -06:00
Forest Anderson
443716ad2d Merge branch 'imbris/ci_updates' into 'master'
Deny all warnings, Switch to cargo check in CI

See merge request veloren/veloren!476
2019-09-05 00:19:50 +00:00
Imbris
80d0884492 Remove all warnings 2019-09-04 19:03:49 -04:00
scott-c
cb0f9d6562 Reduce first person camera interpolation time 2019-09-04 22:05:59 +08:00
scott-c
7f05952393 Add first person models 2019-09-04 22:05:59 +08:00
Imbris
a29854f2c6 Deny all wanings, only use check in CI 2019-09-04 01:13:18 -04:00
Imbris
425ef226de Merge branch 'imbris/char-creation' into 'master'
Segment combination for character creation

Closes #94

See merge request veloren/veloren!470
2019-09-04 03:25:09 +00:00
Imbris
be6584399d Fix some warnings, cleanup comment 2019-09-03 23:09:29 -04:00
Imbris
2946b452f4 Remove derpy eyes :( , fix undead eye indices, fmt 2019-09-03 23:06:15 -04:00
jshipsey
d052add569 fixing eyes, cleanup on offsets 2019-09-03 23:06:13 -04:00
jshipsey
9328ac4f72 tweaked hair colors, head offsets, skin colors 2019-09-03 23:06:11 -04:00
Imbris
3707e49e01 Remove use of empty.vox 2019-09-03 23:06:09 -04:00
Imbris
ef3ff6f21c Add pants coloring, chest and pants sliders 2019-09-03 23:06:06 -04:00
Imbris
96cee60664 Add separate eye color lists for each race 2019-09-03 23:06:02 -04:00
Pfauenauge90
ab715a2bbc hair and skin colours 2019-09-03 23:05:59 -04:00
Imbris
a1c8a4a2f9 adjust how figure head coloring is done 2019-09-03 23:05:58 -04:00
Pfauenauge90
f66cd1b9d3 model changes 2019-09-03 23:05:57 -04:00