This page has been translated automatically.
Getting Started
Migrating to UNIGINE 2.0
C++ API Migration
UnigineScript
The Language
Core Library
Engine Library
Node-Related Classes
GUI-Related Classes
Plugins Library
High-Level Systems
Samples
Usage Examples
C++ API
API Reference
Integration Samples
Usage Examples
C++ Plugins
Warning! This version of documentation is OUTDATED, as it describes an older SDK version! Please switch to the documentation for the latest SDK version.
Warning! This version of documentation describes an old SDK version which is no longer supported! Please upgrade to the latest SDK version.

Objects-Related Classes

The following class has been removed:

  • ObjectBillboard

New classes in this section:

Object Class

UNIGINEUNIGINE 2
vec3 getBoundMax (int surface)
vec3 getBoundMin (int surface)
BoundBox getBoundBox (int surface)
See remarks below.
vec3 getBoundCenter (int surface)
float getBoundRadius (int surface)
BoundSphere getBoundSphere (int surface)
See remarks below.
int getIntersection(vec3 p0, vec3 p1, int surface)-
int getIntersection (vec3 p0, vec3 p1, int surface, int ret[])int getIntersection (vec3 p0, vec3 p1, variable v, int surface)
See remarks below.
int getMaxShadowSplit(int surface)The max shadow split parameter has been removed from Object surfaces.
void setMaxShadowSplit(int split, int surface)The max shadow split parameter has been removed from Object surfaces.
vec3 getWorldBoundMax(int surface)
vec3 getWorldBoundMin(int surface)
BoundBox getWorldBoundBox(int surface)
See remarks below.
vec3 getWorldBoundCenter(int surface)
float getWorldBoundRadius(int surface)
BoundSphere getWorldBoundSphere(int surface)
See remarks below.
void setReceiveShadow(int mode, int surface)Removed
int getReceiveShadow(int surface)Removed
void setReceiveWorldShadow(int mode, int surface)Removed
int getReceiveWorldShadow(int surface)Removed
void setDecal(int mode, int surface)Removed
int getDecal(int surface)Removed
void setDecalMask(int mask, int surface)Removed
int getDecalMask(int surface)Removed
int getNumObjectDecals(int surface)Removed
void removeObjectDecals(int surface)Removed

Remarks:

  1. The BoundBox class has been added to the UnigineScript library, so now you can get an instance of this class instead of bounding box minimum and maximum.
  2. The BoundSphere class has been added to the UnigineScript library, so now you can get an instance of this class instead of bounding sphere center and radius.
  3. The result of the intersection is saved into the node instead of the return array. Depending on the variable passed as the third argument, the result can be presented as the ObjectIntersection, ObjectIntersectionNormal or ObjectIntersectionTexCoord node.
  4. The BoundBox class has been added to the UnigineScript library, so now you can get a world bounding box as an instance of this class instead of getting world bounding box minimum and maximum.
  5. The BoundSphere class has been added to the UnigineScript library, so now you can get a world bounding sphere as an instance of this class instead of getting world bounding sphere center and radius.

New Functions and Variables

The following new flags that are used to create a dynamic object or a dynamic mesh. We placed them in the Object class, because they are used in both the ObjectMeshDynamic and ObjectDynamic classes.

ObjectGrass Class

UNIGINEUNIGINE 2
void setSpawnRate(int spawn)Removed
int getSpawnRate()Removed

ObjectGuiMesh Class

See also the chapter on Changes in Mesh-Related Classes.

UNIGINEUNIGINE 2
ObjectGuiMesh(string mesh, string name) ObjectGuiMesh(variable v, string name = 0, int dynamic = 0)
See remarks below.

Remarks:

  1. Now the constructor receives the instance of the Mesh class or the path to the *.mesh file.

New Functions

ObjectMeshCluster Class

ObjectMeshClutter Class

ObjectMesh Class

See also the chapter on Changes in Mesh-Related Classes.

The ObjectMesh class has been renamed into the ObjectMeshStatic.

