one of NxOgre feature is that you can use novodex API di....

ahmadi

21-08-2006 12:58:50

one of NxOgre feature is that you can use novodex API directly in your project. betajaen said me before that NxOgre support that you use novodex API directly.
but i need a sample code, for example only a code to create a Box, dymanic Box, but directly with novodex API . 8)

i can not find simillar post before....

Pre Thanks for any help. :wink:

betajaen

21-08-2006 13:19:53

Erm, it is the PhysX code which oddly enough comes with the PhysX library and even more strangely has documentation and tutorials too:


mWorld = new World(mRoot);
mScene = mWorld->createScene("main",mSceneMgr);
NxActorDesc actorDesc;
NxBodyDesc bodyDesc;


NxBoxShapeDesc boxDesc;
boxDesc.dimensions.set(0.5,0.5,0.5);
actorDesc.shapes.pushBack(&boxDesc);

actorDesc.body = &bodyDesc;
actorDesc.density = 10;
actorDesc.globalPose.t = NxVec3(0,boxStartHeight,0);
mScene->Scene->createActor(actorDesc);


Why you would want to do this is beyond me though. :roll:

ahmadi

21-08-2006 14:04:09

Erm, it is the PhysX code which oddly enough comes with the PhysX library and even more strangely has documentation and tutorials too:


mWorld = new World(mRoot);
mScene = mWorld->createScene("main",mSceneMgr);
NxActorDesc actorDesc;
NxBodyDesc bodyDesc;


NxBoxShapeDesc boxDesc;
boxDesc.dimensions.set(0.5,0.5,0.5);
actorDesc.shapes.pushBack(&boxDesc);

actorDesc.body = &bodyDesc;
actorDesc.density = 10;
actorDesc.globalPose.t = NxVec3(0,boxStartHeight,0);
mScene->Scene->createActor(actorDesc);


Why you would want to do this is beyond me though. :roll:


in the last line of you code, you mention to mScene->Scene.
Scene of mScene is your class that have not any createActor(), i know what is createActor() and i know where is defined in novodex, but your class do not allow me to i use it! before any doing work for me, i want you to explain your class that is it allow me to i connect real scene?:
if i use this scene
static NxScene* gScene
yes, i can easily use createActor(), but.... your mScene->Scene is not "static NxScene*" ! :shock:



all of you source have not any error, except your last line, i have this error:

error C2273: 'function-style cast' : illegal as right side of '->' operator
error C2227: left of '->createActor' must point to class/struct/union/generic type

betajaen

21-08-2006 14:06:27

It's a typo, it's mScene->mScene->createActor(...)

ahmadi

21-08-2006 14:15:18

It's a typo, it's mScene->mScene->createActor(...)
ok, Thank you very much,it work great
the last thing that very harm me is that i can not find how novodex samples connect a "Mesh" to "Body".
"Mesh" : is what is rendering on scene (with opengl or directx or ...)
"Body" : is mean all of physic handle that all physic engine work with it.

now if a physic engine such as PhysX simulate a scene, maybe "Body" move , now how can i connect a "Mesh " to body.that "Mesh" always update from "Body"

in above message maybe i must use "Actor" instead "Body" , Excuse me if its wronge word.

Notice:
maybe i must use
void* NxActor::userData
? :roll:

betajaen

21-08-2006 14:30:44

Tell me do you actually understand what NxOgre actually does?

Do you understand the whole point of NxOgre is that it does this, what your trying to achieve right now for you.

If you do, why on earth are you wanting to do all of this?

ahmadi

21-08-2006 14:42:21

Tell me do you actually understand what NxOgre actually does?

Do you understand the whole point of NxOgre is that it does this, what your trying to achieve right now for you.

If you do, why on earth are you wanting to do all of this?


:wink: its good question.
i have 18 hours idle time in each day, what you think about me? is it possible to i learn what NxOgre does and help you to you completly add all PhysX feature in it(NxOgre) ? but i know that i have not enough knowledge with comparing your knowledge
but i can try.... :roll: perhaps that you need apprentice :oops:

if you see Novodex 2.4.4 , you can see cloth demo. its nice, i live it, and i want use it(cloth) in NxOgre, but first you must trust me. :roll:
dont forget i have not any jobs, and im idle all over each day!. :wink:


maybe you answer : betajaen say: "I dont need any apprentice, shut up...." :evil:

betajaen

21-08-2006 14:55:31

So basically your trying imitate NxOgre using NxOgre?

If you want to have a go at doing cloth in NxOgre go ahead, the prefab system is where you need to start. Just look at how the cloth code works in the PhysX SDK and try to implement it in.

I expect you'll need some knowledge on how create custom meshes, then adjust them in real-time so not only that they move, but can break apart.

Of course you need some hardware to test it with though.

However as your pretty new to this all, I suggest you try something a little lighter.

ahmadi

21-08-2006 15:00:46

Thank you for your trust
Of course you need some hardware to test it with though.

what you mean from hardware? you mean good pc or Ageia hardware?

betajaen

21-08-2006 15:05:29

Correct me if I'm wrong but the PhysX 2.4.4 SDK I am using, with the cloth demo's requires a PhysX PPU card.

ahmadi

21-08-2006 19:37:01

Correct me if I'm wrong but the PhysX 2.4.4 SDK I am using, with the cloth demo's requires a PhysX PPU card.
i have PhysX 2.4.4 SDK, but here it dont need any PhysX PPU card in my system.

betajaen

21-08-2006 20:03:47

Did you run any of the cloth samples?

ahmadi

21-08-2006 21:39:10

Did you run any of the cloth samples?
ya ,please see this screen shot that is from my system :
...
also i ask you that really see " Novodex Rocket Demo " you can find it on google, it must have more than 70MB .

betajaen

21-08-2006 21:45:46

Well, it seems you don't need PhysX hardware to run it..

I know about the rocket demo, but I'm not downloading 70 megs.

ahmadi

21-08-2006 21:50:18

Well, it seems you don't need PhysX hardware to run it..

I know about the rocket demo, but I'm not downloading 70 megs.


You want say that in your system,cloth demo need hardware,
do you have hardware simulator? i have it.

betajaen

21-08-2006 21:51:27

No, I'm not saying anything. I've always assumed that it required hardware to run with.

However I now know that it uses the software, and is possibly accelerated via hardware.

ahmadi

21-08-2006 21:54:49

You have a PhysX card?
nope, i have only a card simulator.... hehe :D

ahmadi

21-08-2006 21:55:36

Please take a look on your personal message ....

ahmadi

21-08-2006 22:27:28

sorry again, im not success to detect what must i assign to ".userdata" in
actor.userData= ??

also in your nxogre , you have :
mActor->userData = this;
this mean your class and i can not understand more...

betajaen

21-08-2006 22:32:39

NxOgre uses the userData as a pointer to the body class, so when the next scene update is used.

During the Scene Simulate function. Amongst many other things, it does it's gets all the NxActors of that scene, then casts the UserData of an NxActor into a body, then calls the body's simulate function which updates the position/orientation in the Ogre world.

If your planning to use the userData, I suggest you don't. Most likely NxOgre will crash by casting it into something it is not.

The prefab system is designed so you can have your own custom body with an NxActor which does it via a different route without using the UserData as a point of reference.