AddObject()‌‌ 【Syntax】 Sample Clauses

AddObject()‌‌ 【Syntax】. SCint AddObject (SCint id, SCObject*object); 【Description】Adds SCObject in the scene. The information of the shape, position and orientation is obtained from SCObject. By default, the objects are automatically added to the static group. It is not possible to add a group in multiple scenes simultaneously.【Arguments】 〈INPUT〉 idThe ID to set to the object. The value of ID is chosen by the user and must be a positive integer.objectThe address of SCObject to add.〈OUTPUT〉 【Return】SC_NO_ERROR: There has been no error.SC_ERROR_DUPLICATE_ID: The id specified has already been registered. SC_ERROR_DUPLICATE_ENTRY: object specified has already been added in the scene.SC_ERROR_INVALID_TYPE_COMBINATION: The type of SCObject does not match the type of SCSceneManager.SC_ERROR_NO_GEOMETRY: The object has no geometry. SC_ERROR_INVALID_LICENSE: The license is invalid.SC_ERROR_BAD_ALLOCATION: Bad allocation has happened during the execution. SC_ERROR_RUNTIME: Runtime error has happened during the execution. 【ExamplesList 2-5: How to add objects to the scene. SCSceneManager scene(SC_SCENE_MANAGER_CLOSED_POLYHEDRA); SCObject object1(SC_OBJECT_TYPE_CLOSED_POLYHEDRA); SCObject object2(SC_OBJECT_TYPE_CLOSED_POLYHEDRA); SCObject object3(SC_OBJECT_TYPE_CLOSED_POLYHEDRA); SCObject object4(SC_OBJECT_TYPE_CLOSED_POLYHEDRA); SCObject object5(SC_OBJECT_TYPE_CLOSED_POLYHEDRA); SCObject object6(SC_OBJECT_TYPE_CLOSED_POLYHEDRA);// Add triangles for each SCObject … scene.AddObject(0,&object1); scene.AddObject(1,&object2); scene.AddObject(2,&object3); scene.AddObject(3,&object4); scene.AddObject(4,&object5); scene.AddObject(5,&object6);