UNIGINEUNIGINE 2
ObjectMesh (string name, int dynamic = 0)ObjectMeshStatic (variable v, int dynamic = 0)
See remarks below.
void addMeshSurface (variable variable, ObjectMesh mesh, int surface)int addMeshSurface (variable v0, variable v1, int surface, int target)
See remarks below.
int getIndex (int num, int surface) int getCIndex (int num, int surface)
int getTIndex (int num, int surface)
See remarks below.
vec3 getNormal (int num, int surface)vec3 getNormal(int num, int surface, int target = 0)
See remarks below.
int getNumIndices (int surface) int getNumCIndices (int surface)
int getNumTIndices (int surface)
See remarks below.
vec4 getTangent(int num, int surface)quat getTangent(int num, int surface, int target = 0)
See remarks below.
vec4 getTexCoord (int num, int surface) vec2 getTexCoord0 (int num, int surface)
vec2 getTexCoord1 (int num, int surface)
void setIndex (int num, int index, int surface) void setCIndex (int num, int index, int surface)
void setTIndex (int num, int index, int surface)
See remarks below.
void setNormal (int num, vec3 normal, int surface) void setTangent (int num, vec4 tangent, int surface, int target)
void setTangent(int num, vec4 tangent, int surface)void setTangent(int num, quat tangent, int surface, int target = 0)
See remarks below.
void setTangent(int num, vec4 tangent, int surface)void setTangent(int num, quat tangent, int surface, int target = 0)
See remarks below.

Remarks:

  1. Now the constructor receives the instance of the Mesh class or the path to the *.mesh file.
  2. You can pass an instance of the Mesh class as a 2nd argument. Also you should pass the number of the surface morph target as the mesh surface now can have a variable number of morph targets.
  3. The number of arguments has been increased. Also you can use the related vec4 getTangent (int num, int surface, int target) function. The tangent basis is stored in the quaternion.
  4. Now each vertex has indices of 2 types: coordinate and triangle indices.
  5. Now the tangent basis is stored as a quaternion.

New Functions

ObjectMeshSkinned Class

The updated ObjectMeshSkinned class provides the following features:

  • Up to 7 active morph targets per surface with arbitrary weights available for any kind of animations. The overall number of morph targets is not limited.
  • Animation layers with all of the animation buffers functionality.
    Notice
    Animation buffers have been removed.
  • Unified vertex format with the ObjectMeshStatic class.

See also the chapter on Changes in Mesh-Related Classes.

