Search Unity

[Released] Gravity Engine

Discussion in 'Assets and Asset Store' started by PeterMu, May 24, 2016.

  1. PeterMu

    PeterMu

    Joined:
    Oct 1, 2014
    Posts:
    47
    Always happy to discuss feature requests. Either here or on the support email nbodyphysics.com

    You mention several different length scales (solar, jupiter and earth radii). Would you need a unit system for each one? Currently the GE allows a choice of a single unit system. I can certainly see that solar mass has appeal.

    I can see that more generally it might be useful to select units per OrbitUniversal or NBody and have it convert to the GE selected system. That is a bigger feature.
     
  2. jwvanderbeck

    jwvanderbeck

    Joined:
    Dec 4, 2014
    Posts:
    825
    A lot of what I said was thinking out loud. Part of the (maybe)unique problem I am trying to figure out is how to manage display of stars and planets in a compressed map scale. So for me the radius of a body is measured in a different unit of scale than the distance between bodies.

    I am currently measuring distance between bodies in AU and Masses in Solar Masses.

    The mass is the one giving me the most hassle in GE. It isn't hard but because Ms is 10x30 and GE uses 10x24 I have to adjust everything accordingly.

    So I guess if I was to solidify my feature request it would be a unit system that stores:
    • Mass as Solar Mass
    • Distance as AU
    • Time as .. probably year would be most appropriate though I find this one doesn't matter too much.
     
  3. jwvanderbeck

    jwvanderbeck

    Joined:
    Dec 4, 2014
    Posts:
    825
    BTW do you prefer questions via support email or this thread? I did email you earlier but I don't want to bombard you with questions through email if that isn't what you want :)

    The next problem I am running into now is how to handle multiple independent planetary systems. I thought I could just add one global GravityEngine object and then set each of my systems up with a local star and planets, but GE wants to keep kicking the central star in each system to 0,0,0

    Basically what I have is a map of thousands of stars, each with a planetary system. I want each to be completely independent so one system has no effect on any other.

    For performance reasons my plan was to only "activate" each individual system as the camera got close. In fact the planets wont' even be visible until close. But right now I'm just trying to figure out how to even get the independent systems working.
     
  4. PeterMu

    PeterMu

    Joined:
    Oct 1, 2014
    Posts:
    47
    Thread or email is up to you. Email is often better when sending screenshots/attachments etc. Don't worry about bombarding me.

    Your plan is sound. One GE will handle multiple separate systems.

    If you create multiple stars and set their initial positions in NBody they should stay put and not jump to (0,0,0). [They can also have a FixedBody component attached to ensure they do not drift.] Can you provide more details on your initial configuration?

    As you note,performance becomes an issue with thousands of stars. Adding them only when the camera is near is a good approach.
     
  5. PeterMu

    PeterMu

    Joined:
    Oct 1, 2014
    Posts:
    47
    Ok. I will add a variant of Solar that uses solar masses to the feature backlog.
     
  6. jwvanderbeck

    jwvanderbeck

    Joined:
    Dec 4, 2014
    Posts:
    825
    I think it might have something to do with the order I was adding components. I just went through and did it again by hand and they didn't jump to 0,0,0 this time. So not sure what I did the first time. I think the first time I let Unity add the required components, for example I just added OrbitEllipse or FixedBody directly and let Unity add the NBody so maybe something wonky there. I'll see if I can reproduce it.
     
  7. jwvanderbeck

    jwvanderbeck

    Joined:
    Dec 4, 2014
    Posts:
    825
    Ok apparently my problem or confusion is that GravityEngine is working in global space at all times. So when I create a NBody object as a FixedObject, it gets an initial position of 0,0,0 which I thought was correct because that is the correct LOCAL position of the object, but I need to actually set that to the correct WORLD position. World rotation as well.
     
  8. jwvanderbeck

    jwvanderbeck

    Joined:
    Dec 4, 2014
    Posts:
    825
    How can I tell GE to treat each individual system by itself? In otherwords I don't want the mass in one system affecting anything outside of a given radius.
     
  9. PeterMu

    PeterMu

    Joined:
    Oct 1, 2014
    Posts:
    47
  10. loki-void

    loki-void

    Joined:
    Apr 16, 2013
    Posts:
    11
    Hello Peter. Is there a way to reverse direction in which one body orbiting around another?
     
  11. PeterMu

    PeterMu

    Joined:
    Oct 1, 2014
    Posts:
    47
    Yes.

    If you are using an OrbitUniversal then set the inclination to 180 degrees.