-
Notifications
You must be signed in to change notification settings - Fork 120
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: revert tree-shaking around use of classes
TypeScript cannot see that the result is the same whether an IIFE or a class using modern static keywords.
- Loading branch information
1 parent
a9e93f2
commit bc97e08
Showing
128 changed files
with
11,559 additions
and
11,692 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,26 @@ | ||
import { Path, LatheGeometry } from 'three' | ||
|
||
const CapsuleGeometry = /* @__PURE__ */ (() => { | ||
class CapsuleGeometry extends LatheGeometry { | ||
constructor(radius = 1, length = 1, capSegments = 4, radialSegments = 8) { | ||
const path = new Path() | ||
path.absarc(0, -length / 2, radius, Math.PI * 1.5, 0) | ||
path.absarc(0, length / 2, radius, 0, Math.PI * 0.5) | ||
class CapsuleGeometry extends LatheGeometry { | ||
constructor(radius = 1, length = 1, capSegments = 4, radialSegments = 8) { | ||
const path = new Path() | ||
path.absarc(0, -length / 2, radius, Math.PI * 1.5, 0) | ||
path.absarc(0, length / 2, radius, 0, Math.PI * 0.5) | ||
|
||
super(path.getPoints(capSegments), radialSegments) | ||
super(path.getPoints(capSegments), radialSegments) | ||
|
||
this.type = 'CapsuleGeometry' | ||
this.type = 'CapsuleGeometry' | ||
|
||
this.parameters = { | ||
radius: radius, | ||
height: length, | ||
capSegments: capSegments, | ||
radialSegments: radialSegments, | ||
} | ||
} | ||
|
||
static fromJSON(data) { | ||
return new CapsuleGeometry(data.radius, data.length, data.capSegments, data.radialSegments) | ||
this.parameters = { | ||
radius: radius, | ||
height: length, | ||
capSegments: capSegments, | ||
radialSegments: radialSegments, | ||
} | ||
} | ||
|
||
return CapsuleGeometry | ||
})() | ||
static fromJSON(data) { | ||
return new CapsuleGeometry(data.radius, data.length, data.capSegments, data.radialSegments) | ||
} | ||
} | ||
|
||
export { CapsuleGeometry } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
import { REVISION } from 'three' | ||
|
||
export const version = /* @__PURE__ */ (() => parseInt(REVISION.replace(/\D+/g, '')))() | ||
export const version = parseInt(REVISION.replace(/\D+/g, '')) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.