Skip to content

Instantly share code, notes, and snippets.

mako yass makoConstruct

Block or report user

Report or block makoConstruct

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View various hexagon-processing algorithms.cpp
// o o o o . . .
// o o o o o . .
// o o o o o o .
// o o o o o o o
// . o o o o o o
// . . o o o o o
// . . . o o o o
v2 hexify(v2 v){ return v2{v.x+v.y/2, v.y*SQRTTHREEQUAR}; } //from square to hex
@makoConstruct
makoConstruct / updateApproacher.cpp
Last active Aug 12, 2019
accelerate towards a target and stop perfectly once arrived, with maximum speed
View updateApproacher.cpp
float movementWhileAccelerating(float subdelta, float velocity, float acceleration){
return subdelta*(velocity + subdelta*acceleration/2);
}
void updateApproacher(float delta, float target, float& position, float& velocity, float maxSpeed, float acceleration, float deceleration){
if(position == target && velocity == 0){
return;
}
float dif = target - position;
@makoConstruct
makoConstruct / the evolution of deliberative thought.md
Created Jul 19, 2019
unrefined ravings about the likely evolution of deliberative thought
View the evolution of deliberative thought.md

[this is a draft. Some of the things written here are guessed, unconfirmed, and maybe wrong. You are not seeing me say these words. You are seeing me trying to figure out what to say.]

I'm wondering if I should post a summary of the bicameral theory in LW for its metascientific significance, as a revolutionary theory that seems not to have done much, because I don't think the core interesting stuff has been boiled down very well. I'm not good at this kind of work so I'm going to need a bunch of votes of confidence from yall that yes this is the theory and yes this is the part of the theory has not been falsified

bicameral evolution of consciousness

View pursuit.cpp
float distanceToSlowDown(float initialSpeed, float deceleration){ return sq(initialSpeed)/(2*deceleration); }
float maxDistanceBeforeSlowingWithin(float initialSpeed, float time){ return initialSpeed*time/2; }
bool updateApproacher(float dif, float& currentVelocity, float deceleration, float acceleration, float delta, float error = 1){ //dif is target - position, returns true iff zeroing
float dist = abs(dif);
float sign = dif/dist;
float absvel = currentVelocity*sign;
float acd = acceleration*delta;
float avd = absvel*delta;
float ded = deceleration*delta;
@makoConstruct
makoConstruct / gist:371f7e98d0775917f62a5033dd36014f
Created Aug 15, 2018
you want an example of termpose being used. Oh I'll give you an example
View gist:371f7e98d0775917f62a5033dd36014f
faunMode true
debugMode false
devMode true
zoomViewSpanLog 5.75
zoomSpanLogForDialogue 4
unzoomedViewSpanRelZoomedp 2.7
mapViewSpanRelWorldp 1.3
boardViewSpanRelZoomedp 0.5
cameraZoomDur 0.3
View dialogue.cpp
ParentBeingBody
hello
'"Oh. Sopra mori. Welcome to the world, little spore. Have you been introduced to the town yet?
>"What's \"Sopra mori\"?
'"Impossible to explain to such a little thing as you, darling little spore. There's so much you have to learn. You'll take some directions to town, wont you?
enter directions
>"Where is it?
enter directions
>"Leave me alone
'"A dangerous attitude. Bad things can happen to you out here alone, you know. If you don't go to town and take root, you could lose ALL of your data.
@makoConstruct
makoConstruct / Approacher2d.cpp
Last active Oct 25, 2017
Smoothly accelerates and decelerates to land exactly on target
View Approacher2d.cpp
void updateApproacher(v2& currentPosition, v2& currentVelocity, v2 target, float delta, float acceleration, float deceleration, float maxSpeed){
if(delta == 0) return;
v2 dto = target - currentPosition;
float dtm = dto.magnitude();
float vm = currentVelocity.magnitude();
auto distanceToStop = [&](float initialVelocity, float deceleration){
float deltdec = deceleration*delta;
float numberOfFramesToSlowDown = max(0.0f, floor((initialVelocity - deltdec)/(deltdec)));
return numberOfFramesToSlowDown*delta*(initialVelocity - (deltdec*(numberOfFramesToSlowDown + 1))/2);
};
@makoConstruct
makoConstruct / careful_easing.cpp
Created Apr 5, 2017
very smooth, 'smart' (but still pure functions of time) easing animations. Specify target, time to reach target, and initial velocity. Smoothly accelerates and decelerates to get there and stand still exactly on time
View careful_easing.cpp
float linearAccelerationEaseInOutWithInitialVelocity(float t, float initialVelocity){
if(t >= 1.0){ return 1.0; }
return t*(t*((initialVelocity - 2)*t + (3.0f - 2*initialVelocity)) + initialVelocity);
}
float velocityOfLinearAccelerationEaseInOutFromInitialVelocity(float t, float initialVelocity){
if(t >= 1.0){ return 0.0; }
return t*((3.0f*initialVelocity - 6.0f)*t + (6.0f - 4.0f*initialVelocity)) + initialVelocity;
@makoConstruct
makoConstruct / pointAndConnectionAnimation.cpp
Created Mar 26, 2017
only part of the logic for animating rectangular point and line generata as a series of strokes
View pointAndConnectionAnimation.cpp
void FolkBodySpec::prepAnimation(){
//start by identifying clusters
auto groupColorings = fillCopies(itemTrayDimensionX*itemTrayDimensionY, 0);
u8 nextColoring = 1;
vector<Coord> centralNode;
overRegion(itemTrayDimensionX, itemTrayDimensionY, [&](Coord c){
uint ik = itemOffset(c);
if(locatedItems[ik]){
u8 gc;
if(!groupColorings[ik]){
@makoConstruct
makoConstruct / termpose_helpers.cpp
Created Mar 11, 2017
it's mindnumbing to go alone, take these
View termpose_helpers.cpp
Term const* findTermConst(vector<Term> const& candidates, string const& key){
for(Term const& t : candidates){
if(t.isList() && t.l.l.size() > 1){
Term const& ft = t.l.l[0];
if(ft.isStr() && ft.s.s == key){
return &t;
}
}
}
return nullptr;
You can’t perform that action at this time.