I've googled but couldn't come up with a proper solution. I'd like to create an instance of an angelscript class from C++. My current approach:
asIObjectType* type = modBase->GetObjectTypeByName("Test");
asIScriptObject* obj = static_cast<asIScriptObject*>(engine->CreateScriptObject(type->GetTypeId()));
While this works I wondered, why CreateScriptObject returned a void pointer instead of a script object. Investigating as_scriptengine.cpp, I noticed, that the method was marked as deprecated and creation should be done via a factory. How does it work? The class is guaranteed to have a default constructor.
Also, what's wrong with the way it's currently done?