Dynamically allocating third-party class

Not exactly. The constructor is called but the initialization is not right. Because some parts of mjCGeom is correctly constructed but some other not.