We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8b10d70 commit fa0de62Copy full SHA for fa0de62
demos/math3d/Math3D.js
@@ -96,7 +96,7 @@ export class Math3D extends xb.Script {
96
97
this.keyboard = new Keyboard();
98
this.add(this.keyboard);
99
- this.keyboard.position.set(0, -0.3, -0.);
+ this.keyboard.position.set(0, -0.3, 0);
100
101
const startFn = this.mathObjects[0].functionText;
102
@@ -191,7 +191,7 @@ export class Math3D extends xb.Script {
191
try {
192
z = zFunction(x, y);
193
// Clamp the value to stay between -Z_LIMIT and Z_LIMIT
194
- z = Math.max(-Z_LIMIT, Math.min(Z_LIMIT, z));
+ z = xb.clamp(z, -Z_LIMIT, Z_LIMIT);
195
196
// Handle cases where the math results in NaN (not a number)
197
if (isNaN(z)) z = 0;
0 commit comments