I'm currently using HSPlasma in a C++ project, which needs to process PRPs fast (Python is not an option). You probably know what I'm talking about
So I compiled my own version of HSPlasma (finally!), dynamically linked to it in my other VS project, DLL loads correctly, etc (standard stuff so far). However, there is an annoying error I'm running in, and I can't nail down what's causing it.
It seems anytime HSPlasma exposes a class property of type std::vector<class or value type> (though a getter or a public property), accessing it is impossible. Instead I retrieve some other empty vector - even when it should be returned by reference... This is very annoying for methods like plSceneNode.getSceneObjects(), or plDIInterface.fIndices. I don't think I messed up the syntax either...
- Code: Select all
sceneNode->getSceneObjects().size(); // returns 0
As a workaround, I added two more methods directly inside HSPlasma's plSceneNode class:
- Code: Select all
plKey& plSceneNode::getSceneObject(int id) { return fSceneObjects[id]; }
size_t plSceneNode::getSceneObjectsSize() { return fSceneObjects.size(); }
Those methods CAN access the content of the std::vector, and allow me to retrieve the objects inside the scene node. However, having to add hack functions all over HSPlasma is obviously very annoying and not desirable.
Is there something I'm missing ?