Skip to content

Instantly share code, notes, and snippets.

View jeremyabel's full-sized avatar

Jeremy Abel jeremyabel

View GitHub Profile
@jeremyabel
jeremyabel / .block
Last active February 13, 2017 01:12 — forked from mbostock/.block
Delaunay Force Mesh II
license: gpl-3.0
@jeremyabel
jeremyabel / mysql.js
Last active September 15, 2017 04:13
function sendCotizacion(db, userName, productsObjArray, totalsObj, clientData, res, req) {
const pool = new sql.connect(config, err => {
console.log("err: " + err)
});
const transaction = new sql.Transaction(pool);
transaction.begin(err => {
if (err) {
console.log("err" + err);
}
function NumRegUnico( obj, transaction ) {
console.log("Entering NumRegUnico");
return new Promise( ( resolve, reject ) => {
sql.connect( config ).then( recordsets => {
var request = new sql.Request( transaction );
request.output( 'NuevoNumReg', sql.char );
request.execute( 'dbo.uspNuevoRegistro' ).then( recordsets => {
/**
* Class which handles the display of various palette-based move fx animations.
*
* These effects operate on a bitmap which stores a capture of the state of the screen,
* and then modifies the 4-color palettes used to draw specific areas of the screen.
*
* There are a number of palette effects available:
*
* INVERT: Inverts the palette's order.
* LIGHTEN1, 2, 3, 4: Lightens the palette, by 1, 2, 3, or 4 steps.
@jeremyabel
jeremyabel / ue-delaunator.h
Last active October 27, 2018 02:49
UE Delaunator
// Represents the area outside of the triangulation.
// Halfedges on the convex hull (which don't have an adjacent halfedge)
// will have this value.
#define DELAUNATOR_INVALID_INDEX TNumericLimits<int32>::Max()
bool Orient(const FVector2D A, const FVector2D Q, const FVector2D R)
{
return (Q.Y - A.Y) * (R.X - Q.X) - (Q.X - A.X) * (R.Y - Q.Y) < 0.f
}
var endian = true;
var byte = 0;
var magic = view.getUint32(byte, endian);
var objectCount = view.getUint32(byte += 4, endian);
var vertexCount = view.getUint32(byte += 8, endian);
var indexCount = view.getSome8ByteValue(byte += 8, endian);
// Fill out your copyright notice in the Description page of Project Settings.
#include "GNNode_RegisterTweakableVariable.h"
#include "GNBaseHUD.h"
#include "Framework/Commands/UIAction.h"
#include "Framework/MultiBox/MultiBoxBuilder.h"
#include "EdGraphSchema_K2.h"
#include "EdGraph/EdGraphNodeUtils.h"
#include "K2Node_InputKeyEvent.h"
#include "K2Node_CallFunction.h"

Our game has two input modes when using the controller. One is called Virtual Cursor, where it just mimics a mouse cursor directly. Moving the analog stick moves a cursor on screen. Pressing the gamepad bottom face button registers as EKeys::LeftMouseButton as far as the input system is concerned. This is done using a IInputProcessor.

The other is called Character Pilot, which is your typical 3rd-person controller movement setup. Analog stick moves the character, pressing the gamepad bottom face button registers as EKeys::Gamepad_FaceButton_Bottom. This also uses a IInputProcessor, but it's more of just a dummy one, it doesn't actually process inputs. It's mostly used to help figure out when the player has switched from mouse to controller at any given time.

Whenever the player stops piloting the character, we remove the Virtual Cursor processor and add the Character Pilot processor. Doing this changes what the gamepad bottom face button registers as:

With Virtual Cursor: EKeys::Gamepad_FaceButton_Botto
@jeremyabel
jeremyabel / index.html
Last active July 22, 2020 18:38
Line derivatives?
<!DOCTYPE html>
<meta charset="utf-8">
<body>
<p>There's an interaction in our game that looks like this:</p>
<img src="https://i.imgur.com/gIixK0p.png" />
<p>You move a slider and the landscape changes with a nice noisy kind of movement until you get the plant in the right position.</p>
<img src="https://i.imgur.com/8dRCevu.png">
<p>