Friday, April 11, 2008

So This is My Life...

float SweepCircleToLine(struct Vec2 *pCtr, float radius, struct Vec2 *pVel, struct Vec2 *pPnt, struct Vec2 *pDirection)
{
Vec2 normal;
normal.x = pDirection->y;
normal.y = -pDirection->x;

Vec2Normalize(&normal, &normal);

float dot = Vec2DotProduct(&normal, pPnt) - radius;

float time = 0.0f;
time = dot - Vec2DotProduct(&normal, pCtr);
time = time / Vec2DotProduct(&normal, pVel);

return time;
}

2 comments:

Jake said...

Homework.

Not talkative tonight.

Better luck tomorrow?

Anonymous said...

I'm a little worried about you. The "tone" of you las couple of entries has been very sad. Here's a virtual hug XXXX
Love,
Mom