IrrNewt irrlicht\newton framework >> SVN access

Announce new projects or updates of Irrlicht Engine related tools, games, and applications.
Also check the Wiki
psyco001
Posts: 10
Joined: Mon Oct 29, 2007 11:20 am
Location: Germany
Contact:

Post 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
Donner
Posts: 87
Joined: Fri May 18, 2007 11:27 am

Post 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?
stevend
Posts: 114
Joined: Sat Mar 01, 2008 7:18 pm

Post 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?
matgaw
Posts: 45
Joined: Sat Oct 06, 2007 11:33 am

Post 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...
white tiger
Posts: 269
Joined: Tue Oct 31, 2006 3:24 pm
Contact:

Post 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) {
white tiger
Posts: 269
Joined: Tue Oct 31, 2006 3:24 pm
Contact:

Post 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
white tiger
Posts: 269
Joined: Tue Oct 31, 2006 3:24 pm
Contact:

Post 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.
white tiger
Posts: 269
Joined: Tue Oct 31, 2006 3:24 pm
Contact:

Post 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
white tiger
Posts: 269
Joined: Tue Oct 31, 2006 3:24 pm
Contact:

Post 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
lab_zj
Posts: 26
Joined: Wed May 21, 2008 3:25 am

Post 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);
... ...
stevend
Posts: 114
Joined: Sat Mar 01, 2008 7:18 pm

Post 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?
analize999
Posts: 12
Joined: Mon Jun 30, 2008 11:35 pm
Location: VietNam

Post 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.
Virion
Competition winner
Posts: 2148
Joined: Mon Dec 18, 2006 5:04 am

Post by Virion »

you have to download newton game dynamics sdk i guess.
analize999
Posts: 12
Joined: Mon Jun 30, 2008 11:35 pm
Location: VietNam

Post 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?
Virion
Competition winner
Posts: 2148
Joined: Mon Dec 18, 2006 5:04 am

Post 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.
Post Reply