wnp.Assimp2jsonImporter Class
An importer for assimp2json export.
Item Index
Methods
_createWebGLTexture
-
image
-
[invertY]
Creates a WebGL texture.
Parameters:
-
image
ImageThe image to convert into WebGLTexture
-
[invertY]
Boolean optionalSets to
true
to invert Y axis.
Returns:
Returns a WebGLTexture
.
_getTextureName
-
delimiter
-
textureName
Gets the name of a texture by extracting it via its path.
Parameters:
Returns:
Returns the name of the texture.
_toColor
-
value
Gets a color from an array.
Parameters:
-
value
ArrayAn array with three elements that represents a color (RGB).
Returns:
Returns a color object which can be used on a BABYLON.Mesh
.
_toIndices
-
value
Gets an Array
of indice from an array.
Parameters:
-
value
ArrayAn array of array which contains three elements that represents faces.
Returns:
Returns an array of indices.
applyTransform
-
mesh
-
transformation
Apply transformation to a mesh and sets its parent.
Parameters:
-
mesh
BABYLON.MeshThe mesh to use.
-
transformation
ArrayAn array used as a transform matrix (right handed).
applyTransformRecursive
-
meshes
-
data
Apply transformations to a set of meshes recursively.
build
-
json
-
options
-
success
-
fail
Build all meshes with JSON informations.
generateMaterials
-
json
-
textures
-
path
-
backFaceCulling
-
noTexture
-
importedTextures
Generate materials from json data.
Parameters:
-
json
ObjectA paresed JSON that contains informations about materials.
-
textures
ArrayAn array of textures.
-
path
StringThe path used for textures.
-
backFaceCulling
BooleanA flag for enable or disable the backFaceCulling.
-
noTexture
BooleanA flag to bypass all textures.
-
importedTextures
ObjectAn object which contains imported textures from the API.
Returns:
Returns an array of materials.
generateMeshes
-
json
-
material
-
[userUniqueName]
Generates meshes from json data.
Parameters:
Returns:
Returns an array of meshes.
generateTextures
-
json
Generate textures from json data.
Parameters:
-
json
ObjectA paresed JSON that contains informations about textures.
Returns:
Returns an array of textures.
indexOf
-
meshes
-
name
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
-
path
-
options
-
success
-
fail
Load a model in JSON format.
Parameters:
-
path
StringThe path of the model.
-
options
ObjectA set of options: - position =>
BAYLON.Vector3
- rotation =>BAYLON.Vector3
- scaling =>BAYLON.Vector3
orNumber
- backFaceCulling =>Boolean
- centerGeometry =>Boolean
- path =>String
A path to use for texture (by default all textures have a relative path to the model). - importedTexture =>Object
An dictionary which as the name of the texture as name and a base64 encoded image as value. - noTexture =>Boolean
Force the loader to not use texture but only colors. -
success
FunctionA function called when the model is fully loaded and ready to use. the model is passed as parameter of the function.
-
fail
FunctionA function called if the loading fails.
Returns:
Returns the root mesh which contains all submeshes.