This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static DVec.Vector2[] EllipseFullMtxSweep(double semiMaj, double eccentricity, double tilt, double start, | |
double sweep, int numPoints) | |
{ | |
//convert ellipse angles to circle angles. | |
double b = semiMaj * Math.Sqrt(1 - eccentricity * eccentricity); | |
start = Math.Atan(semiMaj / b * Math.Tan(start)); | |
sweep = Math.Atan(semiMaj / b * Math.Tan(sweep)); | |
double end = start + sweep; | |
double Δθ = 2 * Math.PI / (numPoints - 1) * Math.Sign(sweep); //arc increment for a whole circle |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//taken from: https://doi.org/10.1093/comjnl/14.1.81 | |
public static (int x, int y)[] EllipseArrayFromPaper(double semiMaj, double semiMin, double tilt, int numPoints) | |
{ | |
(int x, int y)[] points = new (int x, int y)[numPoints]; | |
var n = numPoints; | |
var a = semiMaj; | |
var b = semiMin; | |
var xc = 0; //this is the center position of the ellipse; | |
var yc = 0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
namespace Pulsar4X.Orbital | |
{ | |
public class Matrix2d | |
{ | |
double[] X = new double[3] { 1, 0, 0 }; | |
double[] Y = new double[3] { 0, 1, 0}; | |
double[] Z = new double[3] {0, 0, 1}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
unsafe | |
{ | |
string rf = "Resources"; | |
ImFontConfig* rawPtr = ImGuiNative.ImFontConfig_ImFontConfig(); | |
ImFontConfigPtr config = new ImFontConfigPtr(rawPtr); | |
config.PixelSnapH = true; | |
config.MergeMode = true; | |
ImFontAtlasPtr fontAtlas = ImGui.GetIO().Fonts; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static bool Switch2State(string label, ref bool state, string leftState = "Off", string rightState = "On") | |
{ | |
int intState = Convert.ToInt32(state); | |
string strstate = leftState; | |
if (state == true) | |
strstate = rightState; | |
var txtWid = Math.Max(ImGui.CalcTextSize(leftState).X, ImGui.CalcTextSize(rightState).X); | |
ImGui.PushItemWidth(txtWid * 3); | |
var cpos = ImGui.GetCursorPos(); | |
if(ImGui.SliderInt(label,ref intState, 0, 1, "" )) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static class SizesDemo | |
{ | |
enum FrameOfReference : byte | |
{ | |
Screen, | |
Window, | |
} | |
static ImDrawListPtr _wdl = ImGui.GetForegroundDrawList(); | |
static Vector2 _windowPos = new Vector2(); | |
static UInt32 _lineColour = ImGui.GetColorU32(new Vector4(1, 0, 0, 1)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private int _bloSelectedIndex = -1; | |
void BorderListOptionsWiget() | |
{ | |
string[] items = new string[_listfoo.Count]; | |
for (int i = 0; i < _listfoo.Count; i++) | |
{ | |
items[i] = _listfoo[i].name; | |
} | |
BorderGroup.Begin("Border List Options: "); | |
BorderListOptions.Begin("blo", items, ref _bloSelectedIndex, 64); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static class BorderListOptions | |
{ | |
private static Vector2 _labelSize = new Vector2(); | |
private static float _xleft; | |
private static float _xcentr; | |
private static float _xright; | |
private static float _ytop; | |
private static float _yctr1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
====================== | |
Proton: 1586972103 proton-5.0-6 | |
SteamGameId: 14948375713730789376 | |
Command: ['/mnt/98448323-4372-4c8a-904a-30b587cc3685/Games/Aurora/Aurora.exe', '--wine'] | |
Options: {'forcelgadd'} | |
====================== | |
ERROR: ld.so: object '/home/se5a/.steam/ubuntu12_32/gameoverlayrenderer.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored. | |
ERROR: ld.so: object '/home/se5a/.steam/ubuntu12_64/gameoverlayrenderer.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS64): ignored. | |
ERROR: ld.so: object '/home/se5a/.steam/ubuntu12_64/gameoverlayrenderer.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS64): ignored. | |
ERROR: ld.so: object '/home/se5a/.steam/ubuntu12_32/gameoverlayrenderer.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class BorderGroup | |
{ | |
private static Vector2[] _startPos = new Vector2[8]; | |
private static Vector2[] _labelSize = new Vector2[8]; | |
private static uint[] _colour = new uint[8]; | |
private static byte _nestIndex = 0; | |
private static float _dentMulitpier = 3; | |
public static void BeginBorder(string label, uint colour) | |
{ | |
ImGui.PushID(label); |
NewerOlder