Tumle v1.4 irrlicht/newton

Announce new projects or updates of Irrlicht Engine related tools, games, and applications.
Also check the Wiki
JonLT
Posts: 152
Joined: Thu Mar 15, 2007 5:47 pm
Location: Denmark

Tumle v1.4 irrlicht/newton

Post by JonLT »

Tumle 1.4
You would think that such a big leap in version number meant that a big deal has happened. Thats not the case, sorry. This is just to indicate that Tumle now works with irrlicht 1.4. The only thing changed is the way the event receiver is passed on to the Tumle classes. In stead of a pointer, it is now a const ref.
I've also made Tumle a little more Linux friendly, by putting in a 'configure' script that makes some makefiles.
Here's the link: tumle-1.4.zip
mirror
mirror
~ 160 kb.
Thanks to FuzzYspo0N for pointing out the need to update.


Tumle v0.1
Tumle is a irrlicht/newton framework i've been working on as I thought it would be usefull for a game.
Tumle (aka IN) consists of the same files as IN, the only thing changed is the name and some small stuff, I've also added a version number for convenience.



The features:
- create physics objects from scene nodes.
- create and apply materials to the objects, to control the objects behavior.
- collision callbakcs, to control what happens when objects collide.
- user controlled physics objects.
- user controlled physics FPS camera.

Download includes
- Source files.
- Six example files.

How to use Tumle
- Download the newton SDK, include newton.h and link to newton.lib.
- Add the Tumle source files to you project and include the Tumle includes.
- Do whatever you do when you use Irrlicht.

The only thing left now is to download: tumle.zip ~ 160 KB (this is the old one - look above)

Changes since IN:
http://www.jonlt.frac.dk/tumle/changes.txt

P.S. To you who use IN (if any) just rename everything that was called IN to Tumle, and you should be fine.
Last edited by JonLT on Tue Oct 20, 2009 3:16 pm, edited 23 times in total.
Halan
Posts: 447
Joined: Tue Oct 04, 2005 8:17 pm
Location: Germany, Freak City
Contact:

Post by Halan »

cool 8)

rm a character controller would be nice :)
JonLT
Posts: 152
Joined: Thu Mar 15, 2007 5:47 pm
Location: Denmark

Post by JonLT »

Thanks for downloading! :)
Character controller is on my wish list along with a collidable camera.
Haven't looked into it yet though
Midnight
Posts: 1772
Joined: Fri Jul 02, 2004 2:37 pm
Location: Wonderland

Post by Midnight »

Q. What are Q and A tags for?
A. Oh they make things contextual.

Q. What do you mean?
A. It's so things make sense. 8)
JonLT
Posts: 152
Joined: Thu Mar 15, 2007 5:47 pm
Location: Denmark

Post by JonLT »

I've made some better documentation http://www.jonlt.frac.dk/IN it really made me feel important :D
And I've added Q and A tags in the initial post for you midnight :)

EDIT: (documentation is included in the download now)
Last edited by JonLT on Wed Oct 21, 2009 1:29 am, edited 1 time in total.
JonLT
Posts: 152
Joined: Thu Mar 15, 2007 5:47 pm
Location: Denmark

Post by JonLT »

I've managed to make a colliding camera, calling it INCamera :shock: .
And I've cleaned up in the code, i really think this is getting usefull :roll:
Anyways the link in the initial post now links to the improved version.
roxaz
Posts: 575
Joined: Tue Jan 23, 2007 8:35 pm
Location: LT

Post by roxaz »

i made colliding camera too but while moving speed is increasing. maybe you managed to keep constant camera speed? i tried but im noob at physics so it was too hard for me :)

P.S. maybe you are from Lithuania?
JonLT
Posts: 152
Joined: Thu Mar 15, 2007 5:47 pm
Location: Denmark

Post by JonLT »

if you move the camera with forces it will accelerate, if you want a constant speed use NewtonBodySetVelocity
roxaz
Posts: 575
Joined: Tue Jan 23, 2007 8:35 pm
Location: LT

Post by roxaz »

not exactly. i done this like you said. here it is

Code: Select all

