Reference Source

Function

Static Public Summary
public

Helper to convert multi-block structures to models used by ModelRender

public

OrbitControls(object: *, domElement: *)

public

deepDisposeMesh(obj: *, removeChildren: *)

public
public

findMatchingVariant(variants: *, selector: *): *

public

loadAndMergeModel(model: *, assetRoot: *): *

public

loadBlockState(state: string, assetRoot: string): Promise<object>

Loads a blockstate file and returns the contained JSON

public

Loads a model file and returns the contained JSON

public

loadModel(model: *, type: *, assetRoot: *): *

public

loadTextureAsBase64(root: string, namespace: string, dir: string, name: string): Promise<string>

Loads a Mincraft texture an returns it as Base64

public

loadTextureMeta(texture: *, assetRoot: *): *

public

loadTextures(textureNames: *, assetRoot: *): *

public

mergeCubeMeshes(cubes: *, toBuffer: *): {"geometry": *, "materials": *}

public

mergeMeshes__(meshes: *, toBufferGeometry: *): *

public

mergeParents(model: *, modelName: *, assetRoot: *): *

public

modelCacheKey(model: *): *

public

parseModel(model: *, modelOptions: *, parsedModelList: *, assetRoot: *): *

public

parseModelType(string: *): {"type": string, "model": string}

public

scaleUv(uv: number, size: number, scale: number): number

Scales UV values

public

toRadians(angle: *): *

public

trimCanvas(c: *): *

public
public

worker(self: *)

Static Public

public ModelConverter() source

import ModelConverter from 'minerender/src/model/modelConverter.js'

Helper to convert multi-block structures to models used by ModelRender

public OrbitControls(object: *, domElement: *) source

import OrbitControls from 'minerender/src/lib/OrbitControls.js'

Params:

NameTypeAttributeDescription
object *
domElement *

public deepDisposeMesh(obj: *, removeChildren: *) source

import {deepDisposeMesh} from 'minerender/src/renderBase.js'

Params:

NameTypeAttributeDescription
obj *
removeChildren *

public deleteObjectProperties(obj: *) source

import {deleteObjectProperties} from 'minerender/src/model/modelFunctions.js'

Params:

NameTypeAttributeDescription
obj *

public findMatchingVariant(variants: *, selector: *): * source

import {findMatchingVariant} from 'minerender/src/model/modelFunctions.js'

Params:

NameTypeAttributeDescription
variants *
selector *

Return:

*

public loadAndMergeModel(model: *, assetRoot: *): * source

import {loadAndMergeModel} from 'minerender/src/model/modelFunctions.js'

Params:

NameTypeAttributeDescription
model *
assetRoot *

Return:

*

public loadBlockState(state: string, assetRoot: string): Promise<object> source

import {loadBlockState} from 'minerender/src/functions.js'

Loads a blockstate file and returns the contained JSON

Params:

NameTypeAttributeDescription
state string

Name of the blockstate

assetRoot string

Asset root, see DEFAULT_ROOT

Return:

Promise<object>

public loadJsonFromPath(root: string, path: string): Promise<object> source

import {loadJsonFromPath} from 'minerender/src/functions.js'

Loads a model file and returns the contained JSON

Params:

NameTypeAttributeDescription
root string

Asset root, see DEFAULT_ROOT

path string

Path to the model file

Return:

Promise<object>

public loadModel(model: *, type: *, assetRoot: *): * source

import {loadModel} from 'minerender/src/model/modelFunctions.js'

Params:

NameTypeAttributeDescription
model *
type *
assetRoot *

Return:

*

public loadTextureAsBase64(root: string, namespace: string, dir: string, name: string): Promise<string> source

import {loadTextureAsBase64} from 'minerender/src/functions.js'

Loads a Mincraft texture an returns it as Base64

Params:

NameTypeAttributeDescription
root string

Asset root, see DEFAULT_ROOT

namespace string

Namespace, usually 'minecraft'

dir string

Directory of the texture

name string

Name of the texture

Return:

Promise<string>

public loadTextureMeta(texture: *, assetRoot: *): * source

import {loadTextureMeta} from 'minerender/src/functions.js'

Params:

NameTypeAttributeDescription
texture *
assetRoot *

Return:

*

public loadTextures(textureNames: *, assetRoot: *): * source

import {loadTextures} from 'minerender/src/model/modelFunctions.js'

Params:

NameTypeAttributeDescription
textureNames *
assetRoot *

Return:

*

public mergeCubeMeshes(cubes: *, toBuffer: *): {"geometry": *, "materials": *} source

import {mergeCubeMeshes} from 'minerender/src/renderBase.js'

Params:

NameTypeAttributeDescription
cubes *
toBuffer *

Return:

{"geometry": *, "materials": *}

public mergeMeshes__(meshes: *, toBufferGeometry: *): * source

import {mergeMeshes__} from 'minerender/src/renderBase.js'

Params:

NameTypeAttributeDescription
meshes *
toBufferGeometry *

Return:

*

public mergeParents(model: *, modelName: *, assetRoot: *): * source

import {mergeParents} from 'minerender/src/model/modelFunctions.js'

Params:

NameTypeAttributeDescription
model *
modelName *
assetRoot *

Return:

*

public modelCacheKey(model: *): * source

import {modelCacheKey} from 'minerender/src/model/modelFunctions.js'

Params:

NameTypeAttributeDescription
model *

Return:

*

public parseModel(model: *, modelOptions: *, parsedModelList: *, assetRoot: *): * source

import {parseModel} from 'minerender/src/model/modelFunctions.js'

Params:

NameTypeAttributeDescription
model *
modelOptions *
parsedModelList *
assetRoot *

Return:

*

public parseModelType(string: *): {"type": string, "model": string} source

import {parseModelType} from 'minerender/src/model/modelFunctions.js'

Params:

NameTypeAttributeDescription
string *

Return:

{"type": string, "model": string}

public scaleUv(uv: number, size: number, scale: number): number source

import {scaleUv} from 'minerender/src/functions.js'

Scales UV values

Params:

NameTypeAttributeDescription
uv number

UV value

size number
scale number
  • optional
  • default: 16

Return:

number

public toRadians(angle: *): * source

import {toRadians} from 'minerender/src/model/modelFunctions.js'

Params:

NameTypeAttributeDescription
angle *

Return:

*

public trimCanvas(c: *): * source

import {trimCanvas} from 'minerender/src/functions.js'

Params:

NameTypeAttributeDescription
c *

Return:

*

public variantStringToObject(str: *): * source

import {variantStringToObject} from 'minerender/src/model/modelFunctions.js'

Params:

NameTypeAttributeDescription
str *

Return:

*

public worker(self: *) source

Params:

NameTypeAttributeDescription
self *