How to do a collision test - urgent please?

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.
prchakal
Posts: 58
Joined: Thu Sep 24, 2009 12:31 am

How to do a collision test - urgent please?

Post by prchakal »

Hi,

Im new on IrrLicht and i read all the tutorials and examples, but i dont understand how i can check/test the colission between the map and the player(mesh), can anyone explain based on my code below:

Code: Select all

//map load
device->getFileSystem()->addZipFileArchive("./dados/mapas/mapa1.pk3");
IAnimatedMesh *map = smgr->getMesh("20kdm2.bsp");
ISceneNode *map_node = smgr->addOctTreeSceneNode(map->getMesh(0));

map_node->setPosition(vector3df(0,0,0));

//player load
//carrega modelo
IAnimatedMesh* mesh = smgr->getMesh("./dados/modelos/knight.md2");

//adiciona node com o modelo na cena
IAnimatedMeshSceneNode* jogador = smgr->addAnimatedMeshSceneNode( mesh );

//define propriedades do modelo
if (jogador)
{
    jogador->setPosition(core::vector3df(0,185.0f,0));
    jogador->setMaterialFlag(EMF_LIGHTING, false);
    jogador->setMaterialTexture( 0, driver->getTexture("./dados/modelos/knight.pcx") );
    jogador->setRotation(core::vector3df(0,0,0));
}

And my other question is, how i can hold my player(mesh) on the map floor without use physic library?
Virion
Competition winner
Posts: 2149
Joined: Mon Dec 18, 2006 5:04 am

Post by Virion »

My company: https://kloena.com
My profile: https://zhieng.com
My co-working space: https://deskspace.info
My game engine: https://kemena3d.com
prchakal
Posts: 58
Joined: Thu Sep 24, 2009 12:31 am

Post by prchakal »

OMG! As i say, im already read, but dont understand.
i read all the tutorials and examples
And the tutorial dont explain with my situation.

If i post here is because i dont understand.

Can anyone explain the collision on my situation?
Virion
Competition winner
Posts: 2149
Joined: Mon Dec 18, 2006 5:04 am

Post by Virion »

prchakal wrote:OMG! As i say, im already read, but dont understand.
i read all the tutorials and examples
And the tutorial dont explain with my situation.

If i post here is because i dont understand.

Can anyone explain the collision on my situation?
then you should study C++ first.
My company: https://kloena.com
My profile: https://zhieng.com
My co-working space: https://deskspace.info
My game engine: https://kemena3d.com
prchakal
Posts: 58
Joined: Thu Sep 24, 2009 12:31 am

Post by prchakal »

Again o.o

I know C++ but i dont understand the collison method :)

Thanks for help.
Virion
Competition winner
Posts: 2149
Joined: Mon Dec 18, 2006 5:04 am

Post by Virion »

prchakal wrote:Again o.o

I know C++ but i dont understand the collison method :)

Thanks for help.
shoot a ray from your model downwards and check if it's intersect with a triangle. it's all explained in the tutorial page. if you really understand then you should be able to udnerstand the tutorial as well. descriptions and even the sample codes are there. what else you want. :roll:
My company: https://kloena.com
My profile: https://zhieng.com
My co-working space: https://deskspace.info
My game engine: https://kemena3d.com
Virion
Competition winner
Posts: 2149
Joined: Mon Dec 18, 2006 5:04 am

Post by Virion »

My company: https://kloena.com
My profile: https://zhieng.com
My co-working space: https://deskspace.info
My game engine: https://kemena3d.com
prchakal
Posts: 58
Joined: Thu Sep 24, 2009 12:31 am

Post by prchakal »

Im done it, not hard.

I always listen about the community of Irrlicht that help everyone, but i think that it is a lie.

But thanks, God bless you!
prchakal
Posts: 58
Joined: Thu Sep 24, 2009 12:31 am

Post by prchakal »

Do you know any website that i can download mapa ms3d/3ds for free?

Plain map to do tests with grass texture, because im horrible to model and my map is small and without texture :(

Like this: http://www.turbosquid.com/3d-models/3d- ... ene/418481
Virion
Competition winner
Posts: 2149
Joined: Mon Dec 18, 2006 5:04 am

Post by Virion »

prchakal wrote:Im done it, not hard.

I always listen about the community of Irrlicht that help everyone, but i think that it is a lie.
people kept posting the same questions and we kept answering it over and over again. you have to learn to search on the forum there are tons of answers in the older topics.
My company: https://kloena.com
My profile: https://zhieng.com
My co-working space: https://deskspace.info
My game engine: https://kemena3d.com
prchakal
Posts: 58
Joined: Thu Sep 24, 2009 12:31 am

Post by prchakal »

Hi, i dont know why, but the player(mesh) is a little far from the floor, what i can do to it stay/walk more near possible from the floor?

The gravity is normal and the player is walking normal, but a little far from the floor.
Virion
Competition winner
Posts: 2149
Joined: Mon Dec 18, 2006 5:04 am

Post by Virion »

prchakal wrote:Hi, i dont know why, but the player(mesh) is a little far from the floor, what i can do to it stay/walk more near possible from the floor?

The gravity is normal and the player is walking normal, but a little far from the floor.
change the radius of the ellipsoid in your createCollisionResponseAnimator() (again, it's covered in the collision tutorial)
My company: https://kloena.com
My profile: https://zhieng.com
My co-working space: https://deskspace.info
My game engine: https://kemena3d.com
prchakal
Posts: 58
Joined: Thu Sep 24, 2009 12:31 am

Post by prchakal »

Hi,

Thanks, but the problem is not this, i change like the tutorial explain, but nothing happen, so i change the map and the problem is solved, i think that is my map that i take on the net.

You can see here:

http://www.prsolucoes.com/blog/projetos ... -versao-2/
yamashi
Posts: 82
Joined: Sat Jan 03, 2009 4:53 am

Post by yamashi »

First of all, we are not here to do your "homework" but to help if you have problems.
Now, you give us a link in some foreign language that most of us can't even understand, you don't even show your code or anything...
How are we supposed to help you ?
I always listen about the community of Irrlicht that help everyone, but i think that it is a lie.
And now you expect help ?
Bear_130278
Posts: 237
Joined: Mon Jan 16, 2006 1:18 pm
Location: Odessa,Russian Federation

Post by Bear_130278 »

Just LOL.....
Жжошь сцуко....


Virion..., you should be a padre.... to have such enormous patience ...
Respect..
Do you like VODKA???
Image
Image
Post Reply