GLTF. GLTFPart

GLTFPart - One primitive of a model, placed where its node put it

Constructor

new GLTFPart(name)

Parameters:
NameTypeDescription
namestring

@param {Mesh} mesh @param {Color} color @param {TextureInfo|undefined} textureInfo @param {boolean} transparent

Members

color

Properties
TypeDescription
Color

The material's base color, to draw the mesh tinted with

emissiveMap :TextureInfo|undefined

Type:
  • TextureInfo | undefined
Properties
TypeDescription
TextureInfo | undefined

The material's emissive map, or a white texture when it has an emissiveFactor and no texture, so it glows all over

emissiveMapColor

Properties
TypeDescription
Color

The emissiveFactor, which multiplies the emissive map

mesh

Properties
TypeDescription
Mesh

The geometry in model space, the node transforms applied, with the vertex colors the file had; a node resting at scale 0 is applied at scale 1 there, so an animation can grow it from nothing

name

Properties
TypeDescription
string

The node's name, or its mesh's

node

Properties
TypeDescription
number

The node it came from, which an animation moves it with

normalMap :TextureInfo|undefined

Type:
  • TextureInfo | undefined
Properties
TypeDescription
TextureInfo | undefined

The material's normal map, drawn with the base color texture's uvs

normalScale

Properties
TypeDescription
number

The normal map's strength, its scale in the file

pixelated

Properties
TypeDescription
boolean

Its texture's sampler asks for nearest filtering, hard edged pixels, as pixel art and voxel tools export; the object createObject makes draws it pixelated

textureInfo :TextureInfo|undefined

Type:
  • TextureInfo | undefined
Properties
TypeDescription
TextureInfo | undefined

The material's base color texture, undefined without one or without WebGL

transparent

Properties
TypeDescription
boolean

The material blends or is glass, so the part belongs in the transparent stage

unlit

Properties
TypeDescription
boolean

The material is unlit (KHR_materials_unlit), its own color with no shading; the object createObject makes draws it with emissive 1