A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: Towing a trailer

  1. #1
    Senior Member barrax's Avatar
    Join Date
    Jun 2000
    Location
    Southampton, UK
    Posts
    113

    Towing a trailer

    Hi

    Wondering if someone can help with the beginnings of my lorry-towing-truck game engine.

    I'm using some inverse kinematic code at the moment - just to calculate the distance and rotations.

    Take a look at the attached swf and pretty soon you'll see what im trying to do. (arrow keys to move)

    Problem is that it looks wierd with the trailer sliding around. Does anyone know of a url/resource/approach i can use to make this look more believable? Like adding in constraints, mass ...or anything! Ive tweaked around some figures but its all been guesswork.

    Cheers,
    B
    Attached Files Attached Files

  2. #2
    Senior Member tonypa's Avatar
    Join Date
    Jul 2001
    Location
    Estonia
    Posts
    8,223
    Looks like you are only using 1 point for the trailer, where it is connected to the car. What you could try is to use 2 points at both ends of the trailer so its end wont turn like mad. So first point keeps distance to the car and second point keeps distance to first point.

  3. #3
    Senior Member barrax's Avatar
    Join Date
    Jun 2000
    Location
    Southampton, UK
    Posts
    113
    of course! - cheers dude. Im sure that'll fix it

  4. #4
    Senior Member barrax's Avatar
    Join Date
    Jun 2000
    Location
    Southampton, UK
    Posts
    113
    Can anyone point me to a decent tute - or perhaps explain how they would approach adding angular restraints. Ive attached the latest version.

    I did hack a version together that looked at the angle of the trailer and the truck.. if the difference was greater than 90 degrees stop turning... but it was a bit primitive.. using +360 and Math.abs if this difference went over 180 degrees..... quite messy. I'm betting theres a much cleaner solution.

    Cheers
    B
    Attached Files Attached Files

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center