void Player::updateMovement()
{
	vector3df move(0,0,0);
	if(keysDown[KEY_KEY_W])
		move.Z += MAX_SPD;
	if(keysDown[KEY_KEY_S])
		move.Z -= MAX_SPD;
	if(keysDown[KEY_KEY_A])
		move.X -= MAX_SPD;
	if(keysDown[KEY_KEY_D])
		move.X += MAX_SPD;

	node->getAbsoluteTransformation().rotateVect(move);
	float moveF[3];
	tb::vecToFloat(&move, &moveF[0]);
	float currVeloc[3];
	NewtonBodyGetVelocity(body, &currVeloc[0]);
	float newVeloc[3];
	newVeloc[0] = moveF[0] + currVeloc[0];
	newVeloc[1] = moveF[1] + currVeloc[1];
	newVeloc[2] = moveF[2] + currVeloc[2];

	NewtonBodySetVelocity(body, &newVeloc[0]);
}
body is still moving faster and faster. i tried not to add current velocity, then body speed is cinstant but gravity does not work for this body. 8)
JonLT
Posts: 152
Joined: Thu Mar 15, 2007 5:47 pm
Location: Denmark

Post by JonLT »

you are adding the velocity, but you just need to set it:

Code: Select all

if(keysDown[KEY_KEY_W]) 
    move.Z = MAX_SPD;   //not +=
and after the key check try this:

Code: Select all

float newpos[3] = {move.X,0, move.Z}; //only mover vertically
NewtonBodySetVelocity(body, (float*)newpos);
        
if(!(event.KeyInput.PressedDown)) //stop the camera if the keys are released
    {
            move.X -= somefloat;
            move.Z -= somefloat;
    }
[EDIT: sorrry didn't see that last line in your post :oops: , im currently trying to get the same thing to work]
roxaz
Posts: 575
Joined: Tue Jan 23, 2007 8:35 pm
Location: LT

Post by roxaz »

check this out http://www.newtondynamics.com/forum/viewtopic.php?t=753 maybe you will have more luck in understanding it :)
JonLT
Posts: 152
Joined: Thu Mar 15, 2007 5:47 pm
Location: Denmark

Post by JonLT »

this is what needs to be done:

Code: Select all

 
node->getRelativeTransformation().rotateVect(move); 
float currVeloc[3]; 
NewtonBodyGetVelocity(body, &currVeloc[0]); 
float newpos[3] = {move.X,currVeloc[1], move.Z};
NewtonBodySetVelocity(body, (float*)newpos);
this gets the vertical velocity and passes it on the the new velocity
roxaz
Posts: 575
Joined: Tue Jan 23, 2007 8:35 pm
Location: LT

Post by roxaz »

its not good too. lets say camera is moving and box hit camera. box will bounce from cam like from wall because it can not affect cam speed. in other words - when camera is moving it looks like cam mass is infinitive
JonLT
Posts: 152
Joined: Thu Mar 15, 2007 5:47 pm
Location: Denmark

Post by JonLT »

Julio Jerez wrote this:
Unfortunately there is not way to move bodies kinematically in 1.5, 1.6 will have that ability so these problems will be a lot easier to deal with, since it will be legal to set the body velocities and the solver will understand it correctly. This will allow for the implementation of player without having to use inverse dynamics.
Until then thei sis the only thing Newton can offer.
on the newton forum:http://www.newtondynamics.com/forum/vie ... php?t=3370

Wikipedia on inverse dynamics: http://en.wikipedia.org/wiki/Inverse_dynamics
Inverse dynamics uses link-segment models to represent the mechanical behavior of connected pendulums, or more concretely, the limbs of humans or animals, where given the kinematic representation of movement, inverse dynamics derives the kinetics responsible for that movement. In practice, from observations of the motion (of limbs), inverse dynamics is used to compute the associated moments (joint torques) that lead to that movement, under a special set of assumptions.
So unless we want to give the camera legs, i think we have to settle with infinit-mass-camera.

If you set the mass of the camera to much less than that of the bodies, the only wrong thing happening is, that if the camera is moving while being hit with someting, it will not respond all to good, but the object hitting it behaves as it should.
roxaz
Posts: 575
Joined: Tue Jan 23, 2007 8:35 pm
Location: LT

Post by roxaz »

if so... then we will have to wait until 1.6 comes out
Post Reply