-
-
Notifications
You must be signed in to change notification settings - Fork 110
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove broken debug bindings #66
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -48,13 +48,12 @@ export class Grid extends Primitive { | |
|
||
make() { | ||
// Build transition mask lookup | ||
let axis; | ||
let mask = this._helpers.object.mask(); | ||
|
||
// Build fragment material lookup | ||
const material = this._helpers.shade.pipeline() || false; | ||
|
||
axis = (first, second, transpose) => { | ||
const axis = (first, second, transpose) => { | ||
// Prepare data buffer of tick positions | ||
let position; | ||
const detail = this._get(first + "axis.detail"); | ||
|
@@ -133,7 +132,7 @@ export class Grid extends Primitive { | |
// Register lines | ||
const lines = (() => { | ||
const result = []; | ||
for (axis of this.axes) { | ||
for (const axis of this.axes) { | ||
result.push(axis.line); | ||
} | ||
return result; | ||
|
@@ -171,7 +170,7 @@ export class Grid extends Primitive { | |
changed["grid.crossed"] || | ||
(changed["grid.axes"] && this.props.crossed) | ||
) { | ||
return this.rebuild(); | ||
this.rebuild(); | ||
} | ||
|
||
if ( | ||
|
@@ -183,12 +182,14 @@ export class Grid extends Primitive { | |
touched["origin"] || | ||
init | ||
) { | ||
return this.updateRanges(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. these artifacts are all over the codebase from the coffeescript conversion. |
||
this.updateRanges(); | ||
} | ||
} | ||
|
||
updateRanges() { | ||
const axis = (x, y, range1, range2, axis) => { | ||
const { axes, origin } = this.props; | ||
|
||
const axisFn = (x, y, range1, range2, axis) => { | ||
const { second, resolution, samples, line, buffer, values } = axis; | ||
|
||
// Set line steps along first axis | ||
|
@@ -214,22 +215,18 @@ export class Grid extends Primitive { | |
}; | ||
|
||
// Fetch grid range in both dimensions | ||
const { axes, origin } = this.props; | ||
const range1 = this._helpers.span.get("x.", axes[0]); | ||
const range2 = this._helpers.span.get("y.", axes[1]); | ||
|
||
// Update both line sets | ||
const { lineX, lineY } = this.props; | ||
|
||
if (lineX) { | ||
axis(axes[0], axes[1], range1, range2, this.axes[0]); | ||
axisFn(axes[0], axes[1], range1, range2, this.axes[0]); | ||
} | ||
if (lineY) { | ||
axis(axes[1], axes[0], range2, range1, this.axes[+lineX]); | ||
axisFn(axes[1], axes[0], range2, range1, this.axes[+lineX]); | ||
} | ||
window.cake1 = this.axes[0].buffer; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. whoops! |
||
window.cake2 = this.axes[1].buffer; | ||
window.cake3 = this.axes[0]; | ||
} | ||
} | ||
Grid.initClass(); |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,11 +12,13 @@ import { Vector4 } from "three"; | |
export const setOrigin = function (vec, dimensions, origin) { | ||
if (+dimensions === dimensions) { | ||
dimensions = [dimensions]; | ||
} else { | ||
dimensions = Array.from(dimensions); | ||
} | ||
const x = Array.from(dimensions).includes(1) ? 0 : origin.x; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. while debugging a different problem that turned out to be user error, I introduced this mild cleanup. |
||
const y = Array.from(dimensions).includes(2) ? 0 : origin.y; | ||
const z = Array.from(dimensions).includes(3) ? 0 : origin.z; | ||
const w = Array.from(dimensions).includes(4) ? 0 : origin.w; | ||
const x = dimensions.includes(1) ? 0 : origin.x; | ||
const y = dimensions.includes(2) ? 0 : origin.y; | ||
const z = dimensions.includes(3) ? 0 : origin.z; | ||
const w = dimensions.includes(4) ? 0 : origin.w; | ||
return vec.set(x, y, z, w); | ||
}; | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this was rebinding the function binding...