All pastes #728872 Raw Edit

Jemand

public text v1 · immutable
·published 2007-10-07 13:24 UTC
rendered paste body
function AITurretData::onAdd(%this,%obj)
{
   Parent::onAdd(%this,%obj);
   echo("AITurretData::onAdd");

   %size = %this.triggerRadius;
   %scale = VectorScale(%obj.scale,%size*2);
   %sizeVec = %size @" "@ %size @" "@ %size;
   %pos = VectorAdd(%obj.position,%sizeVec);

   // now we have to give the static shape a
   // controlling trigger of the right size and location
   %trigger = new Trigger()
   {
      dataBlock = AITurretTriggerData;
      position = %pos;
      rotation = %obj.rotation;
      scale = %scale;
      polyhedron = "0.000000 1.0000000 0.0000000 1.0000000 0.0000000 0.0000000 0.0000000 -1.0000000 0.0000000 0.0000000 0.0000000 1.0000000";
   };
   %trigger.setOwner(%obj);
   %obj.setTrigger(%trigger);
}