A Flash Developer Resource Site

Page 3 of 3 FirstFirst 123
Results 41 to 45 of 45

Thread: [disc] elastomania,or: how to do cool vehicle physics

  1. #41
    Senior Member
    Join Date
    Jul 2004
    Posts
    153
    hey,
    i'm too busy for a real discussion ;(

    if you want to let the user rotate the whole bike, one way to do is would be to displace the two main bike particles, and/or displace all of the bike particles. (i don't know which would work best).

    the direction of displacement would be perpendicular to the main bike axis. so, once you have the main axis as a unit vector ax,ay, displace the two axis particles perpendicular to the main axis. if the two axis particles are pa and pb:

    pa.x += amt*ay;
    pa.y += amt*-ax;

    pb.x -= amt*ay;
    pb.y -= amt*-ax;

    where amt is the amount of spin.
    note that moving the particles perp. to their axis will violate the stick constraint between them.. so don't move them by much.

    sorry if this explanation sucks, i'm in a hurry
    raigan

  2. #42
    Senior Member
    Join Date
    Mar 2004
    Posts
    137
    yeah.. i finally able to add the rotation, altough i need a few parameters such as rotation lock cause I don't think one can easily rotate a vehicle
    I'm trying to get the angular velocity of the particle that way I can rotate the vehicle more realistic.

    anyway.. I notice in your particle system is that when the vehicle hit's the ground so hard, the system will break resulting the particle to be displaced, is there a way to make it more rigid ??
    Motorama, riding can be tough in deed !
    www.motoramagame.com
    Fun web games for all !!!
    www.iplayallday.com

  3. #43
    Professional Air Guitarist Frag's Avatar
    Join Date
    Dec 2002
    Location
    Brain, Body, Clothes, Computer Chair, Room, House, Neighborhood, City, State, Country, Continent, World, Galaxy, Universe, and on?
    Posts
    811
    Low gravity + low friction = high flying

    http://www.gotcool.com/misc/bike.swf

  4. #44
    Member
    Join Date
    Apr 2004
    Posts
    94
    This stuff is really neat.
    Frag: do you mind posting the .fla?
    Smartfox server! The cheap way to make multiplayer games!

  5. #45
    Senior Member
    Join Date
    Mar 2004
    Posts
    137
    Finally after messing around with the code I can make my own..
    try : www.iplayallday.com/test/biketest.html
    Motorama, riding can be tough in deed !
    www.motoramagame.com
    Fun web games for all !!!
    www.iplayallday.com

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