Updating CollisionShape's

66 views
Skip to first unread message

Graham King

unread,
Jan 2, 2014, 10:45:22 AM1/2/14
to urh...@googlegroups.com
I have a CollisionShape constructed using SetTriangleMesh().  If the models mesh changes, I would like to update the CollisionShape mesh.  How could this be done?  Just calling SetTriangleMesh() again seems to have very strange effects...

- Gray

Lasse Öörni

unread,
Jan 2, 2014, 5:47:20 PM1/2/14
to urh...@googlegroups.com
This doesn't currently work as expected because the PhysicsWorld stores cached data for triangle meshes. I believe a function must be added to be able to invalidate the cached data.

Graham King

unread,
Jan 2, 2014, 8:13:59 PM1/2/14
to urh...@googlegroups.com
Ah, thanks for the warning.  

I fixed the problem I had by not caching vertex buffers which are marked as dynamic.  I sent a pull request just in case you want it.  If not, my patch will keep me going until your proper fix. ;)

- Gray

Lasse Öörni

unread,
Jan 3, 2014, 2:05:44 AM1/3/14
to urh...@googlegroups.com
Thanks, this is good to have as part of the solution as well. The rest is to handle model live reloads properly + allow manual invalidation of non-dynamic but still changing meshes.

Graham King

unread,
Jan 3, 2014, 7:31:49 AM1/3/14
to urh...@googlegroups.com
Awesome, thanks.
Reply all
Reply to author
Forward
0 new messages