hmm, so in pseudo code:
I get what you're saying, but i'm still a little shaky on implementation.Code:getcurrentpos(); gettimebetweencurrentposandthecollisionpoint(); if(raydosn'tend) keepgoing(); else collide();
-psychopath
hmm, so in pseudo code:
I get what you're saying, but i'm still a little shaky on implementation.Code:getcurrentpos(); gettimebetweencurrentposandthecollisionpoint(); if(raydosn'tend) keepgoing(); else collide();
-psychopath
M.Eng Computer Engineering CandidateB.Sc Computer Science
Robotics and graphics enthusiast.
How do you make a ray without two points? Also, using a ray would be inappropriate since it sounds like there is a defined amount of displacement with these objects psycopath is using. But that's just being nit picky, the same math would be applied in either situation for the most part. The line segment will have to have a few more checks.Interpolating to find a point of intersection is not what I would do. There are several ways to go about this but the simple ray to triangle intersection test will do the trick nicely
The concept of how to do this isn't *that* hard to comprehend and implementing it is only a bit harder. Personally, I'd just ignore bubba because he often doesn't make sense. He knows what he's talking about, I'll give him that, just nobody else does.
In psuedocode, if you're colliding against polygons:
-Set a 'closest time' or 'smallest fration' variable to 1.0f, this will be your closest time of intersection.
-For every polygon, find the time where the movement (defined by a start point and end point) intersects the polygon's plane, store the time of intersection (which will be a number between 0 and 1). If the time of intersection is not smaller than the 'closest time'/'smallest fraction' variable, continue to the next polygon, else:
-If the movement intersects the plane, determine if the point of intersection
-Determine if the point of intersection lays inside the triangle
-Store the time of intersection in your closest time variable
I outlined the math for every step of this, including how to find the point where a ray defined by two vectors intersects a plane and if that point lays inside the region of a triangle. I will repost it here ifyou want.
I'm not immature, I'm refined in the opposite direction.
I think I'll just pretend that someone with just over 90 posts did not just flame another member with just over 2900. Yep, I think I'm just gonna act like I didn't read that.I'd just ignore bubba because he often doesn't make sense. He knows what he's talking about, I'll give him that, just nobody else does.
hmm, ok, I think I have enough information to get this to work. i'll post again if I have any more trouble.
>>He knows what he's talking about, I'll give him that, just nobody else does.<<
mm, no actually, its just you that can't seem comprehend bubbas posts
-psychopath
M.Eng Computer Engineering CandidateB.Sc Computer Science
Robotics and graphics enthusiast.