So, I have been studying angular velocity and linear velocity--and I want to use this information determine if a ray intersects a plane.

linear velocity = dp/dt

angular velocity = dΘ/dt

thus for linear velocity, you have a point in space: the intersection point could be described as

I = Po + rV

(Po) position initial, (I) position final, (V) linear velocity vector, ® a scalar

then, eloquently you can set it to the plane equation

(Pp) point on plane, (Np) normal of plane

(I - Pp)*Np = 0

I*Np -Pp*Np = 0

by replacing I for the above equation

(Po + rV)*Np -Pp*Np = 0

when worked out you can find r

thus Po plus the velocity vector times a certain scalar will get you the intersection point.

How will this change if you are dealing with angular velocities.

If you guys remember, rotation always stumps me

this guy, in his blog:

http://www.wildbunny.co.uk/blog/2011.../#comment-3697

is talking about adding them together if you have certain info...i tried but I am extremely lost.

Thanks for your time.

**0**

# Linear Velocity and Angular Velocity Point of Intersection

###
#1
Members - Reputation: **160**

Posted 04 April 2014 - 08:43 PM

###
#2
Members - Reputation: **736**

Posted 06 April 2014 - 07:36 AM

Give me a visual..... From your post, I am envisioning some object floating in space at a set velocity with a laser attached to it and you want to see if the laser is intersecting a plane?????

Or are you talking more like a rocket without guidance? Where the rocket spirals uncontrollably and you want to know if it hits a plane?????

Looking at the article, I'm wondering how detailed you want this collision detection? It also looks like it's describing 2D.

###
#3
Members - Reputation: **160**

Posted 07 April 2014 - 06:33 PM

Alright, I have drawn an image. Yes this is for collision detection. What I want to determine is how much an object would rotate before it hits the plane.

All while the vertices(point A, and B) of the rigid body have an angular velocity, and the center of mass is traveling with a linear velocity.

So the image is of a stick thrown with a certain angular velocity, and a certain linear velocity. What is the number of rotations it would take for the object to hit the plane in front of it? Essentially, how big has theta become?

###
#4
Members - Reputation: **736**

Posted 07 April 2014 - 06:50 PM

There may be some elegant mathematical way of coming to the answer, but I don't have it. I would break it down into stages:

-points A&B are at a certain length from the center of mass. They may not be the same distance away (though it appears to be in this instance). The farthest away your object's center can be from the plane is the maximum of the two end points and still be colliding. So Ignore any computations until that radius is reached.

-now each frame, do a collision check with A&B separately until one hits the plane. If you want to get the EXACT point of contact, you will have to half-step it backwards toward the previous frame. Each time testing the point that made contact until it no longer does. This will give you a very close approximation of the solution.

Sorry I couldn't give you an equation to get to the answer.

What is the number of rotations it would take for the object to hit the plane in front of it?

This could be approximated using the first part of the method mentioned above. But it could also be done mathematically by considering the object to be a circle/sphere because any collision that would occur would take place no farther away than the radius and any collision happening within the radius would have to occur within half a revolution......

###
#5
Members - Reputation: **160**

Posted 09 April 2014 - 11:10 AM

Yea, okay--that could work. But, I just had a thought yesterday. Isnt the motion of an object with angular velocity about its center of mass, a spiral. If that could be defined, then what would be the intersection point of a spiral with a plane.

###
#6
Members - Reputation: **736**

Posted 09 April 2014 - 03:15 PM

It depends on its dimensions. If the center mass is in the center of the object, then it will rotate at the center. If the center mass is near one end, then it will be more of a spiral. Figuring out the radius as mentioned above will have to take into account where the center of mass is and the distance of the farthest part on the object from that center. The object could also be in a near parallel rotation in relation to the plane, but that still wouldn't matter except that the number of rotations before it collided would be greater than if the rotation was perpendicular to the plane.

###
#7
Moderators - Reputation: **35057**

Posted 09 April 2014 - 05:52 PM

Do you need it physically accurate, or do you need it good enough for games?

For a game I would give it a collision sphere of about half the length of the stick. When the sphere collides with the plane, you're done. Sphere/plane collision check is quick and easy, and documented all over the web.

Unless this is some very critical aspect of your game, nobody will care. If the stick spins too far and clips through, nobody cares. If the stick only very nearly approaches the wall before hitting, nobody cares.

Now, if your game is something like "Knife Toss Pro", you are going to need a better solution. But unless you truly need it, I wouldn't bother.

/Edit: but if you did need it, for a quick solution I would do a test with a bounding sphere first to see the earliest time it could collide as a broad pass, then switch to in iterative Newtonian-style solver for the fine detail, subdividing until you get close enough for your needs. For a very detailed solution I would visit a mathematics/physics forum dedicated to that kind of problem. My guess is it takes grad-school level mathematics to solve.

**Edited by frob, 09 April 2014 - 05:55 PM.**

Check out my book, Game Development with Unity, aimed at beginners who want to build fun games fast.

Also check out my personal website at bryanwagstaff.com, where I occasionally write about assorted stuff.