Skip to content

Instantly share code, notes, and snippets.

View josimard's full-sized avatar

Jo Simard josimard

  • Quebec, Canada
View GitHub Profile
@josimard
josimard / InterpolationLibrary.cpp
Last active September 11, 2023 09:13
UE4 - Critically Damped Spring Interpolation Smoothing for Unreal Engine (Similar to SmoothDamp)
#include "InterpolationLibrary.h"
#include "Kismet/KismetMathLibrary.h"
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Critically Damped Spring Interpolations (ie: Similar to Unity's SmoothDamp, but will less operations)
// Inspired from Keijiro's code: https://github.com/keijiro/SmoothingTest
// Math reference: http://mathproofs.blogspot.jp/2013/07/critically-damped-spring-smoothing.html
FVector UInterpolationLibrary::VectorSpringInterpCD(FVector Current, FVector Target, FVector& Velocity, float DeltaTime, float InterpSpeed, float MaxVelocity)
{
@josimard
josimard / .gitignore
Created April 12, 2019 15:12
UE4 .gitignore: General purpose git ignore template for Unreal Engine
# Compiled Object files
*.slo
*.lo
*.o
*.obj
# Precompiled Headers
*.gch
*.pch
@josimard
josimard / RotateAroundActor.cpp
Last active December 24, 2023 17:19
UE4 - Rotate an actor around another in Unreal Engine using FVector::RotateAngleAxis() to create an orbital rotation (Not using transforms or attachments)
#include "RotateAroundActor.h"
#include "GameFramework/Actor.h"
// Sets default values for this component's properties
URotateAroundActor::URotateAroundActor()
{
// Set this component to be initialized when the game starts, and to be ticked every frame. You can turn these features
// off to improve performance if you don't need them.
PrimaryComponentTick.bCanEverTick = true;
@josimard
josimard / .gitignore
Created October 29, 2015 16:12
WordPress .gitignore template
# Wordpress files in the root except the "wp-content" directory.
/wp-*
# What not ignored
!wp-content/
!wp-content/themes/
# Ignore plugins?
wp-content/plugins/
@josimard
josimard / package.json
Created October 29, 2015 15:35
The most basic private package.json template for NPM
{
"name": "PROJECT_NAME",
"version": "0.0.1",
"description": "PROJECT_DESCRIPTOIN",
"author": "your@email.com",
"private": true
}
@josimard
josimard / arcView.js
Last active August 29, 2015 14:13
Arc view
/**
* Arc View
* https://gist.github.com/josimard/947aa594aab3b229e1d0
*
* Inspired from http://jsfiddle.net/oskar/Aapn8/
*
* More cool stuff @ http://padolsey.net/p/Sonic/repo/demo/demo.html
*
* Example use:
*
@josimard
josimard / grunt-pngquant.js
Last active August 29, 2015 14:09
Grunt PNGQuant Task
/** //////////////////////////////////////////////////////////////////////////////////////////
*
* PNG Quant Grunt Task
*
* To install on OSX: brew install PngQuant
* To install on Windows or other OS: http://pngquant.org/
*
* https://gist.github.com/josimard/ea29904cb58cc4b13ba6/
*
* */
@josimard
josimard / Device.js
Created October 9, 2014 22:11
Device info utilty
/**
* Device info SINGLETON utilty (AMD wrapped)
* dependencies:
* - jQuery
* - Modernizr + Modernizr.touch
*
* @author jo@josimard.com
*
* Updates @ https://gist.github.com/josimard/ca4cc8f7d80de0c20bf4
@josimard
josimard / ScrollUtil.js
Last active August 29, 2015 14:07
jQuery window scrolling utilities (to scroll window and check scroll position of elements)
/**
* Window scrolling SINGLETON utilities (AMD wrapped)
*
* IMPORTANT: for ScrollUtil.scrollTo to work, the height of the document must not be fixed.
*
* So instead of css "body, html {height:100%}" use "body, html {min-height:100%}"
*
* dependencies:
* - jQuery
*
@josimard
josimard / grunt-build-utils.js
Last active August 29, 2015 14:04
Grunt build utilities (UglifyJS2 support + makes your grunt build more powerful and flexible )
/**
* Get the latest version @ https://gist.github.com/josimard/cac777fae38ec80e9696#file-grunt-build-utils-js
*
* Example use:
* https://github.com/josimard/angular-requirejs-seed/blob/master/Gruntfile.js
*
* @author Jo Simard jo@josimard.com
*/
// NodeJS module public API