Unigine::ColladaImport Class
A class for the Collada import plugin, which allows importing a scene from a DAE file into Unigine engine.
int COLLADA_IMPORT_AXIS_X
Description
X-coordinate position.int COLLADA_IMPORT_AXIS_Y
Description
Y-coordinate position.int COLLADA_IMPORT_AXIS_Z
Description
Z-coordinate position.int COLLADA_IMPORT_CAMERA_ORTHOGRAPHIC
Description
Orthogonal camera.int COLLADA_IMPORT_CAMERA_PERSPECTIVE
Description
Perspective camera.int COLLADA_IMPORT_EFFECT_BLINN
Description
Blinn-Phong shading.int COLLADA_IMPORT_EFFECT_CONSTANT
Description
Constant shading.int COLLADA_IMPORT_EFFECT_LAMBERT
Description
Lambertian shading.int COLLADA_IMPORT_EFFECT_PHONG
Description
Phong shading.int COLLADA_IMPORT_LIGHT_AMBIENT
Description
Ambient light.int COLLADA_IMPORT_LIGHT_DIRECTIONAL
Description
Directional light.int COLLADA_IMPORT_LIGHT_POINT
Description
Point light.int COLLADA_IMPORT_LIGHT_SPOT
Description
Spot-specific (projection) light.ColladaImport Class
Members
int getAnimation(int num, Unigine::Ptr<Unigine::Mesh> mesh, float scale, float fps)
Copies the DAE animation into the given mesh.Arguments
- int num - The node skin number.
- Unigine::Ptr<Unigine::Mesh> mesh - Mesh, into which the animation is copied.
- float scale - The mesh scale.
- float fps - The fps value of the animation frame.
Return value
1 if the animation is added successfully; otherwise, 0.string getAuthor()
Returns the string with the author's name.Return value
Author's name.string getCameraID(int num)
Returns the string with the camera identifier.Arguments
- int num - Camera ID number.
Return value
Camera identifier.string getCameraName(int num)
Returns the string with the camera name.Arguments
- int num - Camera ID number.
Return value
Camera name.int getCameraType(int num)
Returns the camera type.Arguments
- int num - Camera ID number.
Return value
Type of the camera.float getCameraXMagFov(int num)
Returns the horizontal magnification or FOV value for specified orthogonal camera.Arguments
- int num - Camera ID number.
Return value
Horizontal magnification or FOV value.float getCameraYMagFov(int num)
Returns the vertical magnification or FOV value for specified orthogonal camera.Arguments
- int num - Camera ID number.
Return value
Vertical magnification or FOV value.float getCameraZFar(int num)
Returns the camera far clipping plane value.Arguments
- int num - Camera ID number.
Return value
Far clipping plane.float getCameraZNear(int num)
Returns the camera near clipping plane value.Arguments
- int num - Camera ID number.
Return value
Near clipping plane.string getComments()
Returns the string with the user comments.Return value
User comments.vec3 getLightColor(int num)
Returns the light color.Arguments
- int num - Light ID number.
Return value
Color model of three values.float getLightConstantAttenuation(int num)
Returns the constant light attenuation value for point and spot lights.Arguments
- int num - Light ID number.
Return value
Constant light attenuation value.float getLightFalloffAngle(int num)
Returns the light falloff angle value for spot-specific lights.Arguments
- int num - Light ID number.
Return value
Light falloff angle value.float getLightFalloffExponent(int num)
Returns the light falloff exponent value for spot-specific lights.Arguments
- int num - Light ID number.
Return value
Light falloff exponent.string getLightID(int num)
Returns the string with the light identifier.Arguments
- int num - Light ID number.
Return value
Light identifier.float getLightLinearAttenuation(int num)
Returns the linear light attenuation value for point and spot lights.Arguments
- int num - Light ID number.
Return value
Linear light attenuation value.string getLightName(int num)
Returns the string with the light name.Arguments
- int num - Light ID number.
Return value
Light name.float getLightQuadraticAttenuation(int num)
Returns the quadratic light attenuation value for point and spot lights.Arguments
- int num - Light ID number.
Return value
Quadratic light attenuation value.int getLightType(int num)
Returns the type of the light.Arguments
- int num - Light ID number.
Return value
Light type.string getMaterialID(int num)
Returns the string with the material identifier.Arguments
- int num - Material ID number.
Return value
Material identifier.string getMaterialName(int num)
Returns the string with the material name.Arguments
- int num - Material ID number.
Return value
Material name.string getMaterialParameterImage(int num, int parameter)
Returns a string with the material parameter image directory.Arguments
- int num - Material ID number.
- int parameter - Material parameter.
Return value
Parameter image.string getMaterialParameterName(int num, int parameter)
Returns a string with the material parameter name.Arguments
- int num - Material ID number.
- int parameter - Parameter ID number.
Return value
Parameter name.vec4 getMaterialParameterValue(int num, int parameter)
Returns the value of the material parameter.Arguments
- int num - Material ID number.
- int parameter - Parameter ID number.
Return value
Parameter value.int getMaterialType(int num)
Returns the material type.Arguments
- int num - Material ID number.
Return value
Material type.float getMaxTime()
Returns the maximum animation time.Return value
Maximum animation time.int getMesh(int num, int skin_num, int morph_num, Unigine::Ptr<Unigine::Mesh> mesh, float scale)
Copies the DAE mesh with the given skin and morph controllers into the specified mesh with the given scale.Arguments
- int num - The node mesh number.
- int skin_num - The skin controller number. If -1 is passed, the mesh will be copied without skinning.
- int morph_num - The morph controller number. It can contain several targets. If the -1 is passed, the mesh will be copied without morph targets.
- Unigine::Ptr<Unigine::Mesh> mesh - Mesh, into which the given mesh is copied.
- float scale - The mesh scale.
Return value
1 if the mesh is copied successfully; otherwise, 0.string getMeshID(int num)
Returns the string with the mesh identifier.Arguments
- int num - The mesh number.
Return value
Mesh identifier.string getMeshName(int num)
Returns the string with the mesh name.Arguments
- int num - The mesh number.
Return value
Mesh name.string getMeshSurfaceName(int num, int surface)
Returns the string with the mesh surface name.Arguments
- int num - The mesh number.
- int surface - The surface number.
Return value
Surface name.float getMeter()
Returns the value of the unit meter.Return value
Unit meter value.float getMinTime()
Returns the minimum animation time.Return value
Minimum animation time.int getNodeCamera(int num)
Returns the camera node.Arguments
- int num - Node ID number.
Return value
Camera node.int getNodeChild(int num, int child)
Returns the child node for the specified node.Arguments
- int num - Node ID number.
- int child - Child ID number.
Return value
Child node.string getNodeID(int num)
Returns the string with the node identifier.Arguments
- int num - Node ID number.
Return value
Node identifier.int getNodeJoint(int num)
Returns the node joint.Arguments
- int num - Node ID number.
Return value
Node joint.int getNodeLight(int num)
Returns the node light type.Arguments
- int num - Node ID number.
Return value
Node light type.int getNodeMaterial(int num, string name)
Returns the node material.Arguments
- int num - Node ID number.
- string name - Material name.
Return value
Node material.int getNodeMesh(int num)
Returns the node mesh.Arguments
- int num - Node ID number.
Return value
Node mesh.int getNodeMorph(int num)
Returns the node morph controller number.Arguments
- int num - Node ID number.
Return value
Node morph controller number if it is found; otherwise, 0.string getNodeName(int num)
Returns the string with the name of the node.Arguments
- int num - Node ID number.
Return value
Node name.int getNodeParent(int num)
Returns the parent of the specified node.Arguments
- int num - Node ID number.
Return value
Parent node.int getNodeSkin(int num)
Returns the node skin controller number.Arguments
- int num - Node ID number.
Return value
Node skin controller number if it is found; otherwise, -1.mat4 getNodeTransform(int num, float scale)
Returns a transformation matrix of the specified node.Arguments
- int num - Node ID number.
- float scale - Transformation scale.
Return value
Transformation matrix.int getNumCameras()
Returns the number of cameras.Return value
Number of cameras.int getNumLights()
Returns the number of lights.Return value
Number of lights.int getNumMaterialParameters(int num)
Returns the number of material parameters.Arguments
- int num - Material ID number.
Return value
Number of parameters.int getNumMaterials()
Returns the number of materials.Return value
Number of materials.int getNumMeshes()
Returns the number of meshes.Return value
Number of meshes.int getNumMeshSurfaces(int num)
Returns the number of mesh surfaces.Arguments
- int num - The mesh number.
Return value
Number of mesh surfaces.int getNumNodeChildren(int num)
Returns the number of node children.Arguments
- int num - Node ID number.
Return value
Number of node children.int getNumNodeChilds(int num)
Returns the number of node children.The function lang="cpp" is deprecated. It is provided to keep your code working until the next release. Please, replace it with getNumNodeChildren().
Arguments
- int num - Node ID number.
Return value
Number of node children.int getNumNodes()
Returns the number of nodes.Return value
Number of nodes.void setTime(float time)
Sets an animation time.Arguments
- float time - Animation time.
string getTool()
Returns the string with the authoring tool name.Return value
Authoring tool name.int getUpAxis()
Returns the axis, that placed upwards.Return value
Up axis.void clear()
Clears all the data associated with the class.ColladaImport()
Constructor. Creates an empty instance.int load(string name)
Loads the DAE file.Arguments
- string name - DAE file name.
Return value
1 if the file is successfully loaded, otherwise - 0.int loadAnimation(string name)
Loads the DAE animation.Arguments
- string name - Animation name.
Return value
1 if the animation is successfully loaded, otherwise - 0.Last update: 2017-12-21
Help improve this article
Was this article helpful?
(or select a word/phrase and press Ctrl+Enter)