Skip to content

Commit

Permalink
Clean.
Browse files Browse the repository at this point in the history
gonnavis committed Jul 22, 2022
1 parent de2846f commit dc9108f
Showing 9 changed files with 40 additions and 119 deletions.
3 changes: 0 additions & 3 deletions avatars/animationHelpers.js
Original file line number Diff line number Diff line change
@@ -1225,7 +1225,6 @@ export const _applyAnimation = (avatar, now, moveFactors, timeDiffS) => {
const landingAnimation = animations.index['landing.fbx'];
const landingAnimationDuration = landingAnimation.duration / animationSpeed;
const landFactor = landTimeS / landingAnimationDuration;
// if (isPosition && avatar === window.localPlayer?.avatar) console.log('landFactor', landFactor);

if (landFactor > 0 && landFactor <= 1) {
const t2 = landTimeS * animationSpeed;
@@ -1250,7 +1249,6 @@ export const _applyAnimation = (avatar, now, moveFactors, timeDiffS) => {
const landingAnimation = animations.index['landing 2.fbx'];
const landingAnimationDuration = landingAnimation.duration / animationSpeed;
const landFactor = landTimeS / landingAnimationDuration;
// if (isPosition && avatar === window.localPlayer?.avatar) console.log('landFactor', landFactor);

if (landFactor > 0 && landFactor <= 1) {
const t2 = landTimeS * animationSpeed;
@@ -1287,7 +1285,6 @@ export const _applyAnimation = (avatar, now, moveFactors, timeDiffS) => {
lerpFn,
} = spec;

// if (avatar.fallLoopState) {
if (avatar.fallLoopFactor > 0) {
const t2 = (avatar.fallLoopTime / 1000);
const src2 = fallLoopAnimation.interpolants[k];
13 changes: 0 additions & 13 deletions avatars/avatars.js
Original file line number Diff line number Diff line change
@@ -1935,19 +1935,6 @@ class Avatar {
this.inputs.hmd.quaternion
);
}

const player = window.localPlayer;
// const player = window.npcPlayers[0];
if (true && player && this === player.avatar) {
window.domInfo.innerHTML += `
<div style="display:;">actions: --- ${player.getActionsArray().map(n=>n.type)}</div>
<div style="display:;">fallLoopState: --- ${this.fallLoopState}</div>
<div style="display:;">fallLoopTime: --- ${Math.floor(this.fallLoopTime)}</div>
<div style="display:;">fallLoopFactor: --- ${this.fallLoopFactor?.toFixed(2)}</div>
<div style="display:;">landTime: --- ${Math.floor(this.landTime)}</div>
`
}

_applyAnimation(this, now, moveFactors, timeDiffS);

if (this.poseAnimation) {
2 changes: 0 additions & 2 deletions character-physics.js
Original file line number Diff line number Diff line change
@@ -161,7 +161,6 @@ class CharacterPhysics {
this.lastGroundedTime = now;
if (!this.lastGrounded) {
if (this.player.hasAction('jump') || this.player.hasAction('fallLoop')) {
console.log('land')
this.player.setControlAction({type: 'land', time: now});
}
};
@@ -171,7 +170,6 @@ class CharacterPhysics {
const lastGroundedTimeDiff = now - this.lastGroundedTime;
if (lastGroundedTimeDiff > 200) {
if (!this.player.hasAction('fallLoop') && !this.player.hasAction('jump') && !this.player.hasAction('fly') && !this.player.hasAction('swim')) {
console.log('fallLoop')
this.player.setControlAction({type: 'fallLoop'});
this.velocity.y = 0;
}
4 changes: 0 additions & 4 deletions index.html
Original file line number Diff line number Diff line change
@@ -18,10 +18,6 @@
<body>
<div id=iframe-container></div>
<div id="root"></div>
<div>
<button style="position: fixed; left: 0; top: 0; z-index: 999999;" onclick="domInfo.style.display = domInfo.style.display === 'none' ? 'block' : 'none';">toggle</button>
<div id="domInfo" style="position: fixed; left: 0; top: 150px; background: rgba(0,0,0,.5); color: white; padding: 5px; width: 600px; pointer-events: none; font-family: Consolas,'Courier New',Courier,FreeMono,monospace;z-index: 999999; display: /* none */;"></div>
</div>
<script type=module src="/pre.js"></script>
<script type=module src="/src/main.jsx"></script>
</body>
3 changes: 0 additions & 3 deletions interpolants.js
Original file line number Diff line number Diff line change
@@ -17,9 +17,6 @@ export class ScalarInterpolant {
getInverse() {
return this.maxValue - this.value;
}
reset() {
this.value = this.minValue;
}
}

// bidirectional linear; goes forward and backward
64 changes: 37 additions & 27 deletions scenes/terrain.scn
Original file line number Diff line number Diff line change
@@ -3,43 +3,53 @@
{
"type": "application/spawnpoint",
"content": {
"position": [0,70,0],
"position": [0, 0 ,-3],
"quaternion": [0, 0.0,0, 0.0]
}
},
{
"type": "application/light",
"content": {
"lightType": "ambient",
"args": [[255, 255, 255], 0.5]
}
},
{
"type": "application/light",
"content": {
"lightType": "directional",
"args": [[255, 255, 255], 5],
"position": [1, 2, 3],
"shadow": [150, 5120, 0.1, 10000, -0.0001]
}
},
{
"type": "application/rendersettings",
"content": {
"fog": {
"fogType": "exp",
"args": [[7, 44.5, 41.5], 0]
"args": [[30, 100, 255], 0.001]
},
"ssao": {
"kernelRadius": 16,
"minDistance": 0.005,
"maxDistance": 0.1
},
"dof": {
"focus": 2.0,
"aperture": 0.0001,
"maxblur": 0.0005
},
"hdr": {
"adaptive": true,
"resolution": 256,
"adaptionRate": 100,
"maxLuminance": 10,
"minLuminance": 0,
"middleGrey": 3
},
"bloom": {
"strength": 0.2,
"radius": 0.1,
"threshold": 0.3
}
}
},
{
"position": [
0,
0,
0
],
"start_url": "http://localhost/lib/webaverse_resource/atmospheric-sky/"
{
"type": "application/light",
"content": {
"lightType": "ambient",
"args": [[255, 255, 255],5]
}
},
{ "position": [ 0, 0, 0 ], "start_url": "http://localhost/lib/webaverse_resource/dual-contouring-terrain/" }
{
"position": [0 , 0, 0],
"quaternion": [0, 0.0,0, 0.0],
"start_url": "https://webaverse.github.io/dual-contouring-terrain/"
}
]
}
}
48 changes: 0 additions & 48 deletions scenes/test.scn

This file was deleted.

6 changes: 3 additions & 3 deletions scenes/water.scn
Original file line number Diff line number Diff line change
@@ -41,16 +41,16 @@
0,
0
],
"start_url": "http://localhost/lib/webaverse_resource/atmospheric-sky/"
"start_url": "https://webaverse.github.io/atmospheric-sky/"
},
{
"position": [
0,
0,
0
],
"start_url": "http://localhost/lib/webaverse_resource/water/"
"start_url": "https://webaverse.github.io/water/"
},
{ "position": [ 0, 0, 0 ], "start_url": "http://localhost/lib/webaverse_resource/dual-contouring-terrain/" }
{ "position": [ 0, 0, 0 ], "start_url": "https://webaverse.github.io/dual-contouring-terrain/" }
]
}
16 changes: 0 additions & 16 deletions webaverse.js
Original file line number Diff line number Diff line change
@@ -296,8 +296,6 @@ export default class Webaverse extends EventTarget {
const animate = (timestamp, frame) => {
performanceTracker.startFrame();

window.domInfo.innerHTML = '';

const _frame = () => {
timestamp = timestamp ?? performance.now();
const timeDiff = timestamp - lastTimestamp;
@@ -380,20 +378,6 @@ const _startHacks = webaverse => {
const localPlayer = metaversefileApi.useLocalPlayer();
const vpdAnimations = Avatar.getAnimations().filter(animation => animation.name.endsWith('.vpd'));

window.localPlayer = localPlayer;
window.THREE = THREE;
window.physicsManager = physicsManager;
window.physx = physx;
window.metaversefileApi = metaversefileApi;
window.rootScene = rootScene;
window.loadoutManager = loadoutManager;
window.game = game;
window.cameraManager = cameraManager;
window.camera = camera;
window.ioManager = ioManager;

window.isDebugger = false;

// let playerDiorama = null;
const lastEmotionKey = {
key: -1,

0 comments on commit dc9108f

Please sign in to comment.