You didn't say how you register the mesh type. I assume you do the following:
engine->RegisterObjectType("Mesh", sizeof(Mesh), asOBJ_IS_COMPLEX);
asOBJ_IS_COMPLEX is a new flag for WIP5. It should be used to tell AngelScript that the object in C++ is using either constructor, destructor, or assignment operator. This is important when registering functions that return objects of this type since C++ often treat these objects differently than normal values. The opposite is asOBJ_IS_NOT_COMPLEX.
Since your object needs a constructor you ought to register one with AngelScript as well.
engine->RegisterTypeBehaviour("Mesh", asBEHAVE_CONSTRUCT, "void f()", asFUNCTION(ConstructMesh), asCALL_CDECL_OBJLAST);void ConstructMesh(Mesh *empty){ // Call the constructor to initialize the memory new(empty) Mesh();}void *Mesh::operator new( unsigned int, void *mem ) { return mem; }
Note, that if your C++ class doesn't need to call the constructor you don't have to register this behaviour.
The destructor would be registered in a similar way, however the function could call the destructor directly with ~Mesh().
Once you have the mesh object registered you can register functions that use that type.
AngelScript doesn't have an operator for taking the address of a variable, but I don't think you have to. If you want your function to receive a pointer to the object, you can register the function to take a reference, but have the C++ function receive the reference as a pointer.
engine->RegisterGlobalFunction("void AddMeshX(const bstr &, const Mesh &)", asFUNCTION(AddMeshX), asCALL_CDECL);void AddMeshX(const char **layer, const Mesh *mesh);
I'm not sure I understood what your question really was. Tell me if what I said help you.