Page 20 of 29

Posted: Tue May 20, 2008 10:14 am
by psyco001
Hi,
is there a way to solve this error:

Code: Select all

.\IrrNewt_src\ragdoll.cpp(193) : error C2440: 'Initialisierung': 'irr::core::list<T>::ConstIterator' can not be converted to 'irr::core::list<T>::Iterator' 
the other errors are all solved

Posted: Tue May 20, 2008 3:24 pm
by Donner
Thanks, white tiger

Then another question: can I disable an object (IVehicleTire) or freeze it, so that the World don't calculate any physics for this object until I enable it? Or have I to destroy it and to recreate it?

Posted: Tue May 20, 2008 7:05 pm
by stevend
Yeah well i compiled irrNewt finally on my new development machine and threw the new dll into the mix and im having new problems, with your character controller i think!

On my P3 800 the character moves and walks fine, on my 3.3 ghz its choppy and almost dosen't move at all. not framerate, but actual character movement.

I would think it has something to do with framerate independence but i use the code from your example to do so:

Code: Select all

	
		//CHARACTER CONTROLLING
		core::vector3df rigell_rotation = node->getRotation();

		//STEP 1: ROTATING
		//make node rotation frame rate indipendent by multiply it by time elasped from last update
		float rotation_to_apply = rotation_speed * fact->p_world->getTimeElapsed();

		if(right) 
			rigell_rotation.Y+=rotation_to_apply;

		if(left) 
			rigell_rotation.Y-=rotation_to_apply;

		node->setRotation(rigell_rotation);

		//STEP 2: MOVING
		core::vector3df velocity = charcontrol->getVelocity();
		velocity.X=velocity.Z=0;

		if(up) //without FRI in function name the movement is not frame rate indipendent
			velocity += charcontrol->FRIgetDirectionPositionY(core::vector3df(rigell_speed,0,0));
		if(down)
			velocity += charcontrol->FRIgetDirectionPositionY(core::vector3df(-rigell_speed,0,0));

		charcontrol->setVelocity(velocity);
any ideas?

Posted: Wed May 21, 2008 11:01 am
by matgaw
Hi white tiger! Glad to see you back!

I think I've found a bug in IrrNewt 0.4. When I add an object, which has some relative position to another, then the Newton body shows up in very different position than the node itself (it seems that Newton interprets the relative position as absolute one).

I almost managed to fix it, but my fix works only when scales of parent body and relative body are the same - if not, then body shows up in slightly wrong position.

Could you find out how to fix this bug, please? I'm not familiar with Irrlicht transformation matrixes...

Posted: Wed May 21, 2008 1:33 pm
by white tiger
psyco001 wrote:Hi,
is there a way to solve this error:

Code: Select all

.\IrrNewt_src\ragdoll.cpp(193) : error C2440: 'Initialisierung': 'irr::core::list<T>::ConstIterator' can not be converted to 'irr::core::list<T>::Iterator' 
the other errors are all solved
i had this problem too when compiled for 1.4. you need to change iterator to constiterator in the ragdoll.cpp

line 192-193

Code: Select all

