wnp.Assimp2jsonImporter
Summary
An importer for assimp2json export.
Item Index
Methods
_createWebGLTexture
Syntax
_createWebGLTexture
-
image -
[invertY]
Summary
Creates a WebGL texture.
Parameters:
-
imageImageThe image to convert into WebGLTexture
-
[invertY]Boolean optionalSets to
trueto invert Y axis.
Returns:
Returns a WebGLTexture.
_getTextureName
Syntax
Summary
Gets the name of a texture by extracting it via its path.
Parameters:
Returns:
Returns the name of the texture.
_toColor
Syntax
_toColor
-
value
Summary
Gets a color from an array.
Parameters:
-
valueArrayAn array with three elements that represents a color (RGB).
Returns:
Returns a color object which can be used on a BABYLON.Mesh.
_toIndices
Syntax
Summary
Gets an Array of indice from an array.
Parameters:
-
valueArrayAn array of array which contains three elements that represents faces.
Returns:
Returns an array of indices.
applyTransform
Syntax
applyTransform
-
mesh -
transformation
Summary
Apply transformation to a mesh and sets its parent.
Parameters:
-
meshBABYLON.MeshThe mesh to use.
-
transformationArrayAn array used as a transform matrix (right handed).
applyTransformRecursive
Syntax
applyTransformRecursive
-
meshes -
data
Summary
Apply transformations to a set of meshes recursively.
build
Syntax
build
-
json -
options -
success -
fail
Summary
Build all meshes with JSON informations.
generateMaterials
Syntax
Summary
Generate materials from json data.
Parameters:
-
jsonObjectA paresed JSON that contains informations about materials.
-
texturesArrayAn array of textures.
-
pathStringThe path used for textures.
-
backFaceCullingBooleanA flag for enable or disable the backFaceCulling.
-
noTextureBooleanA flag to bypass all textures.
-
importedTexturesObjectAn object which contains imported textures from the API.
Returns:
Returns an array of materials.
generateMeshes
Syntax
Summary
Generates meshes from json data.
Parameters:
Returns:
Returns an array of meshes.
generateTextures
Syntax
Summary
Generate textures from json data.
Parameters:
-
jsonObjectA paresed JSON that contains informations about textures.
Returns:
Returns an array of textures.
indexOf
Syntax
Summary
Gets the index of a mesh by its name.
Returns:
Returns the index of the mesh in the collection if it exits, otherwise it returns -1.
load
Syntax
load
-
path -
options -
success -
fail
Summary
Load a model in JSON format.
Parameters:
-
pathStringThe path of the model.
-
optionsObjectA set of options: - position =>
BAYLON.Vector3- rotation =>BAYLON.Vector3- scaling =>BAYLON.Vector3orNumber- backFaceCulling =>Boolean- centerGeometry =>Boolean- path =>StringA path to use for texture (by default all textures have a relative path to the model). - importedTexture =>ObjectAn dictionary which as the name of the texture as name and a base64 encoded image as value. - noTexture =>BooleanForce the loader to not use texture but only colors. -
successFunctionA function called when the model is fully loaded and ready to use. the model is passed as parameter of the function.
-
failFunctionA function called if the loading fails.
Returns:
Returns the root mesh which contains all submeshes.