Using the Kraft physics engine I get an exception/error that a MeshCollider can only be used with a static rigid body.
Think of a simplified washing machine or cement mixer. The inside profile is defined as a mesh, it rotates about an axis. Objects inside need to interact with that mesh (and with themselves). Well, that was what I was trying to do - am I missing something?
If indeed I can't use a mesh as a dynamic rigid body, do I have to replace each surface inside the drum with a PlaneCollider? That isn't impossible as the inside of the drum is regular and was originally formed by extrusion of a cross-section.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Thanks for the reply, thought as much. Having to keep checking large meshes for (potentially multiple) contacts would be very expensive.
I read in another post, or it may have been your roadmap, that you hope to improve the integration of Kraft into CGE. I too would find the exposure of an OnContact event to be useful, but most of all would be a global 'start physics/stop physics' routine (maybe there is one already, haven't found it). One command to iterate all RigidBodies and set Dynamic to true/false - also preserving the individual settings in case one had switched off some of them already.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I can easily implement SceneManager.EnablePhysics that could be temporarily switched to false to disable updating things based on physics. I'll try to do it later today:)
Note: it will not touch Dynamic or any other exposed properties. It will just internally pause any physics processing.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Using the Kraft physics engine I get an exception/error that a MeshCollider can only be used with a static rigid body.
Think of a simplified washing machine or cement mixer. The inside profile is defined as a mesh, it rotates about an axis. Objects inside need to interact with that mesh (and with themselves). Well, that was what I was trying to do - am I missing something?
If indeed I can't use a mesh as a dynamic rigid body, do I have to replace each surface inside the drum with a PlaneCollider? That isn't impossible as the inside of the drum is regular and was originally formed by extrusion of a cross-section.
Indeed, for dynamic shapes, you have to use simpler colliders.
I'm guessing that this limitation of MeshCollider in Kraft is for performance. It's not something we can avoid from the CGE side, as far as I know.
Thanks for the reply, thought as much. Having to keep checking large meshes for (potentially multiple) contacts would be very expensive.
I read in another post, or it may have been your roadmap, that you hope to improve the integration of Kraft into CGE. I too would find the exposure of an OnContact event to be useful, but most of all would be a global 'start physics/stop physics' routine (maybe there is one already, haven't found it). One command to iterate all RigidBodies and set Dynamic to true/false - also preserving the individual settings in case one had switched off some of them already.
I can easily implement
SceneManager.EnablePhysicsthat could be temporarily switched tofalseto disable updating things based on physics. I'll try to do it later today:)Note: it will not touch Dynamic or any other exposed properties. It will just internally pause any physics processing.
I did it -- you can now instantly disable/enable physics by "
SceneManager.Items.EnablePhysics := false/true. Done on GitHub, in https://github.com/castle-engine/castle-engine/commit/5eca63a39ed43c113d7c53bb4aafee6c52591814 .