-
Notifications
You must be signed in to change notification settings - Fork 124
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
172 changed files
with
12,715 additions
and
11,680 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,30 @@ | ||
import { Path, LatheGeometry } from 'three' | ||
|
||
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) | ||
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) | ||
|
||
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, | ||
this.parameters = { | ||
radius: radius, | ||
height: length, | ||
capSegments: capSegments, | ||
radialSegments: radialSegments, | ||
} | ||
} | ||
} | ||
|
||
static fromJSON(data) { | ||
return new CapsuleGeometry(data.radius, data.length, data.capSegments, data.radialSegments) | ||
static fromJSON(data) { | ||
return new CapsuleGeometry(data.radius, data.length, data.capSegments, data.radialSegments) | ||
} | ||
} | ||
} | ||
|
||
return CapsuleGeometry | ||
})() | ||
|
||
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 |
---|---|---|
@@ -0,0 +1,25 @@ | ||
export function decodeText(array) { | ||
if (typeof TextDecoder !== 'undefined') { | ||
return new TextDecoder().decode(array) | ||
} | ||
|
||
// Avoid the String.fromCharCode.apply(null, array) shortcut, which | ||
// throws a "maximum call stack size exceeded" error for large arrays. | ||
|
||
let s = '' | ||
|
||
for (let i = 0, il = array.length; i < il; i++) { | ||
// Implicitly assumes little-endian. | ||
s += String.fromCharCode(array[i]) | ||
} | ||
|
||
try { | ||
// merges multi-byte utf-8 characters. | ||
|
||
return decodeURIComponent(escape(s)) | ||
} catch (e) { | ||
// see https://github.com/mrdoob/three.js/issues/16358 | ||
|
||
return s | ||
} | ||
} |
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 = parseInt(REVISION.replace(/\D+/g, '')) | ||
export const version = /* @__PURE__ */ (() => 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import { version } from "./constants"; | ||
|
||
/** uv2 renamed to uv1 in r125 | ||
* | ||
* https://github.com/mrdoob/three.js/pull/25943 | ||
*/ | ||
export const UV1 = version >= 125 ? 'uv1' : 'uv2' |
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.