Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: pmndrs/three-stdlib
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v2.35.10
Choose a base ref
...
head repository: pmndrs/three-stdlib
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: main
Choose a head ref
  • 7 commits
  • 13 files changed
  • 4 contributors

Commits on Jan 19, 2025

  1. Copy the full SHA
    5b1448e View commit details
  2. Copy the full SHA
    6bed3f4 View commit details

Commits on Jan 29, 2025

  1. Copy the full SHA
    12f00a3 View commit details

Commits on Feb 20, 2025

  1. Copy the full SHA
    c122b5c View commit details

Commits on Apr 5, 2025

  1. Copy the full SHA
    b51a7c9 View commit details

Commits on Apr 23, 2025

  1. Copy the full SHA
    e079bc8 View commit details

Commits on Apr 29, 2025

  1. Copy the full SHA
    e6653ce View commit details
14 changes: 4 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
@@ -23,14 +23,9 @@
"main": "./index.cjs",
"module": "./index.js",
"exports": {
"require": {
"types": "./index.d.cts",
"default": "./index.cjs"
},
"default": {
"types": "./index.d.ts",
"default": "./index.js"
}
"types": "./index.d.ts",
"require": "./index.cjs",
"import": "./index.js"
},
"sideEffects": false,
"devDependencies": {
@@ -40,7 +35,6 @@
"json": "^11.0.0",
"prettier": "^2.2.1",
"rimraf": "^3.0.2",
"shelljs": "^0.8.5",
"three": "^0.128.0",
"typescript": "^4.7.4",
"vite": "^4.3.8"
@@ -57,7 +51,7 @@
"three": ">=0.128.0"
},
"scripts": {
"build": "rimraf dist && vite build && tsc --emitDeclarationOnly && copyfiles -u 1 \"src/**/*.d.ts\" dist && copyfiles package.json README.md LICENSE dist && json -I -f dist/package.json -e \"this.private=undefined;this.type=\\\"module\\\";\" && node patch-ts.js",
"build": "rimraf dist && vite build && tsc --emitDeclarationOnly && copyfiles -u 1 \"src/**/*.d.ts\" dist && copyfiles package.json README.md LICENSE dist && json -I -f dist/package.json -e \"this.private=undefined;this.type=\\\"module\\\";\"",
"lint": "tsc --noEmit"
}
}
23 changes: 0 additions & 23 deletions patch-ts.js

This file was deleted.

5 changes: 3 additions & 2 deletions src/controls/PointerLockControls.ts
Original file line number Diff line number Diff line change
@@ -6,6 +6,7 @@ const _vector = /* @__PURE__ */ new Vector3()
const _changeEvent = { type: 'change' }
const _lockEvent = { type: 'lock' }
const _unlockEvent = { type: 'unlock' }
const _MOUSE_SENSITIVITY = 0.002
const _PI_2 = Math.PI / 2

export interface PointerLockControlsEventMap {
@@ -52,8 +53,8 @@ class PointerLockControls extends EventDispatcher<PointerLockControlsEventMap> {
private onMouseMove = (event: MouseEvent): void => {
if (!this.domElement || this.isLocked === false) return
_euler.setFromQuaternion(this.camera.quaternion)
_euler.y -= event.movementX * 0.002 * this.pointerSpeed
_euler.x -= event.movementY * 0.002 * this.pointerSpeed
_euler.y -= event.movementX * _MOUSE_SENSITIVITY * this.pointerSpeed
_euler.x -= event.movementY * _MOUSE_SENSITIVITY * this.pointerSpeed
_euler.x = Math.max(_PI_2 - this.maxPolarAngle, Math.min(_PI_2 - this.minPolarAngle, _euler.x))
this.camera.quaternion.setFromEuler(_euler)
// @ts-ignore
13 changes: 11 additions & 2 deletions src/exporters/GLTFExporter.js
Original file line number Diff line number Diff line change
@@ -1024,7 +1024,13 @@ class GLTFWriter {
componentSize = 4
}

const byteLength = getPaddedBufferSize(count * attribute.itemSize * componentSize)
let byteStride = attribute.itemSize * componentSize
if (target === WEBGL_CONSTANTS.ARRAY_BUFFER) {
// Each element of a vertex attribute MUST be aligned to 4-byte boundaries
// inside a bufferView
byteStride = Math.ceil(byteStride / 4) * 4
}
const byteLength = getPaddedBufferSize(count * byteStride)
const dataView = new DataView(new ArrayBuffer(byteLength))
let offset = 0

@@ -1065,6 +1071,9 @@ class GLTFWriter {

offset += componentSize
}
if (offset % byteStride !== 0) {
offset += byteStride - (offset % byteStride)
}
}

const bufferViewDef = {
@@ -1077,7 +1086,7 @@ class GLTFWriter {

if (target === WEBGL_CONSTANTS.ARRAY_BUFFER) {
// Only define byteStride for vertex attributes.
bufferViewDef.byteStride = attribute.itemSize * componentSize
bufferViewDef.byteStride = byteStride
}

this.byteOffset += byteLength
Loading