luis
01-06-2008 16:55:21
The bug is in 1.0-18 but i beleive it is in the lastest version also.
If you create bodies, then delete just some of them and create more bodies again the link between the visual representation (source renderable) and the physics is lost in the new bodies and in the old ones.
So you see you objects floating in the scene or you dont see them at all (but there are ! in the VRD you can see them).
The bug is here:
My solution was:
mLastRenderableSourceID type is NxRenderableSourceID and it is intialized in SceneRenderer's ctor to zero
If you create bodies, then delete just some of them and create more bodies again the link between the visual representation (source renderable) and the physics is lost in the new bodies and in the old ones.
So you see you objects floating in the scene or you dont see them at all (but there are ! in the VRD you can see them).
The bug is here:
void SceneRenderer::registerSource(NxOgre::RenderableSource *source) {
NxRenderableSourceID id = mSources.count() + 1; // <---- THIS LINE
NxRenderableSourceID id = ++mLastRenderableSourceID;
source->mRenderableSourceID = id;
mSources.insert(id, source);
}
My solution was:
void SceneRenderer::registerSource(NxOgre::RenderableSource *source) {
NxRenderableSourceID id = ++mLastRenderableSourceID;
source->mRenderableSourceID = id;
mSources.insert(id, source);
}
mLastRenderableSourceID type is NxRenderableSourceID and it is intialized in SceneRenderer's ctor to zero