UNIGINEUNIGINE 2
ObjectMeshSkinned(string name, int dynamic = 0)ObjectMeshSkinned(variable v,int dynamic = 0)
See remarks below.
int addBone(string name, int parent)int addBone(string name = 0, int parent = -1)
int addBuffer()int addLayer()
void addFrame(int frame)Removed
int addMeshFrame(ObjectMeshSkinned mesh, int frame)Removed
void addMeshSurface(variable variable, ObjectMeshSkinned mesh, int surface)int addMeshSurface(variable v, Mesh mesh, int surface, int target = -1
void clearBuffer(int num)void clearLayer(int layer)
void clearFrame ()Removed
void copyBuffer(int dst, int src)void copyLayer(int layer, int layer_0)
int getAnimationID()int getAnimationID(int num)
string getAnimation()int getAnimation(int layer)
ivec4 getBones(int num, int surface)Removed
mat4 getBufferBoneTransform(int buffer, int bone)mat4 getLayerBoneTransform(int layer, int bone)
void getBuffer(int buffer, int layer)Removed
getCoordinateIndex(int num, int surface)int getCIndex(int num, int surface)
vec3 getCoordinateVertex(int num, int surface)Removed
mat4 getFrameBoneTransform(int bone)Removed
int getFrameFrom()int getFrameFrom (int layer)
float getFrameTime ()float getFrame(int layer)
int getFrameTo()int getFrameTo(int layer)
void getFrame()Removed
int getIndex int num, int surface) int getCIndex(int num, int surface)
int getTIndex (int num, int surface)
See remarks below.
int getLayer()Removed
vec3 getNormal(int num, int surface)vec3 getNormal(int num, int surface, int target = 0)
See remarks below.
int getNumAnimations()int getNumAnimations() function of the Mesh class.
int getNumBuffers()int getNumLayers()
getNumCoordinateVertex()int getNumCVertex(int surface)
getNumFrames()getNumFrames(int layer)
int getNumIndices() int getNumCIndices(int surface)
int getNumTIndices(int surface)
See remarks below.
int getNumWeights()getNumWeights(int surface) function of the Mesh class.
int getOffsetTransform()Removed
vec4 getTangent()quat getTangent(int num , int surface, int target = 0)
vec4 getTexCoord() vec2 getTexCoord0 (int num, int surface)
vec2 getTexCoord1 (int num, int surface)
vec3 getVertex (int num, int surface)vec3 getVertex(int num, int surface, int target)
float getWeight()float getLayerWeight(int layer)
vec4 getWeights(int num, int surface)Removed
void inverseBuffer(int dst, int src)See void inverseLayer(int layer, int layer_0)
int isBufferBoneTransform(int buffer, int bone)int isLayerBoneTransform(int layer, int bone)
int isFrameBoneTransform(int bone)int isLayerBoneTransform(int layer, int bone)
void lerpBuffer(int dst, int src0, int src1, float weight)void lerpLayer(int layer, int layer_0, int layer_1, float weight)
void mulBuffer (int dst, int src0, int src1, float weight)void mulLayer(int layer, int layer_0, int layer_1, float weight = 1.0f)
void removeBuffer (int num)removeLayer(int num)
int save (string name)int saveMesh(string name)
int setAnimation(string filename)int addAnimation(variable v, string animation = 0)
void setAnimationID(int id)void setAnimation(int layer, variable v)
void setBones(int num, ivec4 bones, int surface)Removed
void setBufferBoneTransformEnabled(int buffer, int bone, int enable)void setLayerBoneTransformEnabled(int layer, int bone, int enable)
void setBufferBoneTransform(int buffer, int bone, mat4 transform)void setLayerBoneTransform(int layer, int bone, mat4 transform)
void setBuffer(int buffer, int layer)void setLayer(int layer, int enable, float weight)
void setFrameBoneTransformEnabled(int bone, int enabled)Removed
void setFrameBoneTransform(int bone, mat4 transform)Removed
float setFrame(float time, int from, int to)float setFrame(int layer, float time, int from = -1, int to = -1)
void setIndex(int num, int index, int surface) void setCIndex(int num, int index, int surface)
void setTIndex(int num, int index, int surface)
See remarks below.
void setLayer(int layer)void setLayer(int layer, int enable, float weight)
void setNormal(int num, vec3 normal, int surface)void setTangent(int num, quat tangent, int surface, int target = 0)
void setNumBuffers(int num)void setNumLayers(int layers)
void setNumWeights(int num, int num_weights, int surface)Removed
void setSurfaceTransform(mat4 transform, int surface)void setSurfaceTransform(mat4 transform, int surface, int target = -1)
void setTangent(int num, vec4 tangent, int surface)void setTangent(int num = , quat tangent = , int surface = , int target = 0)
void setTexCoord(int num, vec4 texcoord, int surface) void setTexCoord0(int num, vec2 texcoord, int surface)
void setTexCoord1(int num, vec2 texcoord, int surface)
void setVertex(int num, vec3 xyz, int surface)void setVertex(int num, vec3 vertex, int surface, int target)
void setWeight(float weight)void setLayerWeight(int layer, float weight)
void setWeights(int num, vec4 weights, int surface)Removed
void updateSurfaces()void updateSurfaceBounds(int surface)

Remarks:

  1. An ObjectMeshSkinned constructor. You can specify either a mesh instance or a path to it.
  2. Now each vertex has indices of 2 types: coordinate and triangle indices.
  3. Expanded with morph targets. Also you can use quat getTangent(int num, int surface, int target = 0).

New Functions

ObjectMeshDynamic Class

See also the chapter on Changes in Mesh-Related Classes.

UNIGINEUNIGINE 2
OBJECT_DYNAMIC_TYPE_FLOATRemoved
OBJECT_DYNAMIC_TYPE_HALFRemoved
OBJECT_DYNAMIC_TYPE_UCHARRemoved
ObjectMeshDynamic(variable arg)ObjectMeshDynamic(variable v = 0, int flags = 0)
See remarks below.
void addLineStrip(int num_vertex)Removed
void addMeshSurface(ObjectMeshDynamic mesh, int surface)Removed. See remarks below.
void addNormal(vec3 normal)void addTangent(quat tangent)
void addPoints(int num_points)Removed
void addQuads(int quads)void addTriangleQuads(int num_quads)
void addTangent(vec4 tangent)void addTangent(quat tangent)
void flush() void flushIndices()
void flushVertex()
vec4 getTangent(int vertex)quat getTangent(int num)
int load(string name)int loadMesh(string name)
int save(string name)int saveMesh(string name)
void setBoundBox(vec3 min, vec3 max, int surface)void setBoundBox(BoundBox bb, int surface)
See remarks below.
void setBoundBox(vec3 min, vec3 max)void setBoundBox(BoundBox bb)
See remarks below.
void setNormal(int vertex, vec3 normal)void setTangent (int num, quat tangent)
void setTangent(int vertex, vec4 tangent)void setTangent(int num, quat tangent)
void updateNormals(float angle)
void updateNormals()
Removed. See remarks below.

