Skip to content

Commit 07afdd5

Browse files
committed
added square root and step functions. added paper crumple sound effect to deleting stuff with the delete button.
1 parent dd34348 commit 07afdd5

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

objectEditMenu.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -298,6 +298,10 @@ export function initializeObjectEditMenu(scene, camera, renderer, animationManag
298298
clearOutline();
299299
renderer.render(scene, camera);
300300
hideContextMenu();
301+
//add paper crumpling sound
302+
const audio = new Audio('https://www.soundjay.com/misc/sounds/paper-throw-1.mp3');
303+
audio.volume = 0.5; // Set volume to 50%
304+
audio.play();
301305
});
302306

303307
//duplicate button

parametricFunctions.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,4 +86,15 @@ export const parametricFunctions = {
8686
},
8787
params: { amplitude: 1, frequency: 1, phase: 0, verticalShift: 0 },
8888
},
89+
stepFunction: {
90+
apply: (t, { stepSize, stepHeight, verticalShift }) => {
91+
const step = Math.floor(t / stepSize);
92+
return step * stepHeight + verticalShift;
93+
},
94+
params: { stepSize: 1, stepHeight: 1, verticalShift: 0 },
95+
},
96+
squareRoot: {
97+
apply: (t, { timesRoot, verticalShift }) => (timesRoot * Math.sqrt(t)) + verticalShift,
98+
params: { timesRoot: 1, verticalShift: 0 },
99+
}
89100
};

0 commit comments

Comments
 (0)