//All temporary test projects will be located here
//exec("./crane.cs"); 
//exec("./DynamicShape.cs");
exec("./orbit.cs");
exec("./laserbeam.cs");

datablock ParticleData(WallFireP )
{
   textureName          = "~/data/shapes/rifle/smokeParticle";
   dragCoefficient      = 0;
   gravityCoefficient   = 0;
   inheritedVelFactor   = 0.0;
   constantAcceleration = 0;
   lifetimeMS           = 500;
   lifetimeVarianceMS   = 50;
   windcoefficient = 0;
   colors[0]     = "0.4 0.4 0.4 1.0";
   colors[1]     = "0.0 0.0 0.0 1.0";
   colors[2]     = "0.0 0.0 0.0 1.0";
   sizes[0]      = 2;
   sizes[1]      = 2;
   sizes[2]      = 2;
   times[0]      = 0.7;
   times[1]      = 0.8;
   times[2]      = 1.0;
};
 
datablock ParticleEmitterData( WallFireEmitter )
{
   ejectionPeriodMS = 10;
   periodVarianceMS = 5;
 
   ejectionVelocity = "0 0 0";  // A little oomph at the back end
   ejectionVelocity3D = "0 -5 0";  // A little oomph at the back end
   velocityVariance = "0 0 0";
   velocityVariance3D = "0 0 0";
 
   ejectionoffset = "0 0 0";
   offsetvariance = "0 0 0";
   ejectionoffset3D = "0 0 0";
   offsetvariance3D = "0 0 5";
   linkposition = false;
   linkrotation = false;
   linkscale = False;
   thetaMin         = 0.0;
   thetaMax         = 0.0;
   PhiVariance = 0;
   internalRotation = "1 0 0 0";
   internalPosition = "0 0 0";
   internalScale = "1 1 1";
   orientParticles  = false;
   orientOnVelocity = True;
   orientinverse = true;
   particles = "WallFireP";
   uniform = False;
   VarianceSteps = 8;
};

function wall(%sourceObject,%position) {


 %direction = vectorSub(%sourceObject.getTransform(),%position);
 %axis = getWords(%direction,0,1) SPC "0";
 %axis = VectorNormalize(%axis);
 %emitter = new ParticleEmitterNode()
 {
  position = %position;
  scale = "2.5 1 1";
  dataBlock = "EmitterNode";
  emitter = WallFireEmitter;
  velocity = "1";
 };
 MissionCleanup.add( %emitter );
 %emitter.setTransform(%position SPC %axis SPC 1.57);
 //%emitter.timeout = %emitter.schedule(%obj.duration*1000, "delete");
 }



function rotation(%obj,%direction) {
%axis = getWords(%direction,0,1) SPC "0";
%axis = VectorNormalize(%axis);
%position = getWords(%obj.getTransform(),0,2);
%obj.setDynamicTransform(%position SPC %axis SPC 1.57,3);
}