User Tag List

Results 1 to 2 of 2

Thread: Multiple Forces on an Object?

  1. #1
    Clicker Fusion 2.5 (Steam)

    Join Date
    May 2015
    Posts
    14
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Multiple Forces on an Object?

    I'm trying to make a planet simulator and I'm having some trouble. It works fine with two planets, but when I add a third planet, problems arise. Each planet is only attracted to one other planet. I'm pretty sure it's because of forces being overwritten, because when I move the order to the Always events around, they behave differently.

    Is there any way to combine multiple forces exerted on an object?

    gravity.mfa

    Just ignore the second frame (which is named Frame 1 because it was originally the first frame)

  2. #2
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export Module
    Fusion 2.5 (Steam)
    schrodinger's Avatar
    Join Date
    Nov 2014
    Posts
    3,159
    Mentioned
    28 Post(s)
    Tagged
    1 Thread(s)
    I've still much to learn upon the physics engine,
    so keep eyes open and expect better replies (hopefully involving multiple forces )

    ... but at first glance I'm doubtful about the possibility to apply more than one force at the same time to a single object.

    I think you'll have to make your own calculations and apply each object the resultant force.

    Here's an idea:

    give each planet its own force value in alterable value A (let's call it "my_gravity")
    apply a qualifier to all of your planets for being able to reference them in just one action
    launch a nested foreach loop for the qualifier, like:

    1) always
    ---> set global value B (let's call it "total_force") to 0
    ---> set global value C (let's call it "resultant_angle") to 0
    ---> start loop foreach planet, name "set planet"
    ---> apply force "total_force" to planet, at angle "resultant_angle"/"total_force"

    2) on loop "set planet"
    ---> set global value A to "fixed ID planet" (this is for storing current planet being calculated)
    ---> set global value D, E to x,y position of planet
    ---> start loop foreach planet, name "calculate force"

    3) on loop "calculate force"
    +fixed id of "planet" <> global value A
    ---> set "total_force" to "total_force" + (my_gravity "planet" / Odistance ("planet", Global value D, Global value E))
    ---> set "resultant_angle" to "resultant_angle" + (OAngle ("planet", Global value D, Global value E)* (my_gravity "planet" / Odistance ("planet", Global value D, Global value E)))
    (this will sum all forces of planets and weighted angles)

    Well.. I'm not so sure about the resultant angle thing, if it's vectorially correct "weighting" angles like this
    You may know better about that, if you're into this kind of maths/sciences.
    (Otherwise this may imply splitting into x_y components for multiplying sin/cos values, and revert to back at end to re-calculate the angle....)

    Not so straightforward, I'd say
    But doable... I guess

Similar Threads

  1. Object order problem with multiple instances of the same object
    By tom79 in forum Multimedia Fusion 2 - Technical Support
    Replies: 14
    Last Post: 1st November 2011, 06:38 PM
  2. B 250 App forces Win to change its colour scheme
    By Tiles in forum Multimedia Fusion 2 - Technical Support
    Replies: 1
    Last Post: 18th December 2010, 11:13 AM
  3. Multiple object movement
    By izac in forum File Archive
    Replies: 1
    Last Post: 25th January 2009, 03:21 PM
  4. New guy - Multiple Object problems
    By Blue66 in forum Multimedia Fusion 2 - Technical Support
    Replies: 3
    Last Post: 26th January 2008, 01:49 AM

Posting Permissions

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