[Bleeding] 1.0'22T3 (Unstable) now with CCD. TESTERS NEEEDED

betajaen

07-10-2008 20:40:01

WHAT? Betajaen you crazy!!

This is literally hot of the presses. This NxOgre 1.0'22 of course; I've worked with this code for under 24 hours, so I declare it unstable.

However; not to confuse the newbies I won't be placing it on the SVN straight away, until I am satisfied that it actually works with the masses - due to the changes of the core parts.

If you have been using NxOgre for less than two weeks, and even attempt to download this file - I WILL LAUGH AT YOU.

Release Notes

1.0 '22T3

+ Added support for loading/saving CCD skeleton meshes(xsk) in Mesh
~ Added skeleton creation code in ManualMesh
~ Rewrote the ShapeParams class in the style of ActorParams
+ Added support for CCD skeletons in Shape.

<Betajaen: 07-October-2008>



Download

http://get.nxogre.org/releases/NxOgre.1.0.22T3.zip (395kb)

All problems, compile errors and thumbs up in this thread only.
If I see any posts outside this thread - I WILL DELETE THEM.

betajaen

07-10-2008 21:25:25

Betajaen's incredibly short guide to CCD

First you need to compile a CCD skeleton (xsk), go visit the Flour 0.3 thread and find out how to generate one.

Next we need to tell PhysX we want to use CCD.

mWorld->getPhysXDriver()->setCCD(true);
mWorld->getPhysXDriver()->setCCDEpsilon(0.01f);


Now load in our CCD skeleton.

NxOgre::Resources::ResourceSystem::getSingleton()->addMeshAs("file://skeleton.xsk", "mySkeleton");

Now, let's create a Body with a Cube that has CCD (remember it's the shape that does CCD, not the Actor).

mScene->createBody<Body>("cube.1m.mesh", new Cube(1.0f, "skeleton: mySkeleton, shape-flags: +ccd"), Vector3(-10, 15, -10), "mass: 10");

Now go take that puppy for a spin!

spacegaier

07-10-2008 21:26:40

Hi betajaen, I'll test it the next days as soons as I can find some spare time.

But just a small remark right now: The download link is confusing:

"http://get.nxogre.org/releases/NxOgre.1.0.22T2.zip (395kb)"

It says T2 there instead of T3 (although it links to the rigt zip archiv).

betajaen

07-10-2008 21:30:04

Fixed. Although, I am planning a few releases this week so you may have to test a few more things as well. ;)

The current plan is to have CCD finished, Flour 0.3 done, and the Sweep API ported by Thursday. Oh and depending on my mood some improvements to the terrain system.

almondega

08-10-2008 02:19:00

i need to fix somethings before i can test CCD =\
i'm changing the code to '22T3 now (i had '21)
and having problem here:

ActorParams actorParams;
actorParams.mBodyFlags += NX_BF_FROZEN_ROT;


because the compiler says:

error LNK2001: unresolved external symbol "public: void __thiscall NxOgre::ActorParams::BodyFlags::operator+=(enum NxBodyFlag)"

is operator += implemented?

and a question
how to set actor group using actor params with string?
i'm trying this:
actorParams.mGroup = "MyGroup";
but only works:
actorParams.mGroup = 1; (or whathever int)

mcaden

08-10-2008 06:43:55


actorParams.mFreeze.mRotation.x = true;

replaced the NX_BF_FROZEN_ROT flag




actorParams.mGroup = "MyGroup";

I think the operator overloading didn't include char*
String might work...Or you can use the following till it gets fixed:

mActor->setGroup( mScene->getActorGroup( "MyGroup" ) );

betajaen

08-10-2008 09:19:25

I changed the DualIdentifier mGroup to an NxEither, so it should work a little better. But since the operator= expects either a integer or a string, it won't work with const char*'s, so you'll have to make it a Ogre::String, NxString or std::string.

I must of missed the operator+= flags, but I'll get at them sometime later.

spacegaier

13-10-2008 07:59:58

Has anyone yet got the CCD running? I tried it, but my cubes are stilll flying through my wall, although CCD is enabled (I tried it with precomputing a CCD skeleton via Flour as well as without so that PhysX generates one for my on te fly).

The remote debugger also states that my cubes have a CCD motion threshold of zero. Is that right? I've also tried different epsilons, but without success. I can't post my code atm as I'm at university right now.

Nevertheless some ideas already where could be the problem?

spacegaier

13-10-2008 16:19:04

Any ideas what I could do? I did the same as you posted above betajaen. But my cubes are still flying though my wall.

betajaen

13-10-2008 16:40:25

How fast are they going?

I had a little trouble deteriming if it was working or not either. I had to compare the simulation state between NxOgre and the CCD sample, since the shape flags are exactly the same, I concluded it works.

But I will have a look again later this week, there is another CCD sample I can replicate in Cake.

Prophet

13-10-2008 18:31:13

Perhaps cooking a 0.25m cube and set the speed to ludicrous speed and try sending it through a thin wall? If it passes, you fail, and vice versa.

betajaen

13-10-2008 19:40:55

I'm guessing, you'd have to have a good running start before you start seeing plaid; otherwise the skeleton isn't stretched out enough.

The CCD explosion sample is the best example of CCD I've seen, I'm going to try replicate that in NxOgre.

spacegaier

13-10-2008 20:42:18

How fast are they going?

After creating them I do the following:

actor->addForce(Vector3(0,0,-100000), NX_IMPULSE);

spacegaier

18-10-2008 19:02:55

Out of curiosity: Something new? Did you try to get it working?