Code:
var() ParticleSystem SkidTemplate;
var() MaterialInterface SkidDecal;
var float Skidding;
var() float DecalWidth, DecalHeight;
/** How long the decal should last before fading out **/
var() float DurationOfDecal;
/** MaterialInstance param name for dissolving the decal **/
var name DecalDissolveParamName;
//min skidding speed b4 marks are drawn
var() float MinSkidding;
/**
* Spawn skid mark Effects
*/
simulated function SpawnSkidEffects()
{
local vector HitNormal, HitLocation, TraceEnd, TraceStart;
local TraceHitInfo HitInfo;
local int i;
local MaterialInstanceTimeVarying MITV_Decal;
local vector X, Y, Z;
local rotator Rot;
//local vector Direction;
// local ParticleSystemComponent ProjExplosion;
//local Actor EffectAttachActor;
//local MaterialInstanceTimeVarying MITV_Decal;
if (WorldInfo.NetMode != NM_DedicatedServer)
{
// Disabling for the demo to prevent explosions from attaching to the pawn...
// EffectAttachActor = (bAttachExplosionToVehicles || (UTVehicle(ImpactedActor) == None)) ? ImpactedActor : None;
//EffectAttachActor = None;
// if (!bAdvanceExplosionEffect)
// {
//trace below wheels
for( i=0; i< Wheels.Length; i++ )
{
Mesh.GetSocketWorldLocationAndRotation(name("WheelEffectSocket"$i), TraceStart, Rot);
TraceEnd = TraceStart;
TraceEnd.Z -= 100;
Trace(HitLocation, HitNormal, TraceEnd, TraceStart, True,, HitInfo,);
// smoke
if (SkidTemplate != None) // && EffectIsRelevant(Location, false, MaxEffectDistance) ProjExplosionTemplate
{
WorldInfo.MyEmitterPool.SpawnEmitter(SkidTemplate, HitLocation, rotator(HitNormal));
}
if( MaterialInstanceTimeVarying(SkidDecal) != none )
{
//texture left on the floor
MITV_Decal = new(self) class'MaterialInstanceTimeVarying';
MITV_Decal.SetParent( SkidDecal );
GetAxes(Rotation, X, Y, Z);
WorldInfo.MyDecalManager.SpawnDecal(MITV_Decal, HitLocation, rotator(-HitNormal), DecalWidth, DecalHeight, 10.0, FALSE, (Rot.Roll * UnrRotToDeg) ); // ( Rotation.Yaw * UnrRotToDeg)
//here we need to see if we are an MITV and then set the burn out times to occur
MITV_Decal.SetScalarStartTime( DecalDissolveParamName, DurationOfDecal );
}
// }
/* else
{
Direction = normal(Velocity - 2.0 * HitNormal * (Velocity dot HitNormal)) * Vect(1,1,0);
ProjExplosion = WorldInfo.MyEmitterPool.SpawnEmitter(SkidTemplate, HitLocation, rotator(Direction), EffectAttachActor);
ProjExplosion.SetVectorParameter('Velocity',Direction);
ProjExplosion.SetVectorParameter('HitNormal',HitNormal);
} */
//SetExplosionEffectParameters(ProjExplosion);
// if ( !WorldInfo.bDropDetail && ((ExplosionLightClass != None) || (ExplosionDecal != none)) && ShouldSpawnExplosionLight(HitLocation, HitNormal) )
// {
// this code is mostly duplicated in: UTGib, UTProjectile, UTVehicle, UTWeaponAttachment be aware when updating
/* if (ExplosionDecal != None && Pawn(ImpactedActor) == None )
{
if( MaterialInstanceTimeVarying(ExplosionDecal) != none )
{
// hack, since they don't show up on terrain anyway
if ( Terrain(ImpactedActor) == None )
{
MITV_Decal = new(self) class'MaterialInstanceTimeVarying';
MITV_Decal.SetParent( ExplosionDecal );
WorldInfo.MyDecalManager.SpawnDecal(MITV_Decal, HitLocation, rotator(-HitNormal), DecalWidth, DecalHeight, 10.0, FALSE );
//here we need to see if we are an MITV and then set the burn out times to occur
MITV_Decal.SetScalarStartTime( DecalDissolveParamName, DurationOfDecal );
}
}
else
{
WorldInfo.MyDecalManager.SpawnDecal( ExplosionDecal, HitLocation, rotator(-HitNormal), DecalWidth, DecalHeight, 10.0, true );
}
} */
// }
}
/* if (ExplosionSound != None && !bSuppressSounds)
{
PlaySound(ExplosionSound, true);
} */
// bSuppressExplosionFX = true; // so we don't get called again
}
}
Bookmarks