Conversation
|
Looks great! |
|
What do we need to ship this? (it's still marked as WIP) |
|
noiseScale 0.1 Webaverse.-.Google.Chrome.2022-05-27.16-06-14.mp4noiseScale 0.5 Webaverse.-.Google.Chrome.2022-05-27.16-07-01.mp4noiseScale 1 Webaverse.-.Google.Chrome.2022-05-27.16-10-16.mp4 |
avatars/avatars.js
Outdated
| const maxIdleVelocity = 0.01; | ||
| const maxEyeTargetTime = 2000; | ||
|
|
||
| const simplex = new SimplexNoise(); |
There was a problem hiding this comment.
We can move this winds code to a separate file to make the code cleaner. Avatars.js update function is already far too long.
There was a problem hiding this comment.
avatars/avatars.js
Outdated
| @@ -1,4 +1,5 @@ | |||
| import * as THREE from 'three'; | |||
| import { SimplexNoise } from 'three/examples/jsm/math/SimplexNoise.js'; | |||
There was a problem hiding this comment.
We have a different noise in procgen.js:
Line 25 in 215519e
I don't care which one we use but other code uses this one so we should be consistent.
There was a problem hiding this comment.
used noise from simplex-noise.js
avatars/avatars.js
Outdated
| const _applyWind = () => { | ||
| const winds = metaversefile.getWinds(); | ||
| //console.log(winds) | ||
| const timeS = performance.now() / 1000; |
There was a problem hiding this comment.
This can be read from a timestamp passed in from update().
In general we should not do performance.now() in our code so the timestamps for all apps are consistent, rather than slightly off.
There was a problem hiding this comment.
used the timestamp from avatar.js
avaer
left a comment
There was a problem hiding this comment.
Couple of cleanups recommended, but the code looks good.
|
And this is sibling PR: webaverse/totum#114 |
|
We should add an example |
Add wind in the scn file. Sibling PR: webaverse/totum#114
Webaverse.-.Google.Chrome.2022-05-19.13-42-50.mp4
Just have 2 wind type now: directional and spherical (reference: https://docs.unity3d.com/Manual/class-WindZone.html)
And the other parameters are:
"direction"
"radius" (only active for spherical)
"position" (only active for spherical)
"windForce"
"noiseScale"
"windFrequency"
Issue: