IrrPhysx 0.2 - Nvidia Physx 2.8.1 wrapper

Announce new projects or updates of Irrlicht Engine related tools, games, and applications.
Also check the Wiki
JP
Posts: 4526
Joined: Tue Sep 13, 2005 2:56 pm
Location: UK
Contact:

Post by JP »

Hopefully quite soon... I do have a rather hectic schedule coming up though with buying a home and getting married so i'd rather not commit to any sort of dates!
Image Image Image
geckoman
Posts: 143
Joined: Thu Nov 27, 2008 11:05 am
Location: Germany
Contact:

Post by geckoman »

Hehe good luck! You know the rings are the smallest handcuffs in the world?
(For me it's too late :cry: )


Back to Topic:
Another question: Why is the calculation so extremly slow? Did I miss something?
If I put the gravity to -98.1 it's more realistic. But shouldn't it be the default behavior that it's calculated like in the real world?
Is there a setting that causes this?

Btw. I think you guessed it already, I will use your IrrPhysx!
JP
Posts: 4526
Joined: Tue Sep 13, 2005 2:56 pm
Location: UK
Contact:

Post by JP »

Yeah i found that -60 for gravity was much more realistic looking... I think it basically depends on the scale of your scene... The example scenes are pretty small... around 50x50 units visible... and so maybe it needs a higher gravity to look right.. i don't know... people have talked about scaling the physx scene to get correct results but i've not looked into this yet...

something else i noticed is that it seems that calculations take longer with higher gravity... Try out the boxes example with normal gravity and then with higher gravity and you'll probably notice that it takes longer to settle down when you add a big stack of boxes... i guess maybe with higher forces it takes longer for the forces to settle... :s
Image Image Image
Malebolge
Posts: 19
Joined: Sun Aug 31, 2008 8:24 pm

Post by Malebolge »

I have a problem when i make a .exe for the proyect and run it on another pc.

Its load the menu just find, but when i load the scene with physics, it crash with : IrrPhysx wrapper version 0.20 for Physx by Nvidia 2.8.1
SDK create error (1 - Unknown error).

In the first pc, it run perfect, but not in the second. And the diferrence is that in the second i dont have installed PhysX SDK or Physx system software.

I dont want to install all that to run the game. What i need to add to the proyect or to the folder with the .exe to work?

thanks

EDIT i make it work with only a folder , but i need to have C:\Program Files\AGEIA Technologies\v2.8.1 in that path exclusive

Is there a way to move this folder next to the .exe and make it work?
JP
Posts: 4526
Joined: Tue Sep 13, 2005 2:56 pm
Location: UK
Contact:

Post by JP »

If you run the physx game installer i provided with the IrrPhysx SDK that should make it work I think.
Image Image Image
Malgodur
Posts: 195
Joined: Sun Mar 15, 2009 8:22 pm

Post by Malgodur »

Hello, i have some problems with game example and physics....

GameExample crash with windows error (bug report), after loading /media.flagpole_physx.ms3d

I also cant compile it...... three similiar errors(C++ Visual 2008 express eidtion)

Code: Select all

fatal error c1010: unexpeted end of file while looking for precompiled headr. Did you forgry to add #include "stdafx.h" to your source?


Its shows up thee times, at ReadScene.cpp, GameExample.cpp and CSimpleMeshCache.cpp


Raycast and rest of stuff works fine, i installed NVIDIA stuff... im using windows Vistta




btw what do i need for working physics? I copied some stuff from raycast to demo example,. but my ball is black and dont fall down...
Please help.
JP
Posts: 4526
Joined: Tue Sep 13, 2005 2:56 pm
Location: UK
Contact:

Post by JP »

The boxes example pretty much shows the simplest setup you'd require to get physx working, study the example closely, including how SPhysxAndNodePair is used to update the irrlicht scene node's position to that of its corresponding irrphysx object.

The compile errors you're getting sound rather strange if you're using the project file i provided...

Do you have the Physx runtimes installed as described in the first post of this thread? if you don't then it's likely the Game and Heightfield examples will crash (seems the Physx Game Installer doesn't do enough for heightfields...). You do need the Physx runtimes installed if you're developing with Physx/IrrPhysx.
Image Image Image
Malgodur
Posts: 195
Joined: Sun Mar 15, 2009 8:22 pm

Post by Malgodur »

I installed Physx, everything without game example works, and compile right..
It shows in gameexample.ese

Code: Select all

IUrrPhysx wrapper version 0.20 for Physx by Nvidia 2.8.1
Physx accelerator hardware not fouynd, simulation will be done in software
then some "Loaded texture" "Could not get" ,etc and crash.


And i am using original game example Visual Studio project file....


btw i dont know how can i add quake3 meshes to physx, can somebody explain me? Everything else work, im trying to add physics to irrlicht demo.....
JP
Posts: 4526
Joined: Tue Sep 13, 2005 2:56 pm
Location: UK
Contact:

Post by JP »

Can you post the full command prompt output? "Could not get" could be causing you problems, what could it not get?

The raycast example obviously shows you how to create an irrphysx object from a quake 3 map, it doesn't give great performance though as it uses all the triangles in the map, which can be quite high. If you're serious about using a quake 3 map and want collision then I would advise creating a copy of the map with a lower poly count in order to increase performance.
Image Image Image
Malgodur
Posts: 195
Joined: Sun Mar 15, 2009 8:22 pm

Post by Malgodur »

Code: Select all






irrlicht engine version 1,5
Microsot Windows VCista Personal Service Pack1 (Build 6001)
Using renderer: Direct 9.0
NVIDFIA GeForce 9500M G nvd3dum.dll 7.15.11.7598
IUrrPhysx wrapper version 0.20 for Physx by Nvidia 2.8.1
Physx accelerator hardware not fouynd, simulation will be done in software
Loadeds texture D;\irrlicht 1.5\media\skybox\right.jpg
Loadeds texture D;\irrlicht 1.5\media\skybox\\front.jpg
Loadeds texture D;\irrlicht 1.5\media\skybox\left.jpg
Loadeds texture D;\irrlicht 1.5\media\skybox\back.jpg
Could not oopen file of texture ../media/skybox/up.jpg
Loadeds texture D;\irrlicht 1.5\media\skybox\dopwn.jpg
Loadeds texture D;\irrlicht 1.5\media\light.jpg
Loadeds texture D;\irrlicht 1.5\media\scrate.jpg
Could not get loweer surface level fdor mip map generation
Loadeds texture D;\irrlicht 1.5\media\blue.jpg
Could not get loweer surface level fdor mip map generation
Loadeds texture D;\irrlicht 1.5\media\green.jpg
Could not get loweer surface level fdor mip map generation
Loadeds texture D;\irrlicht 1.5\media\pink.jpg
Could not get loweer surface level fdor mip map generation
Loadeds texture D;\irrlicht 1.5\media\red.jpg
Could not get loweer surface level fdor mip map generation
Could not get loweer surface level fdor mip map generation
Loadeds texture D;\irrlicht 1.5\media\yellow.jpg
Loaded mesh ../mewdia.table.ms3d
Could not load meshg, because file could not be opened .../media.table_physx.ms3d

Missing files?





Well first i want add physics to demo, here is how quake3 map is loaded


Code: Select all

	quakeLevelMesh = (scene::IQ3LevelMesh*) sm->getMesh("maps/20kdm2.bsp");

	if (quakeLevelMesh)
	{
		u32 i;

		//move all quake level meshes (non-realtime)
		core::matrix4 m;
		m.setTranslation ( core::vector3df(-1300,-70,-1249) );

		for ( i = 0; i!= scene::quake3::E_Q3_MESH_SIZE; ++i )
		{
			sm->getMeshManipulator()->transformMesh ( quakeLevelMesh->getMesh(i), m );
		}

		quakeLevelNode = sm->addOctTreeSceneNode( 
			quakeLevelMesh->getMesh( scene::quake3::E_Q3_MESH_GEOMETRY)
									);
		if (quakeLevelNode)
		{
			//quakeLevelNode->setPosition(core::vector3df(-1300,-70,-1249));
			quakeLevelNode->setVisible(true);

			// create map triangle selector
			mapSelector = sm->createOctTreeTriangleSelector(quakeLevelMesh->getMesh(0),
				quakeLevelNode, 128);

			// if not using shader and no gamma it's better to use more lighting, because
			// quake3 level are usually dark
			quakeLevelNode->setMaterialType ( video::EMT_LIGHTMAP_M4 );

			// set additive blending if wanted
			if (additive)
				quakeLevelNode->setMaterialType(video::EMT_LIGHTMAP_ADD);
		}

		// the additional mesh can be quite huge and is unoptimized
		scene::IMesh * additional_mesh = quakeLevelMesh->getMesh ( scene::quake3::E_Q3_MESH_ITEMS );

		for ( i = 0; i!= additional_mesh->getMeshBufferCount (); ++i )
		{
			scene::IMeshBuffer *meshBuffer = additional_mesh->getMeshBuffer ( i );
			const video::SMaterial &material = meshBuffer->getMaterial();

			//! The ShaderIndex is stored in the material parameter
			s32 shaderIndex = (s32) material.MaterialTypeParam2;

			// the meshbuffer can be rendered without additional support, or it has no shader
			const scene::quake3::SShader *shader = quakeLevelMesh->getShader ( shaderIndex );
			if ( 0 == shader )
			{
				continue;
			}
			// Now add the MeshBuffer(s) with the current Shader to the Manager
			sm->addQuake3SceneNode ( meshBuffer, shader );
		}

		// original mesh is not needed anymore
		quakeLevelMesh->releaseMesh ( scene::quake3::E_Q3_MESH_ITEMS );

	}

What is needed here for physx ?? I tried to copy physx bsp loader from raycast_example but i get some wierd errors, or it simple dont work...

I copied rest of stuff, i can spawn balls, balls fall downand collide like in physix example... so bsp mesh is my only problem.
JP
Posts: 4526
Joined: Tue Sep 13, 2005 2:56 pm
Location: UK
Contact:

Post by JP »

Is table_physx.ms3d in the media folder? It should be...

And for the quake 3 map, as I say, look at how it's done in the raycast example.
Image Image Image
Malgodur
Posts: 195
Joined: Sun Mar 15, 2009 8:22 pm

Post by Malgodur »

Well i missed some files? Now have all installed, but i still get error.... windows bug rpot after "Loaded M<sh: .,/media/flagpole_phhysx.ms3d"



I tried to add here code from raycastexample but it dont work...as i said, or compile error or it dont work in game..

Can you tell me what i should add to demo.exe bsp loading code?
Austin
Posts: 4
Joined: Wed Mar 18, 2009 5:45 pm

Post by Austin »

Just downloaded irrlicht today.

I was pleased how straightforward it was to implemented irrphysx into a blank project and get objects moving around.

On the other hand, I was surprised when I couldn't find any force based methods.
Any plans to wrap the addForce functions?
JP
Posts: 4526
Joined: Tue Sep 13, 2005 2:56 pm
Location: UK
Contact:

Post by JP »

Yeah I should get that stuff added in at some point... It's all very bare essentials at the moment I guess... (though you may consider addForce functions to be bare essentials, it's not something I've got round to yet).

A part time work around could be to use setLinearVelocity? Depends on what you want the addForce functions for I guess!
Image Image Image
Malgodur
Posts: 195
Joined: Sun Mar 15, 2009 8:22 pm

Post by Malgodur »

How can i add MetaTriangleSelector to physx triangles??
Post Reply