An entity is just a number.
There is a graph of components, indexed by the entity id.
All state is stored in one place.
var components = { Position: {}, Velocity:{}, Spite: {}, Timer: {}, ScreenShake: {}, RemoveComponents: {} }
// Tests each segment for a hit. All calculations are done in screen space pixel coordinates | |
bool CollisionPath::hitTest(const ViewportPosition &selection_position) const | |
{ | |
const Vector2 &mouse_pixel_pos = selection_position.getPixelPosition(); | |
const Viewport &viewport = selection_position.getViewport(); | |
const Camera &camera = viewport.getCamera(); | |
const WorldLayer &layer = *getLayer(); | |
for(auto iter = anchors.begin(); iter != anchors.end()-1; ++iter) { | |
const Vector2 &segment_begin = |
// Fast SSE pow for range [0, 1] | |
// Adapted from C. Schlick with one more iteration each for exp(x) and ln(x) | |
// 8 muls, 5 adds, 1 rcp | |
inline __m128 _mm_fastpow_0_1_ps(__m128 x, __m128 y) | |
{ | |
static const __m128 fourOne = _mm_set1_ps(1.0f); | |
static const __m128 fourHalf = _mm_set1_ps(0.5f); | |
__m128 a = _mm_sub_ps(fourOne, y); | |
__m128 b = _mm_sub_ps(x, fourOne); |
#version 330 core | |
#extension GL_ARB_shading_language_420pack: require | |
#extension GL_ARB_separate_shader_objects: require | |
#extension GL_ARB_shader_image_load_store: require | |
#extension GL_ARB_bindless_texture: require | |
#define ENABLE_BINDLESS_TEX | |
#define FRAGMENT_SHADER 1 | |
#define ps_main main | |
#define PS_FST 0 | |
#define PS_WMS 0 |
-- download.lua by Michael Weingarden May 2014 | |
local dropbox = require("dropboxModule") | |
local widget = require( "widget" ) | |
-- Load the relevant LuaSocket modules (no additional files required for these) | |
local http = require("socket.http") | |
local ltn12 = require("ltn12") | |
_H = display.contentHeight |
-- download.lua by Michael Weingarden May 2014 | |
local dropbox = require("dropboxModule") | |
local widget = require( "widget" ) | |
-- Load the relevant LuaSocket modules (no additional files required for these) | |
local http = require("socket.http") | |
local ltn12 = require("ltn12") | |
_H = display.contentHeight |
/* | |
* =========================================================================== | |
* | |
* Filename: sort.cpp | |
* Author: Dodon Victor, dodonvictor AT gmail DOT com | |
* Created: 11/22/2012 04:32:15 PM | |
* Editor: Vim 7.3 | |
* Compiler: clang 3.2 | |
* OS: Archlinux x86_64 | |
* |
# Gitlab CI - Build Ionic 3 Project and generates apk files | |
image: beevelop/ionic:latest | |
stages: | |
- deploy | |
cache: | |
untracked: true | |
key: "$CI_PROJECT_ID" | |
paths: |
function getLine(offset) { | |
var stack = new Error().stack.split('\n'), | |
line = stack[(offset || 1) + 1].split(':'); | |
return parseInt(line[line.length - 2], 10); | |
} | |
global.__defineGetter__('__LINE__', function () { | |
return getLine(2); | |
}); |
/* | |
Original idea from | |
http://www.acloudtree.com/how-to-shove-data-into-postgres-using-goroutinesgophers-and-golang/ | |
*/ | |
package main | |
import ( | |
"log" | |
"time" | |
"os" |