Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

I'm really new with physics. Maybe someone would be able to help me to solve the next problem: I need to calculate position of an agent on the plane(2D) in next time step where time step is large(20+ seconds) What I know about agent's motion:

  • Initial Position
  • Direction(normalised vector)
  • Velocity(linear function from time ) - object always moves along it's direction
  • Angular Velocity(linear function from time)

Optional:

  • External force direction
  • External force (linear function from time)

Running discreet simulation with t->0 is not an option.

share|improve this question
    
Do you mean to say it has an initial linear velocity and it also has an acceleration in its forward direction? –  Byte56 Jun 16 '12 at 20:24
add comment

2 Answers

up vote 1 down vote accepted

It's a little difficult to figure out what you're trying to do here, so let me start out by rephrasing the question as I interpreted it.

An object has a known initial position and is initially facing a specified direction. It can only move in the direction it is currently facing, but this direction is variable; the object rotates. The rotation is described by an angular velocity which is a linear function of time. The magnitude of the velocity is also a linear function of time. You want to know where the object is after it has flown about for a set period, but you are unable to simulate its motion in timesteps small enough to simply keep track of where it is, how fast it is moving and in what direction at all times.

Since both absolute as angular velocity are linear functions of time, the differential equations describing this motion can be solved analytically, but their solutions are ugly nonetheless, involving a bunch of Fresnel functions:

Mathematical hell

Where (x(t), y(t)) is the object's position as a function of time, b is the angular acceleration, v is the velocity (in x- and y-components), a is the acceleration, also in components, ω is the angular velocity, φ is the angle of rotation and C(x) and S(x) are the Fresnel integrals.

As the result is probably equally disturbing as unhelpful all by itself, I have omitted calculations that lead to it. Unfortunately, no simple approximations are available either. I fear discrete simulation is the only reasonable way of tackling this problem.

share|improve this answer
    
Thank you a lot. Maybe you can recommend some book, or on-line resource about application of differential equations with classic mechanics? –  Rulk Jun 17 '12 at 21:59
add comment

To my knowledge, this is not possible exactly as you want it.

The best you can do it calculate a tight-fitting bounding volume for the rotating object (generally this will end up being a sphere centered on the objects center of mass) and use continuous collision detection on that. You can then approximate when the objects will collide.

At that point, you can then use discrete collision detection and a "binary search" over t values to narrow in on a more precise collision time.

Won't be perfect, but then the limitations of floating point math negate any chance of perfect accuracy anyway.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.