Skip to content

Commit

Permalink
Fixes #36. Add NORMAL data only if given.
Browse files Browse the repository at this point in the history
  • Loading branch information
wnayes committed Nov 13, 2022
1 parent ef4ff65 commit 6dacb78
Show file tree
Hide file tree
Showing 12 changed files with 756 additions and 327 deletions.
12 changes: 7 additions & 5 deletions dist/gltfjsutils.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -216,15 +216,16 @@ declare module "src/material" {
}
declare module "src/vertex" {
import { RGBColor, RGBAColor } from "src/types";
/** Represents a mesh vertex. */
export class Vertex {
x: number;
y: number;
z: number;
u: number;
v: number;
normalX: number;
normalY: number;
normalZ: number;
normalX?: number;
normalY?: number;
normalZ?: number;
color?: RGBColor | RGBAColor;
}
}
Expand All @@ -239,7 +240,7 @@ declare module "src/mesh" {
private _faceColors;
private _materialIndices;
addFace(v1: Vertex, v2: Vertex, v3: Vertex, color?: RGBColor | RGBAColor, materialIndex?: number): void;
forEachFace(fn: (v1: Vertex, v2: Vertex, v3: Vertex, color: RGBColor | RGBAColor | undefined, materialIndex: number) => void): void;
forEachFace(fn: (v1: Vertex, v2: Vertex, v3: Vertex, color: RGBColor | RGBAColor | undefined, materialIndex: number) => boolean | void): void;
}
}
declare module "src/skin" {
Expand Down Expand Up @@ -598,7 +599,7 @@ declare module "src/index" {
export { Skin } from "src/skin";
export { Animation } from "src/animation";
export { Vector3, Quaternion, Matrix, Matrix3x3, Matrix4x4 } from "src/math";
export { AlphaMode, ComponentType, DataType, MeshMode, RGBColor, RGBAColor, VertexColorMode, WrappingMode, InterpolationMode, Transformation } from "src/types";
export { AlphaMode, ComponentType, DataType, MeshMode, RGBColor, RGBAColor, VertexColorMode, WrappingMode, InterpolationMode, Transformation, } from "src/types";
export { ImageOutputType, BufferOutputType } from "src/types";
export { Buffer, BufferView } from "src/buffer";
export type { BufferAccessorInfo } from "src/buffer";
Expand Down Expand Up @@ -670,3 +671,4 @@ declare module "test/math.spec" {
declare module "test/texture.spec" {
import "mocha";
}
declare module "test/integration/triangle.spec" { }
165 changes: 99 additions & 66 deletions dist/gltfjsutils.js

Large diffs are not rendered by default.

13 changes: 13 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"types": "./dist/index.d.ts",
"scripts": {
"build": "webpack & tsc --emitDeclarationOnly true --declaration --outFile \"./dist/gltfjsutils.d.ts\"",
"test": "cross-env TS_NODE_COMPILER_OPTIONS='{ \"module\": \"commonjs\" }' mocha --require ts-node/register test/*.spec.ts"
"test": "cross-env TS_NODE_COMPILER_OPTIONS='{ \"module\": \"commonjs\" }' mocha --require ts-node/register --recursive --extension spec.ts test"
},
"keywords": [
"glTF"
Expand All @@ -26,6 +26,7 @@
"chai": "^4.3.7",
"cross-env": "^7.0.3",
"eslint": "^8.27.0",
"gltf-validator": "^2.0.0-dev.3.9",
"mocha": "^10.1.0",
"ts-loader": "^9.4.1",
"ts-node": "^10.9.1",
Expand Down
Loading

0 comments on commit 6dacb78

Please sign in to comment.