SaveModel
Syntax
// // Strong typing definition // int64_t SaveModel( OwlModel model, const char * fileName ); static inline int64_t SaveModel( OwlModel model, char * fileName ) { return SaveModel( model, (const char*) fileName ); } // // Weak typing definition // int64_t __declspec(dllexport) __stdcall SaveModel( int64_t model, const char * fileName ); static inline int64_t SaveModel( int64_t model, char * fileName ) { return SaveModel( model, (const char*) fileName ); }
Property model
Size: 64 bit / 8 byte (value)Property fileName
Size: 64 bit / 8 byte (reference)
Example (based on pure API calls)
Here you can find code snippits that show how the API call SaveModel can be used.
#include "./include/engine.h" #include <assert.h> void CreateContent() { int64_t model = CreateModel(); if (model) { // // Classes // int64_t classCone = GetClassByName(model, "Cone"); // // Datatype Properties (attributes) // int64_t propertyHeight = GetPropertyByName(model, "height"), propertyRadius = GetPropertyByName(model, "radius"), propertySegmentationParts = GetPropertyByName(model, "segmentationParts"); // // Instances // int64_t myInstanceCone = CreateInstance(classCone, nullptr); double height = 2.8, radius = 1.3; int64_t segmentationParts = 36; SetDatatypeProperty(myInstanceCone, propertyHeight, &height, 1); SetDatatypeProperty(myInstanceCone, propertyRadius, &radius, 1); SetDatatypeProperty(myInstanceCone, propertySegmentationParts, &segmentationParts, 1); // // The resulting model can be viewed in 3D-Editor.exe // SaveModel(model, "c:\\created\\myFile.bin"); CloseModel(model); } }