const list<ISceneNode*>& children = BoneNode->getChildren();
	for (list<ISceneNode*>::ConstIterator it = children.begin(); it != children.end(); ++it) {

Posted: Wed May 21, 2008 1:36 pm
by white tiger
Donner wrote:Thanks, white tiger

Then another question: can I disable an object (IVehicleTire) or freeze it, so that the World don't calculate any physics for this object until I enable it? Or have I to destroy it and to recreate it?
if you don't call setAutoFreeze(false) the body is automatically freezed if it doesn't move. BTW to freeze it manually call setFreeze(true) on the chassis

Posted: Wed May 21, 2008 1:47 pm
by white tiger
stevend wrote:Yeah well i compiled irrNewt finally on my new development machine and threw the new dll into the mix and im having new problems, with your character controller i think!

On my P3 800 the character moves and walks fine, on my 3.3 ghz its choppy and almost dosen't move at all. not framerate, but actual character movement.

I would think it has something to do with framerate independence but i use the code from your example to do so:

Code: Select all

	
		//CHARACTER CONTROLLING
		core::vector3df rigell_rotation = node->getRotation();

		//STEP 1: ROTATING
		//make node rotation frame rate indipendent by multiply it by time elasped from last update
		float rotation_to_apply = rotation_speed * fact->p_world->getTimeElapsed();

		if(right) 
			rigell_rotation.Y+=rotation_to_apply;

		if(left) 
			rigell_rotation.Y-=rotation_to_apply;

		node->setRotation(rigell_rotation);

		//STEP 2: MOVING
		core::vector3df velocity = charcontrol->getVelocity();
		velocity.X=velocity.Z=0;

		if(up) //without FRI in function name the movement is not frame rate indipendent
			velocity += charcontrol->FRIgetDirectionPositionY(core::vector3df(rigell_speed,0,0));
		if(down)
			velocity += charcontrol->FRIgetDirectionPositionY(core::vector3df(-rigell_speed,0,0));

		charcontrol->setVelocity(velocity);
any ideas?
Short reply: no :wink:

First of all: try the character controller example as it on your 3.3 ghz and see if it works. why are you sure it is not the framerate? BTW i have an AMD athlon 2600+ and it works.

Posted: Wed May 21, 2008 1:51 pm
by white tiger
matgaw wrote:Hi white tiger! Glad to see you back!
me too :D
matgaw wrote:I think I've found a bug in IrrNewt 0.4. When I add an object, which has some relative position to another, then the Newton body shows up in very different position than the node itself (it seems that Newton interprets the relative position as absolute one).

I almost managed to fix it, but my fix works only when scales of parent body and relative body are the same - if not, then body shows up in slightly wrong position.

Could you find out how to fix this bug, please? I'm not familiar with Irrlicht transformation matrixes...
can you post your fix, a code that show the bug (with different scales) and upload the mesh you are using, please? i can't debug whitout these

Posted: Wed May 21, 2008 2:29 pm
by white tiger
you can get the latest source into SVN now :wink:

https://aresfps.svn.sourceforge.net/svn ... ps/IrrNewt

anonymouse login has read access :D

Posted: Thu May 29, 2008 12:20 am
by lab_zj
I have downloaded this newton package,and created a scene with a large
IMesh(including sveral meshbuffer),and I used this IMesh as terrain. and then, I created a FPS camera to collision with terrain,the result is very strange:
1. when I create this IMesh as EBT_TERRAIN,then my computer will restarted.
2. when I created this IMesh as EBT_CONVEX_HULL,then terrain no any effect fpor FPS camera.
I don't know why this happened,because most physics code is copied from irrnewt_sdk_v0.4.

oh, I have recompiled this v0.4 SDK for irrlicht 1.4,and tested all samples come from irrnewt sdk, it's all OK.

currently,the main problem is how to create a terrain that represented by IMesh with several meshbuffer?

IMesh *terrainMesh=createMyTerrainMesh(...);
IMeshSceneNode *terrainNode=mgr->addMeshSceneNode(terrainMesh);
irr::newton::SBodyFromNode terrainData;
terrainData.Node=terrainNode;
<How to set other arguments for terrainData? >
IBody *terrainBody=p_world->createBody(terrainData);
... ...

Posted: Mon Jul 07, 2008 5:21 pm
by stevend
ok how would i move an object useing "force" from a to b.

i am using body->addImpulse(vector3df(1,1,1), B_POSITION);

where B_POSITION == active_camera->getposition();

the object moved at random it seems, some times flying off the map. sometimes it moves slow, sometimes it moves fast.

that is the exact and only code i use to apply force,

any ideas?

Posted: Thu Jul 17, 2008 12:04 am
by analize999
Excuse me, I just download irrNewt from http://aresfps.sourceforge.net/irrnewt.htm
I tried to compile an example in irrNewt SDK, but it's not successful. The error message is "Cannot open include file: 'newton.h': No such file or directory". I tried to find newton.h in all directories of irrNewt SDK. Maybe the author forgot export this file into SDK. Anybody has this file, please help me. You can copy and paste this file into Reply. Thank you very much.

Posted: Thu Jul 17, 2008 1:09 am
by Virion
you have to download newton game dynamics sdk i guess.

Posted: Thu Jul 17, 2008 11:28 pm
by analize999
But where does the newton game dynamics sdk? In the tiger's web just only has irrNewt SDK. Would you like to give me this link?

Posted: Thu Jul 17, 2008 11:53 pm
by Virion
analize999 wrote:But where does the newton game dynamics sdk? In the tiger's web just only has irrNewt SDK. Would you like to give me this link?
Newton Game Dynamics (NGD) is not belongs to Irrlicht so you have to download it separately at http://www.newtondynamics.com irrNewt is just a wrapper for NGD and irrlicht.

you can actually find the answer in a second with google.