Newton physics bullet example + code + need help

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
Jinto
Posts: 24
Joined: Mon Oct 13, 2003 2:59 am
Location: Ukraine

Newton physics bullet example + code + need help

Post by Jinto »

Newton physics displays good movement and collision of objects:

[img]http://cat-.front.ru/Screen.jpg[/img]

Need help in solving such problems:
1 Definition of the coordinates of the collision object (bullet) with the surface or other objects to display the

explosion.
2 How to distinguish between different objects (soil, water, concrete) to display various types of explosions?

Demo and code (3.7Mb) here: http://uploadbox.com/files/5deeac1434/

Control:

Fire - left mouse
F3-F4 - optical sight

==============================================
Jinto
Posts: 24
Joined: Mon Oct 13, 2003 2:59 am
Location: Ukraine

Re: Newton physics bullet example + code + need help

Post by Jinto »

1 Point of collision object and terrain
...
f32 p0[3];
f32 p1[3];
core::vector3df pos=cubes[total-1]->node->getAbsolutePosition();
p0[0]=pos.X;
p0[1]=pos.Y;
p0[2]=pos.Z;
NewtonBodyGetVelocity(cubes[total-1]->body, p1);

p1[0]=p1[0]*0.05f+p0[0];
p1[1]=p1[1]*0.05f+p0[1];
p1[2]=p1[2]*0.05f+p0[2];
f32 normal[3]={0,0,0};
int attribute=2;

rez=NewtonCollisionRayCast(g_newtonmap,p0,p1,normal,&attribute) ;

if(rez<1.2f) { //if collision
test->setPosition(core::vector3df(p0[0],p0[1],p0[2]));
swprintf(text, 255, L"Collision point on terrain %f %f %f %f",rez,p0[0],p0[1],p0[2]);
font->draw(text, core::rect<s32>(30,60,500,80),video::SColor(25,25,25,25));
}
...
digoxy
Posts: 51
Joined: Wed Feb 17, 2010 3:55 pm
Location: Currently Germany.

Post by digoxy »

Did this work through the course, I see the thread is dead however, I would like to ounderstand how your pm worked out. Let me know, I downloaded your source and have gone through it to a degree. Would like to hear more on your project.
Grandma-- / Grandpa --
Post Reply