Skip to content

Commit

Permalink
Remove gltf.ts comments
Browse files Browse the repository at this point in the history
  • Loading branch information
cmhhelgeson committed Jan 25, 2024
1 parent c7f7fb5 commit 11d80a5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 54 deletions.
55 changes: 2 additions & 53 deletions src/sample/skinnedMesh/gltf.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@ import { GLTFNode } from './glbUtils';
/* License for use can be found here: https://github.com/bwasty/gltf-loader-ts/blob/master/LICENSE */
/* Comments have been excluded from original source for sake of cleanliness and brevity */
export type GlTfId = number;
/**
* Indices of those attributes that deviate from their initialization value.
*/

export interface AccessorSparseIndices {
bufferView: GlTfId;
byteOffset?: number;
Expand Down Expand Up @@ -232,47 +230,15 @@ export interface Mesh {
}

export interface Node {
/**
* The index of the camera referenced by this node.
*/
camera?: GlTfId;
/**
* The indices of this node's children.
*/
children?: GlTfId[];
/**
* The index of the skin referenced by this node.
*/
skin?: GlTfId;
/**
* A floating-point 4x4 transformation matrix stored in column-major order.
*/
matrix?: number[];
/**
* A floating-point 4x4 transformation matrix stored in column-major order.
* This matrix acts as a container for a pre-computed world transformation matrix,
* generated after the gltf has been loaded.
*/
worldTransformationMatrix?: Mat4;
/**
* The index of the mesh in this node.
*/
mesh?: GlTfId;
/**
* The node's unit quaternion rotation in the order (x, y, z, w), where w is the scalar.
*/
rotation?: number[];
/**
* The node's non-uniform scale, given as the scaling factors along the x, y, and z axes.
*/
scale?: number[];
/**
* The node's translation along the x, y, and z axes.
*/
translation?: number[];
/**
* The weights of the instantiated Morph Target. Number of elements must match number of Morph Targets of used mesh.
*/
weights?: number[];
name?: any;
extensions?: any;
Expand Down Expand Up @@ -301,9 +267,6 @@ export interface Scene {
[k: string]: any;
root?: GLTFNode;
}
/**
* Joints and matrices defining a skin.
*/
export interface Skin {
/**
* The index of the accessor containing the floating-point 4x4 inverse-bind matrices. The default is that each matrix is a 4x4 identity matrix, which implies that inverse-bind matrices were pre-applied.
Expand All @@ -326,33 +289,19 @@ export interface Skin {
* A texture and its sampler.
*/
export interface Texture {
/**
* The index of the sampler used by this texture. When undefined, a sampler with repeat wrapping and auto filtering should be used.
*/
sampler?: GlTfId;
/**
* The index of the image used by this texture.
*/
source?: GlTfId;
name?: any;
extensions?: any;
extras?: any;
[k: string]: any;
}
/**
* The root object for a glTF asset.
*/

export interface GlTf {
/**
* Names of glTF extensions used somewhere in this asset.
*/
extensionsUsed?: string[];
extensionsRequired?: string[];
accessors?: Accessor[];
animations?: Animation[];
/**
* Metadata about the glTF asset.
*/
asset: Asset;
buffers?: Buffer[];
bufferViews?: BufferView[];
Expand Down
2 changes: 1 addition & 1 deletion src/sample/skinnedMesh/gltf.wgsl
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ fn vertexMain(input: VertexInput) -> VertexOutput {
joint_matrices[input.joints[1]] * input.weights[1] +
joint_matrices[input.joints[2]] * input.weights[2] +
joint_matrices[input.joints[3]] * input.weights[3];
output.Position = camera_uniforms.projMatrix * camera_uniforms.viewMatrix * skin_matrix * vec4<f32>(input.position.x, input.position.y, input.position.z, 1.0);
output.Position = camera_uniforms.projMatrix * camera_uniforms.viewMatrix * camera_uniforms.modelMatrix * vec4<f32>(input.position.x, input.position.y, input.position.z, 1.0);
output.normal = input.normal;
output.joints = vec4<f32>(f32(input.joints[0]), f32(input.joints[1]), f32(input.joints[2]), f32(input.joints[3]));
// Convert to f32 to avoid flat interpolation error
Expand Down

0 comments on commit 11d80a5

Please sign in to comment.