Skip to content

Instantly share code, notes, and snippets.

View benjaminbojko's full-sized avatar

Benjamin Bojko benjaminbojko

View GitHub Profile
@benjaminbojko
benjaminbojko / AnimOperators.h
Last active July 27, 2017 00:14
Cinder Animation Operators
#pragma once
#include "cinder/Tween.h"
//==================================================
// Anim<T> + T
//
template<typename T>
inline T operator + (const ci::Anim<T> & tween, const T & value) {
@benjaminbojko
benjaminbojko / glm_quat_angle_test.h
Last active August 24, 2017 17:06
GLM Quaternion angleAxis to angle vs roll
vector<float> degs = {60, 120, 180, 240, 300, 360, 420, 480, -60, -120, -180, -240, -300, -360, -420, -480};
// angleAxis -> angle
for (float deg : degs) {
float rad = glm::radians(deg);
glm::quat rot = glm::angleAxis(rad, glm::vec3(0, 0, 1));
std::cout << "angleAxis -> angle: " + to_string(deg) + " deg -> " + to_string(glm::degrees(glm::angle(rot))) + " deg" << std::endl;
}
// angleAxis -> roll
@benjaminbojko
benjaminbojko / ProjectConfig.props
Created December 21, 2018 21:53
VS CinderPath Property Sheet
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" InitialTargets="CreateUserConfig; AddCinderDir">
<ImportGroup Label="PropertySheets" />
<ItemDefinitionGroup />
<PropertyGroup Label="FileReferences">
<!-- Default Cinder path relative to this file; Override in custom props file -->
<CinderDir>$([System.IO.Path]::GetFullPath('$(MSBuildThisFileDirectory)\..'))</CinderDir>
<UserFile>$([System.IO.Path]::GetFullPath('$(MSBuildThisFileDirectory)\UserConfig.props'))</UserFile>
</PropertyGroup>