Skip to content

Instantly share code, notes, and snippets.

#include <assert.h>
#include <conio.h>
#include <iostream>
#include <stdio.h>
#include <time.h>
#include "cholmod.h"
// Test Matricies availble at: https://sparse.tamu.edu/
// nd6k: https://www.cise.ufl.edu/research/sparse/MM/ND/nd6k.tar.gz
// Settings
var encode_color = new THREE.Vector3(1, 0, 0);
var encode_dir = new THREE.Vector3(0, 1, 0);
var decode_dir = new THREE.Vector3(0, 1, 0);
// SH Constants
var fConst00 = Math.sqrt( 1/4 * Math.PI );
var fConst01 = Math.sqrt( 2/4 * Math.PI );
var fConst02 = Math.sqrt( 3/4 * Math.PI );
var fConst03 = Math.sqrt( 4/4 * Math.PI );
@andr3wmac
andr3wmac / renderMeshExample.cpp
Last active August 29, 2015 14:06
Cubes with Collision
//-----------------------------------------------------------------------------
// Copyright (c) 2012 GarageGames, LLC
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to
// deal in the Software without restriction, including without limitation the
// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
// sell copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
@andr3wmac
andr3wmac / renderMeshExample.cpp
Created September 22, 2014 22:19
Atlas Textured Cube Building with renderMeshExample
//-----------------------------------------------------------------------------
// Copyright (c) 2012 GarageGames, LLC
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to
// deal in the Software without restriction, including without limitation the
// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
// sell copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
@andr3wmac
andr3wmac / renderMeshExample.cpp
Created September 21, 2014 14:57
renderMeshExample adapted to support a list of cubes with positions.
//-----------------------------------------------------------------------------
// Copyright (c) 2012 GarageGames, LLC
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to
// deal in the Software without restriction, including without limitation the
// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
// sell copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
//-----------------------------------------------------------------------------
// Copyright (c) 2012 GarageGames, LLC
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to
// deal in the Software without restriction, including without limitation the
// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
// sell copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
@andr3wmac
andr3wmac / GammaPostFX.cs
Created August 25, 2014 21:22
Brightness/Contrast controls for Torque3D
//-----------------------------------------------------------------------------
// Copyright (c) 2012 GarageGames, LLC
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to
// deal in the Software without restriction, including without limitation the
// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
// sell copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
void SFX3DObject::getEarTransform( MatrixF& transform ) const
{
// If it's not a ShapeBase, just use the object transform.
ShapeBase* shape = dynamic_cast< ShapeBase* >( mObject );
if ( !shape )
{
transform = mObject->getTransform();
return;
}
//-----------------------------------------------------------------------------
// Copyright (c) 2012 GarageGames, LLC
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to
// deal in the Software without restriction, including without limitation the
// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
// sell copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
@andr3wmac
andr3wmac / gist:11208941
Created April 23, 2014 09:44
Torque3D - ServerPlayExplosion
function ServerPlayExplosion(%position, %datablock)
{
// Play the given explosion on every client.
// The explosion will be transmitted as an event, not attached to any object.
for(%idx = 0; %idx < ClientGroup.getCount(); %idx++)
{
%client = ClientGroup.getObject(%idx);
commandToClient(%client, 'PlayExplosion', %position, %datablock.getId());
}
}