Jump to content

Rahjital

Members
  • Posts

    7
  • Joined

  • Last visited

Reputation

0 Neutral

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Ended up 'solving' this issue by calculating drag force (and from there, drag pressure) independently for each side of the drag cube, and then using the highest of these values. This gives a fairly decent result, but I'm afraid that it will be a fairly hefty computing load for larger vessels. Any help to resolve this properly would still be very much appreciated!
  2. The line concerning areaDrag, correct? How would I go about using it? The result do seem more reasonable, but I'm unsure what the number actually means and how to actually use it. Do I use it instead of area, or replace the pressure calculation with it entirely?
  3. The problem I'm having is that for inline parts, area gets smaller much more quickly than drag, meaning they get disproportionally high pressure compared to other parts. Look at this: a default Osprey modified with the ramjet engine, in level flight: The inline Mk1 fuel tank gets far higher drag than other parts, including the Tail Connector acting as the nosecone. Here's how it looks like when pitching down as much as possible: Pressure is higher for every part... except for the fuel tank, where it dropped because the area got so much bigger. There's no way this can be right. What is it that I'm doing wrong?
  4. Hello, recently I've been trying to calculate aerodynamic stress on vessels in atmosphere for the purpose of damage when the stresses get too great. To that purpose, I've been trying to calculate pressure on each part, for which I need the aerodynamic force and the surface area of the part. Getting the aerodynamic forces wasn't hard, but I'm struggling to get the area. Part.aerodynamicArea is very small for parts in the middle of a vessel (like the fuselage of an aircraft). I've tried using Part.DragCubes.GetCubeAreaDir(Part.DragVector), but it suffers the same problem. I've been trying the same thing for the lift force as well, and I think it may suffer from the same problem, although it wasn't as apparent when testing the mod. Is there anything I can use to calculate the aerodynamic pressure properly?
  5. Got it to work, thank you both! Turns out that apart from having to fix the LookRotation, rotation for landed vessels is relative to the planet's transform, rather than global. The solution ended up being this: Quaternion rotation = Quaternion.Inverse(planet.bodyTransform.rotation) * Quaternion.LookRotation(northAxis, upAxis);
  6. Thanks! I've already tried that, among other things. This is how it looked: Vector3d upAxis = FlightGlobals.getUpAxis(planet, planet.GetWorldSurfacePosition(latitude, longitude, altitude)); Quaternion rotation = Quaternion.LookRotation(upAxis); (FlightGlobals.getUpAxis does exactly what you said, and then normalizes the vector.) And this is the result ingame: I suppose the vector could be somehow manipulated to yield the correct rotation, but I'm at a loss how to do that correctly...
  7. I'm creating a new ship through ProtoVessel.CreateVesselNode. I managed to place it correctly on the ground and got rotation to work properly, which I tested by using data from vessels saved in persistent.sfs. The next step is to get this working for any point on the planet, and that's where I got stuck. No matter how I try, I can't get the ship to point upwards like a proper rocket should. How can I calculate the rotation quaternion to point the ship upwards for any latitude and longitude on a celestial body?
×
×
  • Create New...