karth42 / simplekeplerorbits Goto Github PK
View Code? Open in Web Editor NEWUnity3d static 2-body orbits simulation
License: MIT License
Unity3d static 2-body orbits simulation
License: MIT License
Is there a way to apply forces to a body without using Rigidbody? When I add a Rigidbody, the SimpleKeplerOrbits components seem to stop working, but I don't know of any other way to apply the equivalent of thrust. My use case is a semi-realistic docking simulator, where your thruster firings change your orbit slightly.
I'm porting this library to Unity mathematics, and I found this line of code. There, the instance variable "periapsis" is shadowed by the local one; I wonder if this is intentional because periapsis is subsequently never written in this execution path.
Hello. i'm currently working on a game like KSP. so i want to calculate prograde/retrograde value.
i tried velocityHandle.transform.position += velocityHandle.transform.right but it is not perfect solution.
anyone help me?
Thank you for making such a great tool!
I'm trying to use this to create "spheres of influence" to fake n-body gravity as discussed in this talk by the kerbal developers. Basically I want to check an orbit after it's created to see if it enters another body's sphere of influence by looking at different points along the orbit, & comparing the distance between where the orbiter will be & where each sphere of influence will be. However I hit a snag when trying to plug a time value into the OrbitMover.
My first approach was to try plugging in different deltaTime values into OrbitData.UpdateOrbitDataByTime in order to step forward through time, then give it a negative value at the end to "reset". However I hit some unpredictable results & am not sure what's causing it- it seems correct at first but the accuracy degrades over time (or possibly depending on which part of the orbit is being sampled). I think maybe the issue is with adding negative deltaTime values?
Is there a way to sample position of an OrbitMover at (Time.time = 100 etc) instead of incrementing the system each frame? And/ or is there a way to sample the orbit mover's position by percentage?
Thanks🌼
I don't see planet rotation functionality in this project. It seems that the velocity handle transform must be a child of the orbiting body to work correctly. When rotating the planet it also rotates the velocity handle and causes the orbit to change wildly. Is there a solution to this somewhere already in the project?
1.Object at stationery position or with zero velocity should be attracted towards the centre of attracter .but this does not happen.
2.Also body mass did not effect orbit ,only attracter mass count for gravity.
3.please add the rigid body velocity insted of empty distance from parent.
Although your work is awesome and thanks for Sharing.
I'm trying to write an extension to this asset which allows you to use rigid body collisions (say between spacecraft or spacecraft and planets) but I keep running into hurdles that I cannot understand. How do you suggest I go about doing this?
I have downloaded and opened in visual studio. 2017. What item do i set as startup. Visual studio is requiring i set a startup item. Thanks Mark
Length*
Exception got:
ArithmeticException: Function does not accept floating point Not-a-Number values.
System.Math.Sign (System.Double value) (at <a8ed250850854b439cedc18931a314fe>:0)
SimpleKeplerOrbits.KeplerOrbitUtils.ConvertTrueToEccentricAnomaly (System.Double trueAnomaly, System.Double eccentricity) (at Assets/SimpleKeplerOrbits/Scripts/Utils/KeplerOrbitUtils.cs:340)
SimpleKeplerOrbits.KeplerOrbitData.GetCentralPositionAtTrueAnomaly (System.Double trueAnomaly) (at Assets/SimpleKeplerOrbits/Scripts/Data/KeplerOrbitData.cs:427)
SimpleKeplerOrbits.KeplerOrbitData.GetFocalPositionAtTrueAnomaly (System.Double trueAnomaly) (at Assets/SimpleKeplerOrbits/Scripts/Data/KeplerOrbitData.cs:464)
SimpleKeplerOrbits.KeplerOrbitData.GetOrbitPointsNoAlloc (UnityEngine.Vector3[]& orbitPoints, System.Int32 pointsCount, UnityEngine.Vector3 origin, System.Single maxDistance) (at Assets/SimpleKeplerOrbits/Scripts/Data/KeplerOrbitData.cs:650)
SimpleKeplerOrbits.KeplerOrbitLineDisplay.ShowOrbit () (at Assets/SimpleKeplerOrbits/Scripts/Components/KeplerOrbitLineDisplay.cs:144)
SimpleKeplerOrbits.KeplerOrbitLineDisplay.OnDrawGizmos () (at Assets/SimpleKeplerOrbits/Scripts/Components/KeplerOrbitLineDisplay.cs:88)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)
Got error:
transform.position assign attempt for 'Planet01' is not valid. Input position is { NaN, NaN, NaN }.
UnityEngine.Transform:set_position(Vector3)
SimpleKeplerOrbits.KeplerOrbitMover:ForceUpdateViewFromInternalState() (at Assets/SimpleKeplerOrbits/Scripts/Components/KeplerOrbitMover.cs:222)
SimpleKeplerOrbits.<OrbitUpdateLoop>d__13:MoveNext() (at Assets/SimpleKeplerOrbits/Scripts/Components/KeplerOrbitMover.cs:188)
UnityEngine.MonoBehaviour:StartCoroutine(IEnumerator)
SimpleKeplerOrbits.KeplerOrbitMover:OnEnable() (at Assets/SimpleKeplerOrbits/Scripts/Components/KeplerOrbitMover.cs:90)
Unity Version 2019.2.0f1
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.