get point of Collision

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
Jan_

get point of Collision

Post by Jan_ »

Hiho

I need a little help,

how can i get x,y,z Coords from an collision?

hope that it is posible.
Ababala

Post by Ababala »

Have you tried to look at the colision example?
Guest

Post by Guest »

yep,

there i found only, what mesh(Scene) have a Collision, not where the Kollision is.
I want the find out, the exact X,Y,Z Cordinaten of the Collision.
Jan_

Post by Jan_ »

Sorry 4 Double post,

I make a Line Collision with 2D coords.
and want the point of the Collision back, but @ time i only get the Mesh.
Spintz
Posts: 1688
Joined: Thu Nov 04, 2004 3:25 pm

Post by Spintz »

look at the CSceneCollisionManager, specifically the getCollisionPoint function. You should need no more information that that! :P
Image
puh
Posts: 356
Joined: Tue Aug 26, 2003 3:53 pm

Post by puh »

Jan_, you did not look at the irrlicht-0.12.0\examples\07.Collision as i see, because there is an example of the collision POINT!
Just look at the main.cpp what mean core::vector3df intersection.
Jan_
Posts: 16
Joined: Wed Sep 28, 2005 11:39 am
Location: Germany, Chemnitz, Bgst.

Post by Jan_ »

Outsch,

I found the command i searched,
GetRayFromScreenCoordinates ...
Many thanks 4 help.
Spintz
Posts: 1688
Joined: Thu Nov 04, 2004 3:25 pm

Post by Spintz »

No, no, no.

That function gives you a point where a line intersects the screen. For a random line, use getCollisionPoint!
Image
Jan_
Posts: 16
Joined: Wed Sep 28, 2005 11:39 am
Location: Germany, Chemnitz, Bgst.

Post by Jan_ »

Yep, that was, what i wanted

But i think with my bad english 1 can't tell you that right

my code now:

Code: Select all

If (smgr.getSceneCollisionManager().getCollisionPoint(
smgr.getscenecollisionmanager().getRayFromScreenCoordinates (T_irrPosition2d_s32.create(10,10)
), selector, intersection, tri))
(Attentione, it is not in C++ Syntax)

Hm, it is very Slow, it need upto 4 ms on my Laptop(3Ghz, 512 mb Ram & Gf440go)
Post Reply