Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / How to turn meshes into Kinematic body? [Dark Dynamix]

Author
Message
hakimfullmetal
2
Years of Service
User Offline
Joined: 17th Feb 2015
Location:
Posted: 30th Jan 2017 14:56
Hello.
I've been trying to turn meshes into kinematic body.
But the problem is, the resulting kinematic body just won't rotate or move when I use DYN KINEMATIC MOVE POS/ROT commands.
I was using the demo 'Meshes' in Dark Dynamix examples folder. Turned the object into kinematic body, and tried to move them around, but it just wont move as kinematic body.
Is this a bug? Can you guys show an example on how to do this correctly using the "Meshes' example project?
Thanks in advance
Chris Tate
8
Years of Service
User Offline
Joined: 29th Aug 2008
Location: London, England
Posted: 4th Feb 2017 14:57
Triangle Meshes are static objects. They are designed for complex rapid collision detection purposes for stuff like buildings, terrains and caves. The polygons are stored in RAM for the PhysX engine to detect the collision quickly, without any dynamic transformation.

The first solution should be to deal with the separate parts of the mesh, then combine into a compound shape using DYN MAKE COMPOUND FROM SHAPES (int objectID, float density) . You should be able perform a dyn make shape command on all parts of the object to then produce the compound shape. But I have failed to get this to work because the feature is either broken in the PhysX API DBPro uses or the dynamix plugin has errors. Dyn Add Shapes command has a parameter missing error, and Dyn make shape commands seem to only produce 1 shape in the shape list.

The next best solution is to use Convex Meshes. If the mesh is not in convex form the engine will try its best to calculate a convex shape out of a concave mesh (according the the documentation).

You can also use the rigid joint example if the object is similar to a table or hull and the convex shape method will not suffice. (any other joint seems to be nightmare to work with but the ragdoll example is pretty helpful)
WickedX
8
Years of Service
User Offline
Joined: 8th Feb 2009
Location: A Mile High
Posted: 4th Feb 2017 19:53 Edited at: 4th Feb 2017 20:10
I haven't much experience with the dynamix plugin so, I may be wrong. By the looks of it, I believe Dyn Add Shapes is needed to add shapes list to an actor. The string table entry is missing for Dyn Add Shapes. I have added the string table entry for this function. You can download the updated dll from here.

https://forum.thegamecreators.com/thread/217169#msg2583623
Chris Tate
8
Years of Service
User Offline
Joined: 29th Aug 2008
Location: London, England
Posted: 8th Feb 2017 14:21
Quote: "I have added the string table entry for this function. You can download the updated dll from here."


Thanks, nice work WickedX, that was wicked!

I will try get your DLL to load once I get the time; however at my first attempt the compiler refuses to compile my project because it does not recognize the DLL.
Chris Tate
8
Years of Service
User Offline
Joined: 29th Aug 2008
Location: London, England
Posted: 8th Feb 2017 14:36
So now you can construct convex objects using shapes.

I have not played around with compound shapes just yet, but hopefully this will all solve most of your problems.

This also solves a lot of my problems as well, and so this is to be noted.
WickedX
8
Years of Service
User Offline
Joined: 8th Feb 2009
Location: A Mile High
Posted: 8th Feb 2017 16:42
You are welcome.

So, did you get the compiler to recognize the plugin. I do not know where the paid for version puts the dll. I put the dll from Matty H's website in the plugins-user folder. I haven't had the time to test Dyn Add Shapes. But, the dll is recognized by the compiler. Please, let me know how this is working. Thanks.
Chris Tate
8
Years of Service
User Offline
Joined: 29th Aug 2008
Location: London, England
Posted: 9th Feb 2017 21:52
The plugin-licenced folder is where I needed to put the DLL. I renamed the old DLL with a new extension, expecting it to be ignored, but the compiler tries to compile it anyway. So I had to remove the old DLL from the folder.

I did test the Dyn Add Shape command and it successfully compiled and performed as expected.

I will be testing the fixed commands in my game to see how it performs overall; this will happen in about a week or so after I finish the basic AI I have to get done.

If you have a website for your products or DLLs, please do provide a link so that I do not miss out on what you have on on offer.
WickedX
8
Years of Service
User Offline
Joined: 8th Feb 2009
Location: A Mile High
Posted: 10th Feb 2017 01:36 Edited at: 10th Feb 2017 01:38
Thank you, Chris. Good to know Dyn Add Shapes is now functioning as expected. All my content is right here on the forum. Just doesn't seem to be enough activity on the DBPro boards to justify the expense of running a Website.
Chris Tate
8
Years of Service
User Offline
Joined: 29th Aug 2008
Location: London, England
Posted: 10th Feb 2017 17:08
I have just come across your plugin page at https://forum.thegamecreators.com/thread/213811. I have been so focused on development that I did not notice you uploaded this utility plugin. What caught my attention was its D3D Line command, but I cannot use it because of a number of command names shared by other plugins I have referenced.
WickedX
8
Years of Service
User Offline
Joined: 8th Feb 2009
Location: A Mile High
Posted: 10th Feb 2017 19:12
Ok, you talked me in to it. I will get to work removing the conflicts with other plugins and continue working it as well.
Chris Tate
8
Years of Service
User Offline
Joined: 29th Aug 2008
Location: London, England
Posted: 11th Feb 2017 20:06 Edited at: 11th Feb 2017 20:06
May as well invest into it; you must of spent a lot of time working on it already, it would be a shame to let it go to waste.

It looks like we are to experience an interesting spring season for the DBP community, with new plugins and releases. Things will start to lighten up a bit quite soon.
hakimfullmetal
2
Years of Service
User Offline
Joined: 17th Feb 2015
Location:
Posted: 15th Feb 2017 08:15
Wow thanks a lot. So If I get this correctly, we need to construct convex meshes, and then add them as shapes to an existing actor?
Will try later. Had some headache with physic for now. For some strange reason clothes that I attached to normal kinematic objects keep on sticking to the object instead of sliding on it when they come in contact...
Chris Tate
8
Years of Service
User Offline
Joined: 29th Aug 2008
Location: London, England
Posted: 15th Feb 2017 15:38
Unfortunately you will experience a considerable number of entity glitches while using PhysX. When documented solutions are unavailable, you will sometimes have to use forces and additional collision shapes to prevent the glitches.

You will only need to use convex shapes to build compound shapes; that which combines a number of convex shapes to construct a complex rigid body; like a car or spacecraft.

You can simply use DYN MAKE CONVEX when you have a simple convex shape such as a hammer or rock.

Login to post a reply

Server time is: 2017-05-25 13:26:01
Your offset time is: 2017-05-25 13:26:01