Remarks:

  1. Added the second argument that receives one of the dynamic flags.
  2. You can add a surface to a mesh by using functions of the Mesh class.
    1. Get a mesh (instance of the Mesh class) from the destination dynamic mesh to which the surface should be added. Use the int getMesh(Mesh mesh).
    2. Get a mesh (instance of the Mesh class) from the source dynamic mesh, from which the surface should be copied. Use the int getMesh(Mesh mesh).
    3. Add the mesh surface using the int addMeshSurface(variable v, Mesh mesh, int surface, int target = -1) function.
    4. Set the changed mesh with the added surface to the dynamic mesh via int setMesh(Mesh mesh).
  3. The BoundBox class has been added to the UnigineScript library, so now you can get or set an instance of this class instead of bounding box minimum and maximum.
  4. Now you should place only the int updateBounds() and int updateTangents() to calculate bounds and tangents if a vertex is added or updated.

New Functions

ObjectDynamic Class

ObjectTerrain Class

Methods related to materials has been switch to terrain layers.

UNIGINEUNIGINE 2
OBJECT_TERRAIN_MATERIAL_NONERemoved
OBJECT_TERRAIN_MATERIAL_OVERLAPRemoved
OBJECT_TERRAIN_MATERIAL_OVERLAYRemoved
int addSurfaceMaterial(int x, int y, int num)Removed
void clearMaterials()Removed
void clearSurfaceMaterials(int x, int y)Removed
int create(Image image, float step, float height) int create(variable a0, variable a1, variable a2)
int create(Image image, float step)
int create(int size_x, int size_y, float step, float height)int create(variable a0, variable a1, variable a2)
int getFlatnessThreshold()Removed
float getHeight()Removed
int getHeights(int x, int y, int width, int height, Image image)int getHeights(int x, int y, int width, int height, Image image, int format, float scale = 1.0f)
int getIntersection(vec3 point_0, vec3 point_1, int surface, int holes, int ret_id) int getIntersection(vec3 p0, vec3 p1, variable v, int surface, int holes)
int getMaterialDetail(int num)Removed
float getMaterialOverlapThreshold(int num)float getMaterialMaskThreshold(int num)
float getMaterialOverlapValue(int num)float getMaterialMaskValue(int num)
int getNumSurfaceMaterials(int x, int y)Removed
vec3 getSurfaceBoundMax(int x, int y)
vec3 getSurfaceBoundMin(int x, int y)
BoundBox getSurfaceBoundBox(int x, int y)
See remarks below.
vec3 getSurfaceBoundCenter(int x, int y)
float getSurfaceBoundRadius(int x, int y)
BoundSphere getSurfaceBoundSphere(int x, int y)
See remarks below.
int getSurfaceFlatnessThreshold(int x, int y)float getSurfaceLodThreshold(int x, int y)
int getSurfaceMaterial(int x, int y, int num)Removed
int isSurfaceTriplanar(int x, int y)Removed
int load(string name)int loadTerrain(string name)
void removeSurfaceMaterial(int x, int y, int num)Removed
int save(string name, int force)int saveTerrain(string name, int force = 0)
void setFlatnessThreshold(int threshold) Removed
int setHeights(int x, int y, Image image)int setHeights(int x, int y, Image image, float scale = 1.0f)
void setMaterialDetail(int num, int detail)Removed
void setMaterialOverlapThreshold(int num, float threshold)void setMaterialMaskThreshold(int num, float threshold)
void setMaterialOverlapValue(int num, float value)void setMaterialMaskValue(int num, float value)
void setSurfaceFlatnessThreshold(int x, int y, int threshold)void setSurfaceLodThreshold (int x, int y, float threshold, int force = 0)
void setSurfaceTriplanar(int x, int y, int triplanar)Removed

Remarks:

  1. The BoundBox class has been added to the UnigineScript library, so now you can get or set an instance of this class instead of bounding box minimum and maximum.
  2. The BoundSphere class has been added to the UnigineScript library, so now you can get or set an instance of this class instead of the bounding sphere center and radius.

New Functions

ObjectParticles Class

ObjectWaterMesh Class

UNIGINEUNIGINE 2
int getMesh(ObjectMesh mesh)int getMesh(Mesh mesh)
int load(string name)int loadMesh(string name)
int save(string name)int saveMesh(string name)
int setMesh(ObjectMesh mesh)int setMesh(Mesh mesh)

New Functions

Last update: 2017-07-03
Build: ()