Skip to content

Instantly share code, notes, and snippets.

View lukaspj's full-sized avatar

Lukas Aldershaab lukaspj

View GitHub Profile
// Set log mode.
setLogMode(2);
// Set profiler.
//profilerEnable( true );
// Controls whether the execution or script files or compiled DSOs are echoed to the console or not.
// Being able to turn this off means far less spam in the console during typical development.
setScriptExecEcho( false );
using System;
using System.IO;
using System.Reflection;
using HorribleHackz.CustomAttributes;
using Torque6_Bridge.Namespaces;
using Torque6_Bridge.SimObjects;
using Console = Torque6_Bridge.Namespaces.Console;
using Version = Torque6_Bridge.Namespaces.Version;
namespace HorribleHackz
$fpsAvgCount = 10;
$fpsIdx = 0;
function fpsPrintAvg()
{
for(%ii = 0; %ii < $fpsAvgCount; %ii++)
{
echo("$fpsArray[" @ %ii @ "] = " @ $fpsArray[%ii]);
}
}
new ShaderData( texRibbonShader )
{
DXVertexShaderFile = "shaders/ribbons/texRibbonShaderV.hlsl";
DXPixelShaderFile = "shaders/ribbons/texRibbonShaderP.hlsl";
pixVersion = 2.0;
};
new GFXSamplerStateData(NyanSampler)
{
#include "sphereEmitter.h"
#include "console/consoleTypes.h"
#include "core/stream/bitStream.h"
IMPLEMENT_CO_DATABLOCK_V1(SphereEmitterData);
static const float sgDefaultEjectionOffset = 0.f;
static const float sgDefaultPhiReferenceVel = 0.f;
static const float sgDefaultPhiVariance = 360.f;
datablock SphereEmitterData(DefaultParticleEmitter)
{
};
datablock BillboardRendererData(DefaultParticleRenderer)
{
textureName = "core/art/defaultParticle";
};
datablock StickyBehaviour(StickyBHV)
expr ::= variable
| expr binop expr
variable ::= LOCALVAR | GLOBALVAR
binop ::= EQUAL | NOTEQUAL | PLUS | MINUS | TIMES | DIVIDE | CONCAT | CONTAB | CONSPC | ASSIGN
funcall_expr ::= ID LPAREN expr_list_decl RPAREN
| ID COLONCOLON ID LPAREN expr_list_decl RPAREN
| expr DOT ID LPAREN expr_list_decl RPAREN
bool TSStatic::castRay(const Point3F &start, const Point3F &end, RayInfo* info)
{
if ( mCollisionType == None )
return false;
if ( !mShapeInstance )
return false;
if ( mCollisionType == Bounds )
{
// Sample the scene color.
float4 color1 = Texture1.Sample(TextureSampler, input.UV).rgba;
float4 color2 = Texture2.Sample(TextureSampler, input.UV).rgba;
float a1 = input.UV.x;
float a2 = 1-a1;
float height = color1.a;
float height2 = color2.a;