Jump to content

Search the Community

Showing results for tags 'quaternion'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • General
    • Announcements
    • Welcome Aboard
  • Kerbal Space Program 2
    • KSP2 Dev Updates
    • KSP2 Discussion
    • KSP2 Suggestions and Development Discussion
    • Challenges & Mission Ideas
    • The KSP2 Spacecraft Exchange
    • Mission Reports
    • KSP2 Prelaunch Archive
  • Kerbal Space Program 2 Gameplay & Technical Support
    • KSP2 Gameplay Questions and Tutorials
    • KSP2 Technical Support (PC, unmodded installs)
    • KSP2 Technical Support (PC, modded installs)
  • Kerbal Space Program 2 Mods
    • KSP2 Mod Discussions
    • KSP2 Mod Releases
    • KSP2 Mod Development
  • Kerbal Space Program 1
    • KSP1 The Daily Kerbal
    • KSP1 Discussion
    • KSP1 Suggestions & Development Discussion
    • KSP1 Challenges & Mission ideas
    • KSP1 The Spacecraft Exchange
    • KSP1 Mission Reports
    • KSP1 Gameplay and Technical Support
    • KSP1 Mods
    • KSP1 Expansions
  • Community
    • Science & Spaceflight
    • Kerbal Network
    • The Lounge
    • KSP Fan Works
  • International
    • International
  • KerbalEDU
    • KerbalEDU
    • KerbalEDU Website

Categories

  • Developer Articles

Categories

  • KSP2 Release Notes

Categories

There are no results to display.


Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Website URL


Skype


Twitter


About me


Location


Interests

Found 2 results

  1. I've written a mickey-mouse prototype of what might become a true KSP extension. It automates the modification of a quicksave.sfs file to transplant a KSC aircraft on the runway or on the launchpad to the Baikerbanur cosmodrome. Everything is straightforward except for the manipulation of the VESSEL.rot quaternion that expresses the vehicle attitude (presumably in Kerbin's frame of reference). I put the same craft in both places and observed the quaternion values, K and B. Then I wrote code that, for a vessel at KSC with quaternion 'p', performed the computation q = B.(Kinv.p) The idea is to use Kinv to back out the orientation for K and then use B to orient the vehicle for the destination. I am aware that quaternion multiplication is not the same as quaternion rotation. First difficulty is that I found I had to use different numbers for the categories os SPH (horizontal) and VAB (vertical) craft and I suspect flags fall into their own category as well. I thought I had cracked the code but the last teleport attempt was of a Screechcraft Starship and it arrived at Baikerbanur in a devilish twist. All of this is (necessarily) outside of Unity for the moment, but I wondered if any sage advice might be proferred? I've had half a shot at writing a real r.q.rinv rotation but it does not look promising. Another way of looking at this would be to find a rotation that is equivalent to rotating from KSC to Baikerbanur. Both have known coordinates, e.g.: KSC: lat = -0.097168916153244286 lon = -74.557681735503166 BKB: lat = 20.652140227285638 lon = -146.42383127125942 Any thoughts about this would be appreciated.
  2. I'm getting a weird thing where the *compiler* claims a method exists that at *runtime* it throws an exception on and says it does not exist. It's this: System.MissingMethodException: Cannot find the requested method. at (wrapper managed-to-native) UnityEngine.QuaternionD:INTERNAL_CALL_LookRotation (Vector3d&,Vector3d&) at UnityEngine.QuaternionD.LookRotation (Vector3d forward, Vector3d upwards) [0x00000] in <filename unknown>:0 at kOS.Function.FunctionHeading.Execute (kOS.SharedObjects shared) [0x00000] in <filename unknown>:0 at kOS.Function.FunctionBase.Execute (kOS.Safe.SafeSharedObjects shared) [0x00000] in <filename unknown>:0 at kOS.Safe.Function.FunctionManager.CallFunction (System.String functionName) [0x00000] in <filename unknown>:0 at kOS.Safe.Execution.CPU.CallBuiltinFunction (System.String functionName) [0x00000] in <filename unknown>:0 at kOS.Safe.Compilation.OpcodeCall.StaticExecute (ICpu cpu, Boolean direct, System.Object destination, Boolean calledFromKOSDelegateCall) [0x00000] in <filename unknown>:0 at kOS.Safe.Compilation.OpcodeCall.Execute (ICpu cpu) [0x00000] in <filename unknown>:0 at kOS.Safe.Execution.CPU.ExecuteInstruction (IProgramContext context, Boolean doProfiling) [0x00000] in <filename unknown>:0 According to the compiler, UnityEngine.QuaternionD.LookRotation emphatically does exist, with those exact arguments. But at runtime it does not. I'm not sure what "INTERNAL_CALL" means, but I'm guessing it means "this isn't implemented in the normal C# way" or something like that. (i.e. maybe it's dropping down into some other language for that part, or doing something implemented in raw machine language instead of in the MSIL's opcodes?) This came about because I was trying to replace all our Quaternion usages with QuaternionD's because when working with large vectors (i.e. the distance from Kerbin to Duna, for example), the 32-bit precision of Quaternion's was beginning to multiply into rather big errors after several operations of using them to rotate those big vectors. But it looks like not everything that was implemented for Quaternion got re-implemented for QuaterionD''s. Am I going to have to resort to running my own matrix multiplications to perform rotations or is there some other solution to this?
×
×
  • Create New...