IrrPhysx 0.2 - Nvidia Physx 2.8.1 wrapper
-
- Posts: 1638
- Joined: Mon Apr 30, 2007 3:24 am
- Location: Montreal, CANADA
- Contact:
Yeah, this one does the same as HAVOK. Theses are artist tools. Look as good as the HAVOK ones.
Here is a link to a video of a demo:
http://www.youtube.com/watch?v=8JtAdTon0JA
From what I see there is very few infos and documents about this APEX framework. Seem relatively new. We can register with NVIDIA to be a BETA TESTER for APEX. Not sure they have completed all of the modules (Cloth seem to be done, since they talk about plugins for MAX and MAYA). But there is almost no detailed info about destruction. It was first presented at the 2009 GDC. It seem to have been developped on the CUDA platform.
If all thoses modules are done, they will beat off HAVOK surely! (Their vegetation module look very promising, as you can chop off trees and bend branches with collisions impact)
EDIT: Found that they applied destruction on UT3 (NVidia mod)
Video here:
http://www.youtube.com/watch?v=LPvL73GH ... re=related
If you look attentively the demo, you'll see that the level designer defined what was breakable and what is not. They used their tool to create the pieces (As JP mentionned, without it, you have to create the pieces manually in your 3D modeling application that is very time consuming)
Here is a video demonstrating the FRACTURE artist tool that created all the elements of destruction:
http://www.youtube.com/watch?v=WuV6wGnm ... re=channel
Here is their tools they used to create cloth ingame (maya plugin):
http://www.youtube.com/watch?v=w9pHHBME ... re=channel
Here is a link to a video of a demo:
http://www.youtube.com/watch?v=8JtAdTon0JA
From what I see there is very few infos and documents about this APEX framework. Seem relatively new. We can register with NVIDIA to be a BETA TESTER for APEX. Not sure they have completed all of the modules (Cloth seem to be done, since they talk about plugins for MAX and MAYA). But there is almost no detailed info about destruction. It was first presented at the 2009 GDC. It seem to have been developped on the CUDA platform.
If all thoses modules are done, they will beat off HAVOK surely! (Their vegetation module look very promising, as you can chop off trees and bend branches with collisions impact)
EDIT: Found that they applied destruction on UT3 (NVidia mod)
Video here:
http://www.youtube.com/watch?v=LPvL73GH ... re=related
If you look attentively the demo, you'll see that the level designer defined what was breakable and what is not. They used their tool to create the pieces (As JP mentionned, without it, you have to create the pieces manually in your 3D modeling application that is very time consuming)
Here is a video demonstrating the FRACTURE artist tool that created all the elements of destruction:
http://www.youtube.com/watch?v=WuV6wGnm ... re=channel
Here is their tools they used to create cloth ingame (maya plugin):
http://www.youtube.com/watch?v=w9pHHBME ... re=channel
Hey JP, new comer here. Just wanted to drop a shout out to you. Very nice, clean, and well documented wrapper you have constructed. I went trough great leaps to get my vs 2005 to 08, but after that it was a breeze.
I'm going to be giving your phys engine a work out, starting with the heightmap. I will report if I have those issues I read about here.
the only question I have, as I imagine most do, is.. Will we see version 3 this month or next?
Also I currently move objects by transformations, and saw a few people attempted a force method. Has anyone perfected this? I have not looked in to that but I image that a better way to create motion.
btw: Not a big deal and I'm sure its just a few difference in linker options but, what this all about?
I'm going to be giving your phys engine a work out, starting with the heightmap. I will report if I have those issues I read about here.
the only question I have, as I imagine most do, is.. Will we see version 3 this month or next?
Also I currently move objects by transformations, and saw a few people attempted a force method. Has anyone perfected this? I have not looked in to that but I image that a better way to create motion.
btw: Not a big deal and I'm sure its just a few difference in linker options but, what this all about?
Code: Select all
IrrPhysx.lib(IrrPhysx.obj) : MSIL .netmodule or module compiled with /GL found; restarting link with /LTCG; add /LTCG to the link command line to improve linker performance
LINK : warning LNK4075: ignoring '/INCREMENTAL' due to '/LTCG' specification
LINK : warning LNK4098: defaultlib 'LIBCMT' conflicts with use of other libs; use /NODEFAULTLIB:library
First 2 lines of warnings means one of the lib (anyone of those) got the flag that project should be optimized on linking and not on compile (and thus can have more optimization). However, the warning is because the project itself is not set with that flag meaning it first compiled when building the obj and must now start anew since he found this flag at linking time. Change it in your project setting (both linker(LTCG) and c++ interpreter(GL)) and you will both compile faster and remove the warning.
The second warning means one of the default library is conflicting. This happens 99.9% of the time when you mix debug with release or threaded dll with threaded (or debug threaded dll with threaded debug or any other mix having dll and not dll). Check each of your libs. But anyway, you can choose to ignore libcmt if you'd rather not fix all your projects (I'd advise to fix your projects and libs, however ^^)
The second warning means one of the default library is conflicting. This happens 99.9% of the time when you mix debug with release or threaded dll with threaded (or debug threaded dll with threaded debug or any other mix having dll and not dll). Check each of your libs. But anyway, you can choose to ignore libcmt if you'd rather not fix all your projects (I'd advise to fix your projects and libs, however ^^)
Dorth gives a better explanation there than I could! I've got these pesky warnings on a few of my projects but not on others and can never get rid of them in those projects no matter what I do... Maybe Dorth's suggestions will help with that... Regardless, it seems that they don't actually cause any harm that I can see.
Unfortunately we probably won't be seeing 0.3 for a while due to the mega hours I'm doing at work (current record of badness is 35 hours at work over two days... thank god I love my job! ).
Unfortunately we probably won't be seeing 0.3 for a while due to the mega hours I'm doing at work (current record of badness is 35 hours at work over two days... thank god I love my job! ).
My terrain is not at the right position and scale? I turned on the debug view and I see my terrain phys object is not correct unless scal and rotation are (0,0,0)
Testing::
using a rotation other the 0,0,0 will rotate the phys object mesh around point 1,1,1. In other words if I rotate my terrain by y 90, my phys mesh is now off to the side.
using scale seem to drastically off set the mesh in the Y only, If I scale by 1,2,1 seems the mesh was moved down by 50% or so. However the scale was correct. The pos was just compromised. I fI do this It rights it.
I;m guessing this is the Y multiplier that is messing things up.
offsetting the position seem to work fine.
BTW: I'm using the first method of terrain phys.
ne.
Testing::
using a rotation other the 0,0,0 will rotate the phys object mesh around point 1,1,1. In other words if I rotate my terrain by y 90, my phys mesh is now off to the side.
using scale seem to drastically off set the mesh in the Y only, If I scale by 1,2,1 seems the mesh was moved down by 50% or so. However the scale was correct. The pos was just compromised. I fI do this
Code: Select all
terrObj->setPosition( core::vector3df( terr->getPosition().X, terr->getPosition().Y * -1.55,terr->getPosition().Z ) );
I;m guessing this is the Y multiplier that is messing things up.
offsetting the position seem to work fine.
BTW: I'm using the first method of terrain phys.
ne.
I thought all the terrain stuff was fairly good but possibly not... especially the method of passing in the raw data, rather than an irrlicht heightmap, that one's a bit tricky to get right I think.
Unfortunately I can't help you much with it as I'd have to take a close look into it all and don't have the time to do so.. so you'll have to try and debug it yourself I guess... Really sorry about that!
Unfortunately I can't help you much with it as I'd have to take a close look into it all and don't have the time to do so.. so you'll have to try and debug it yourself I guess... Really sorry about that!
I've too have had problems with scaling my Irrlicht terrain node. Since I'm not content with having a map with a y-scale of 1 I dug in to the wrapper code and tried to alter it so that it would work with my map scale (I want a y-scale of 4). This is what I did:
I change the line
to
Then I altered the line
to
And finaly I changed
to
That works pretty well for my current map, but I tried another one which failed big time.
I change the line
Code: Select all
currentSample->height = (NxI16)((heightmap->getPixel(row,column).getLuminance() - centre.Y) * Y_MULTIPLIER);
Code: Select all
currentSample->height = (NxI16)((heightmap->getPixel(row,column).getLuminance()) - centre.Y/scale.Y );
Code: Select all
heightFieldShapeDesc.heightScale = scale.Y / Y_MULTIPLIER;
Code: Select all
heightFieldShapeDesc.heightScale = scale.Y;
Code: Select all
actorDesc.globalPose.t = NxVec3(position.X, position.Y, position.Z);
Code: Select all
actorDesc.globalPose.t = NxVec3(position.X, position.Y*scale.Y, position.Z);
It'll only take a minute or two to debug this code...
First of i want to say thanks for this great wrapper. as my knowledge when it comes to c++ and good programming in general is very limited, as i'm a visual effects artist, i really love the concept of irrlicht and your wrapper, to keep things simple and the hard stuff away from me. so thanks for this.
now, i have a problem with one aspect of your wrapper. i'm doing a little game with the artoolkit (Augmented Reality, pattern tracking etc) and already use the irrar wrapper from "FreakNigh" to render my stuff with irrlicht. so far everything works great.
now i tried your wrapper for physx and everything worked as expected but one thing does not or i'm just too stupid to get it work.
i need to put my phys objects into different collisionGroups. so i tried the "setCollisionGroup " function: virtual void IrrPhysx::IPhysxObject::setCollisionGroup ( u16 group ) [inline, virtual]
but this does not work for me. my objects still collide with everything in the scene. it's a bit difficult to explain why i need this, because of the pattern tracking stuff and this does complicate things allot, but i will try so.
so i have a function which creates my physObjs:
there i use assetOWN as my group identifier. this function calls a class function in my assetManager:
there i set the collision group. so everytime i call the loadLevel function with different assetOWN values, i want only the physObjs collide within the same group. but it does not work. so i hope you guys can help me with that. maybe i missed something how to set up collison groups, because i thouhgt you just have to pass different u16 values and that's it.
please don't blame me about bad code and stuff, i know this and the possibility that i simply did something totaly stupid is relativly high
so, thanx in advance!
now, i have a problem with one aspect of your wrapper. i'm doing a little game with the artoolkit (Augmented Reality, pattern tracking etc) and already use the irrar wrapper from "FreakNigh" to render my stuff with irrlicht. so far everything works great.
now i tried your wrapper for physx and everything worked as expected but one thing does not or i'm just too stupid to get it work.
i need to put my phys objects into different collisionGroups. so i tried the "setCollisionGroup " function: virtual void IrrPhysx::IPhysxObject::setCollisionGroup ( u16 group ) [inline, virtual]
but this does not work for me. my objects still collide with everything in the scene. it's a bit difficult to explain why i need this, because of the pattern tracking stuff and this does complicate things allot, but i will try so.
so i have a function which creates my physObjs:
Code: Select all
void loadLevel(std::string levelPfad,std::string levelEndung,int levelParts,scene::ISceneNode* parent,irr::u16 assetOWN, core::vector3df position) {
std::string levelModel("");
std::string levelCount;
std::string levelTexture;
for (int i = 1; i<levelParts; i++) {
tempAsset = new assetManager(device,physxManager);
tempAsset->assetOWN = assetOWN;
std::ostringstream temp;
temp << i;
levelCount = temp.str();
levelModel.append(levelPfad);
levelModel.append(levelCount);
levelTexture = levelModel;
levelModel.append(levelEndung);
levelTexture.append(".png");
MyAssets.push_front(tempAsset->loadAsset(levelModel,levelTexture,parent,assetOWN,position));
temp.clear(true);
levelModel.clear();
}
}
Code: Select all
assetManager* assetManager::loadAsset(std::string assetPfad, std::string texturePfad, scene::ISceneNode* parent, irr::u16 assetOWN, core::vector3df position)
{
IPhysxMesh * levelPhysx = 0;
SPhysxAndNodePair * levelPair = 0;
scene::IMesh* levelMesh;
this->assetOWN = assetOWN;
levelMesh = smgr->getMesh(assetPfad.c_str());
levelPair = new SPhysxAndNodePair;
levelPhysx = this->physxManager->createConvexMesh(levelMesh->getMeshBuffer(0), core::vector3df(1,1,1));
levelPair->PhysxObject = physxManager->createConvexMeshObject(levelPhysx, position, core::vector3df(0,0,0), rand());
levelPair->SceneNode = smgr->addMeshSceneNode(levelMesh, parent, assetOWN,position, core::vector3df(0,0,0), core::vector3df(1,1,1));
levelPair->SceneNode->setMaterialTexture(0, driver->getTexture(texturePfad.c_str()));
levelPair->SceneNode->setMaterialFlag(video::EMF_NORMALIZE_NORMALS, true);
levelPair->SceneNode->setMaterialFlag(video::EMF_LIGHTING, false);
levelPair->SceneNode->setMaterialType(video::EMT_SOLID);
levelPair->PhysxObject->setCollisionGroup(assetOWN);
levelPair->SceneNode->setMaterialType(irr::video::EMT_TRANSPARENT_ALPHA_CHANNEL_REF);
//objects->push_back(levelPair);
levelMesh->drop();
this->assetID++;
this->asset = levelPair;
//delete levelPhysx;
//delete levelPair;
return this;
}
please don't blame me about bad code and stuff, i know this and the possibility that i simply did something totaly stupid is relativly high
so, thanx in advance!