Skip to content

Instantly share code, notes, and snippets.

View BlenderSleuth's full-sized avatar

Ben Sutherland BlenderSleuth

View GitHub Profile
@BlenderSleuth
BlenderSleuth / PrivateVariableRobber.h
Created April 24, 2024 01:50
C++ Private Variable Robber
#pragma once
// Tricky template trick to access private members.
// https://bloglitb.blogspot.com/2011/12/access-to-private-members-safer.html
template <typename Tag, typename Tag::Type M>
struct TRob
{
friend typename Tag::Type Get(Tag)
{
return M;
@BlenderSleuth
BlenderSleuth / UbuntuPerforceSetup.sh
Last active December 23, 2023 23:35
Ubuntu 22.04 Perforce Setup Script (including git connector)
#!/bin/sh
# Add perforce package key and repo (from https://www.perforce.com/manuals/p4sag/Content/P4SAG/install.linux.packages.install.html)
wget -qO - https://package.perforce.com/perforce.pubkey | gpg --dearmor | sudo tee /usr/share/keyrings/perforce.gpg
sudo echo "deb [signed-by=/usr/share/keyrings/perforce.gpg] https://package.perforce.com/apt/ubuntu jammy release" > /etc/apt/sources.list.d/perforce.list
# Install p4d
sudo apt-get update
sudo apt-get install -y helix-p4d
@BlenderSleuth
BlenderSleuth / FlyingSplineExtension.h
Last active November 17, 2021 08:40
EXPERIMENTAL B-Spline path fitting functionality for the Flying Navigation System.
// Copyright Ben Sutherland 2021. All rights reserved.
// EXPERIMENTAL B-Spline path fitting functionality for the Flying Navigation System.
#pragma once
#include "CoreMinimal.h"
#include "Kismet/BlueprintFunctionLibrary.h"
#include "FlyingNavFunctionLibrary.h"
#include "NavigationPath.h"
#include "FlyingSplineExtension.generated.h"
@BlenderSleuth
BlenderSleuth / QuatStaticLibary.h
Last active October 6, 2022 20:35
A UE4 Static library for common quaternion operations
#pragma once
#include "CoreMinimal.h"
/**
* Library of commonly used custom functions
*/
class QuatStaticLibrary
{
public: