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.

Dark Physics & Dark A.I. & Dark Dynamix / [Dark Dynamix] ccd not working with small objects

Author
Message
Inflictive
10
Years of Service
User Offline
Joined: 16th Jun 2009
Location: Altis
Posted: 29th May 2012 06:28 Edited at: 29th May 2012 07:35
So i've been trying to get a gun working, and actually simulating the bullets. I have it set up so that it makes the bullets and adds force, that seems to be working. But CCD doesen't work against static or dynamic objects.
Here is what I use to set up the bullets:

make object n,21,bulletmesh: offset limb n,0,0,0,-0.4 : scale object n,20,20,830
set object light n,0
ghost object on n
position object n,camera position x(),camera position y()-5,camera position z()
rotate object n,camera angle x(),camera angle y(),camera angle z()
dyn make convex mesh n,bulletconvexmesh,1000
dyn make ccd skeleton box n,0
dyn ccd set motion threshold n,0,0
dyn enable gravity n,0
dyn set linear damping n,0
dyn add local force n,0,0,200000

I have tried changing the scale multiplier and that didn't work. Any suggestions?

EDIT: It seems that CCD does not work at all. It only seemed to work because the objects that I was using were big enough that CCD wasn't needed. Please... fix...
I am using software mode by the way. Maybe CCD works in hardware mode but really it needs to work in both.

"This plan is so perfect... it's retarded."
Matty H
11
Years of Service
User Offline
Joined: 7th Oct 2008
Location: England
Posted: 29th May 2012 14:59
CCD does not require hardware so that's not the problem. I am about to look at CCD in the next day or two so I will do an example and if anything is broken then I'll fix.

It did work when I tried it last, I will post back with any findings.

Matty H
11
Years of Service
User Offline
Joined: 7th Oct 2008
Location: England
Posted: 29th May 2012 15:30
Try this:



You can add this to your PhysX constant file:



This flag needs to be set to enable CCD, let me know if it works, i will still try to do an example before the next update.

Inflictive
10
Years of Service
User Offline
Joined: 16th Jun 2009
Location: Altis
Posted: 30th May 2012 02:13
That did not work! I thought it would, since I didn't have the command in there before, but I'm quite sure the ccd still doesen't work. If you say it worked last time you tried it, can you make an example showing ccd for the next update and also put it here? thanks.

"This plan is so perfect... it's retarded."
Matty H
11
Years of Service
User Offline
Joined: 7th Oct 2008
Location: England
Posted: 30th May 2012 13:01
I have just done an example which will be included in the next update, here is the code, sorry it's in C++ as this is how I do all testing before I implement the DBPro version.



There are a few limitations I never knew about, I will update the docs.

Static objects must be a triangle mesh or a convex mesh for it to work.

For dynamic vs dynamic there is another flag that has to be set, you will be able to do this after the update.

So for the case of bullets, your static geometry has to be a mesh(triangle or convex), your bullets can be anything you like, boxes, spheres etc.

I found it is best to use the 'dyn set scale multiplier' to less than 1.0 before you make the skeletons.

Let me know if this solves your issue.

Inflictive
10
Years of Service
User Offline
Joined: 16th Jun 2009
Location: Altis
Posted: 31st May 2012 03:24 Edited at: 31st May 2012 03:35
I did some tests.

Part of the reason that the CCD never worked was that I was always using dynamic to dynamic objects. But you say that will not work until the next update. Okay then.

So I have been trying dynamic to static CCD. All static objects are triangle meshes. It works well when the dynamic objects are boxes or spheres... but not convex meshes! I need to be able to use convex meshes if possible so please look into it.

Also: The CCD was making objects bounce off at very weird angles until I set the scale multiplier to 0.5 before making the CCD skeleton... if that's what you were talking about.

"This plan is so perfect... it's retarded."
Matty H
11
Years of Service
User Offline
Joined: 7th Oct 2008
Location: England
Posted: 31st May 2012 17:27
Strange that convex meshes are not working, I will check it out.

The reason CCD can give strange results if the skeleton is the same size is because the skeleton gets tested for a collision first(using CCD method), if there is a collision the actual actor shape gets put at that point and collision is then performed on the actor shape as normal. It works best if the shape is actually a little inside the boundary of the collision for this second test so it can bounce off as normal, otherwise it seems to just get stopped dead in its tracks, this is why we make the skeleton smaller so that the first detection is slightly late.

Matty H
11
Years of Service
User Offline
Joined: 7th Oct 2008
Location: England
Posted: 10th Jun 2012 01:34
I can confirm that I never supported convex meshes, it has now been added along with capsule shapes too. I have also added the option to create the CCD skeleton as a single vertex which will be faster than the skeleton box.

Login to post a reply

Server time is: 2019-10-21 16:52:29
Your offset time is: 2019-10-21 16:52:29