API Docs for: 2.7.3
Show:

ColladaExporter Class

Module: Wanaplan

A Collada exporter.

Methods

_addAsset

(
  • options
)
String private

Gets the assets data. Author, date, scaling, the up axis is determined here.

Parameters:

  • options Object

    A dictionnary of options (See export method docs).

Returns:

String:

Returns a string which contains the assets informations.

_addLibraryControllers

() String private

Gets the controllers. (not implemented)

Returns:

String:

Returns a string which contains the controllers informations.

_addLibraryEffects

() String private

Gets the effects data. It use the _materialsToExport array witch is updated during the _addLibraryGeometries method.

Returns:

String:

Returns a string which contains effects informations.

_addLibraryGeometries

(
  • meshes
)
String private

Gets the geometries data. This method MUST be called first because used materials/textures are determined in it.

Parameters:

  • meshes Array | BABYLON.Mesh

    An array of meshes or a single mesh.

Returns:

String:

Returns a string which contains the meshes informations.

_addLibraryImages

() String private

Gets the images data. It use the _texturesToExprot array which is updated during the _addLibraryGeometries method.

Returns:

String:

Returns a string which contains the images informations.

_addLibraryLights

(
  • cameras
)
String private

Gets the cameras data.

Parameters:

  • cameras Array

    An array of BABYLON.Camera.

Returns:

String:

Returns a string which contains the cameras informations.

_addLibraryLights

(
  • lights
)
String private

Gets the lights data.

Parameters:

  • lights Array

    An array of BABYLON.Light.

Returns:

String:

Returns a string which contains the lights informations.

_addLibraryMaterials

() String private

Gets the materials data. It use the _materialsToExport array witch is updated during the _addLibraryGeometries method.

Returns:

String:

Returns a string which contains the materials informations.

_addLibraryVisualScene

(
  • sceneName
  • meshes
)
String private

Gets visual scene data. It must contains all scene hierarchie such as meshes, lights, cameras, controllers, etc.

Parameters:

  • sceneName String

    The scene's name.

  • meshes Array

    An array of meshes.

Returns:

String:

Returns a string which contains the scene informations.

_addScene

(
  • sceneId
)
String private

Gets the scene data.

Parameters:

  • sceneId Number

    The scene's identifier.

Returns:

String:

Returns a string with scene's data.

addMaterial

(
  • material
)
private

Adds a material to the collection of materials.

Parameters:

  • material BABYLON.Material

    The material to export.

addTexture

(
  • texture
)
private

Adds a texture to the collection of textures.

Parameters:

  • texture BABYLON.Texture

    The texture to export.

Export

(
  • scene
  • options
  • completeCallback
)
static

Exports meshes into a file with options.

Parameters:

  • scene Object

    An object that contains lights, cameras and controllers.

  • options Object

    A dictionary of options (See export method docs).

  • completeCallback Function

    A function called when the process is done.

Export

(
  • scene
  • options
  • completeCallback
)
static

Exports meshes into a file with options.

Parameters:

  • scene Object

    An object that contains lights, cameras and controllers.

  • options Object

    A dictionary of options: - assetPath {String} The relative path for textures - leftHand {Number} Set to 0 for Left hand system or 1 for Right hand sysytem. - filename {String} The desired file name - precision {Number} The precision of vertex data (default is 100). - scaleFactor {Number} The desired scale factor - materialsEnabled {Boolean} Set to true to generate a MTL file which contains material informations - texturesEnabled {Boolean} Set to true to export a zip file with textures. - exportAllTextures {Boolean} Set to true to export all textures type (bump, environment, etc.) - exportLights {Boolean} Set to true to export lights. - exportCameras {Boolean} Set to true to export cameras.

  • completeCallback Function

    A function called when the process is done.

getMenuItem

(
  • options
)
Object static

Gets options which will be displayed in the menu.

Parameters:

  • options Object

    A dictionary with default options for this exporter - filename {String} - scaling {Number} - precision {Number} - leftHand {Boolean} - merged {Boolean} - texturesEnabled {Boolean} - exportLights {Boolean} - exporrCameras {Boolean}

Returns:

Object:

Returns an object ready to add to the menu.

printColor

(
  • color
)
String private

Prints a color.

Parameters:

  • color BABYLON.Color3

    The color to print.

Returns:

String:

Returns a string which contains the informations about the color.

printEffect

(
  • material
)
String private

Prints material's effect informations.

Parameters:

  • material BABYLON.Material

    The material to use.

Returns:

String:

Returns a string which contains the effect's informations.

printGeometry

(
  • mesh
)
String private

Prints the geometry(ies) informations of a mesh.

Parameters:

  • mesh BABYLON.Mesh

    The mesh (single mesh with or without subMeshes).

Returns:

String:

Returns a string which contains the geometry informations about the mesh (and submMeshes).

printMatrix

(
  • matrix
)
String private

Prints a matrix data.

Parameters:

  • matrix BABYLON.Matrix

    The matrix to print.

Returns:

String:

Returns a string which contains the matrix' data.

printTextureInfo

(
  • texture
)
String private

Prints the texture informations (uvScaling, uvOffset)

Parameters:

  • texture BABYLON.Texture

    The texture to print.

Returns:

String:

Returns a string which contains the informations of the texture.

printTextureNewParam

(
  • texture
)
String private

Prints the texture sampler informations.

Parameters:

  • texture BABYLON.Texture

    The texture to print.

Returns:

String:

Returns a string that contains sampler informations.

Events

wnp.engine3D.changeGround

Fired to change the material of the ground

wnp.engine3D.changeSky

Fired to change the material of the sky