manual collosion (part 2)

You are an experienced programmer and have a problem with the engine, shaders, or advanced effects? Here you'll get answers.
No questions about C++ programming or topics which are answered in the tutorials!
Post Reply
hell_bird
Posts: 18
Joined: Mon Nov 03, 2003 12:30 pm

manual collosion (part 2)

Post by hell_bird »

I have some problems with the automatic collosion (again) and want to use manual collosion. for example i stick on the roof of a room while jumping, or some problems while crouching. i cound implement only the jumping part myself, but the problem is: i need the bool isFaling() fuction, but it works only if the automatic gravity is != 0.

I want to know: is there any possibility to use some irrlicht-funktions for collotion but not the animator, that does everything for the user? or do i have to create everything manually?
Boogle
Posts: 162
Joined: Fri Nov 21, 2003 3:16 pm
Location: Toronto, Canada

Post by Boogle »

Well the methods from the CollisionManager should be able to help you out. You can get the CollisionManager through smgr->getCollisionManager(). Then you can check for collisions and respond appropriately each game loop.
Vortex
Posts: 9
Joined: Tue Dec 23, 2003 10:41 pm

Post by Vortex »

Have you found something already ? I'm looking for this too. I want to do a AABB<->Terrain (Triangle Selector) collision.
Regards,

Jeroen
hell_bird
Posts: 18
Joined: Mon Nov 03, 2003 12:30 pm

Post by hell_bird »

no, i think i'll implement it complete myself (hard but interesting job). But you problem is (i think) not as big, because you don't need an ellipsoid-collosion. i think you even don't need an AABB. You can check with

cam=camera->getPosition();

smgr->getCollisionManager()->getCollisionPoint(line3d(vector3df(cam.X,1000,cam.Z),vector3df(cam.X,-1000,cam.Z),sel,tri,point);

on which height the camera shoud be and you can set it with

cam.Y=point.Y;
camera->setPosition(cam);

or didn't i understand your problem?
Vortex
Posts: 9
Joined: Tue Dec 23, 2003 10:41 pm

Post by Vortex »

I'm not very experienced with this, so when I'm wrong you should correct me.

I would like to make a Snowboard game. The player should be mesh and I want to generate an AABB from it.

The camera is a 3rd person camera, so the player mesh should collide with the terrain. Therefore I need AABB<->Terrain collision.
Regards,

Jeroen
Boogle
Posts: 162
Joined: Fri Nov 21, 2003 3:16 pm
Location: Toronto, Canada

Post by Boogle »

Ok, here's what you do: Create your scene node for your snowboarder. Create your terrain. Create an OctTreeTriangleSelector for your terrain. Create a collision repsonse animator (using smgr->createCollisionResponseAnimator()), giving it the triangle selector for your terrain, and your scene node.

Using this method, your snowboarder will also be affected by gravity. The size of gravity is configurable, or a default can be used.
Vortex
Posts: 9
Joined: Tue Dec 23, 2003 10:41 pm

Post by Vortex »

I'm going to try this, but then my snowboarder isn't gliding over the terrain. Am I correct here ?

If I want more control over the response, eg. let the snowboarder fall on the ground, should I do my own collision detection/reaction then ?

I also found that in the TriangleSelector there is a method for collision with an AABB.
Regards,

Jeroen
Boogle
Posts: 162
Joined: Fri Nov 21, 2003 3:16 pm
Location: Toronto, Canada

Post by Boogle »

Well the first issue could be solved by setting gravity to 0 and handling the y-value of your snowboarder yourself. As for the bounding box thing, I haven't had to work with collision detection myself yet so I'm not sure..
Vortex
Posts: 9
Joined: Tue Dec 23, 2003 10:41 pm

Post by Vortex »

I was more thinking about using ODE or Tokamak for this. I've already found some code for a physics SceneNode.

I don't want to write physics code myself. I have already looked at Tokamak and it looks very nice.
Regards,

Jeroen
Boogle
Posts: 162
Joined: Fri Nov 21, 2003 3:16 pm
Location: Toronto, Canada

Post by Boogle »

I will soon be adding to the TokamakSceneNode to add an Inertia Tensor computer and a TokamakJointSceneNode. Just to make things even easier when using Tokamak.
Post Reply