How would I get the trigger to take the full shape of the brick?
function fxDtsBrick::createTrigger(%this,%data,%polyhedron)
{
//credits to Space Guy for showing how to create triggers
if(!isObject(%data))
{
Slayer_Support::Error("fxDtsBrick::createTrigger","Trigger datablock not found.");
return 0;
}
if(%polyhedron $= "")
%polyhedron = "0 0 0 1 0 0 0 -1 0 0 0 1";
if(isObject(%this.trigger))
%this.trigger.delete();
%t = new Trigger()
{
datablock = %data;
polyhedron = %polyhedron;
};
missionCleanup.add(%t);
%boxMax = getWords(%this.getWorldBox(), 3, 5);
%boxMin = getWords(%this.getWorldBox(), 0, 2);
%boxDiff = vectorSub(%boxMax,%boxMin);
%boxDiff = vectorAdd(%boxDiff,"0 0 0.2");
%t.setScale(%boxDiff);
%posA = %this.getWorldBoxCenter();
%posB = %t.getWorldBoxCenter();
%posDiff = vectorSub(%posA, %posB);
%posDiff = vectorAdd(%posDiff, "0 0 0.1");
%t.setTransform(%posDiff);
%this.trigger = %t;
%t.brick = %this;
return %t;
}