This file contains hidden or 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
# This file has been auto-generated by i3-config-wizard(1). | |
# It will not be overwritten, so edit it as you like. | |
# | |
# Should you change your keyboard layout some time, delete | |
# this file and re-run i3-config-wizard(1). | |
# | |
# i3 config file (v4) | |
# | |
# Please see https://i3wm.org/docs/userguide.html for a complete reference! |
This file contains hidden or 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 StaticArrays | |
mutable struct CAcceleration | |
a::SVector{2, Float32} | |
end | |
mutable struct CPosition | |
p::SVector{2, Float32} | |
end |
This file contains hidden or 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
acpi | perl -ne '$_=~m/(\\d+)(?=%)/;print "$1"' |
This file contains hidden or 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
sf::Vector2f put_point_on_line(sf::Vector2f point, sf::Vector2f line_point0, sf::Vector2f line_point1) | |
{ | |
const sf::Vector2f line_seg{line_point1 - line_point0}; | |
return line_point1 + unitV(line_seg) * dot(unitV(line_seg), point - line_point1); | |
} |
This file contains hidden or 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
sf::Vector2f put_point_on_line(sf::Vector2f point, sf::Vector2f line_point0, sf::Vector2f line_point1) | |
{ | |
const double new_point_x | |
{ | |
( | |
point.x * std::pow(line_point0.x - line_point1.x, 2) | |
+ | |
( | |
point.y * (line_point0.x - line_point1.x) | |
- line_point0.x * line_point1.y |
This file contains hidden or 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
#include <SFML/Graphics.hpp> | |
#include <cassert> | |
#include <array> | |
#include <algorithm> | |
// #define CATCH_CONFIG_MAIN | |
// #include <catch.hpp> | |
void draw_lines(const std::vector<sf::Vector2f>& vector_, sf::RenderTarget& target_, sf::Color color_ = sf::Color::White) | |
{ | |
for (auto it{vector_.cbegin()}; it != vector_.cend();) |
This file contains hidden or 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
#include <SFML/Graphics.hpp> | |
// #define CATCH_CONFIG_MAIN | |
// #include <catch.hpp> | |
void draw_lines(const std::vector<sf::Vector2f>& vector, sf::RenderWindow& window, sf::Color color = sf::Color::White) | |
{ | |
for (auto it{vector.cbegin()}; it != vector.cend();) | |
{ | |
auto current_it{it}; | |
if (++it != vector.cend()) |
This file contains hidden or 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
// Most credit to @fallahn | |
#version 120 | |
uniform sampler2D tex1; | |
uniform sampler2D tex2; | |
uniform sampler2D maskTex; | |
void main() | |
{ |
This file contains hidden or 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
#include <SFML/Graphics.hpp> | |
#include <stdio.h> | |
#include <set> | |
#include <vector> | |
#include <math.h> | |
#include <assert.h> | |
const sf::Vector2u window_size{1280, 720}; | |
sf::CircleShape player{20.f}; |
This file contains hidden or 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
sf::Event event; | |
while (window.pollEvent(event)) | |
{ | |
using k = sf::Keyboard; | |
using e = sf::Event; | |
auto kc = event.key.code; | |
auto et = event.type; | |
auto kp = e::KeyPressed; | |
//DIREKTER VERGLEICH///////////////////////////////////////////////// |