x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

I am getting crash for custom particle module

Okay, I have a custom particle module that has FRawDistributionVector.

in .h file

     UPROPERTY(EditAnywhere, Category = "Spin")
     struct FRawDistributionVector SpinUpVector;

and in .cpp file

 void UParticleModuleVelocitySpin::InitializeDefaults()
 {
     if (!SpinUpVector.Distribution)
     {
         UDistributionVectorUniform* UpVectorDistribution = NewNamedObject<UDistributionVectorUniform>(this, TEXT("DistributionUpVelocity"));
         SpinUpVector.Distribution = UpVectorDistribution;
     }
 }
 
 void UParticleModuleVelocitySpin::Update(FParticleEmitterInstance* Owner, int32 Offset, float DeltaTime)
 {
     if (!PositionOverride)
     {
         // Method to calculate cross product to create spin motion
         BEGIN_UPDATE_LOOP;
         {
             uint8 Negator = Reverse ? -1 : 1;
 
 
             FVector Vel = FVector(0.0f, 0.0f, 1.0f);
 
             if (SpinUpVector.Distribution)
             {
                 Vel = SpinUpVector.GetValue(Owner->EmitterTime, Owner->Component);
                 Vel.Normalize();
             }
 
             FVector CustomOrigin = FVector::ZeroVector;
             FVector ToOrigin = CustomOrigin - Particle.Location;
             FVector UpVectorNormal = Vel; // FVector(0.0f, 0.0f, 1.0f); // UpVector.GetValue().SafeNormal(); //
 
             // get the cross product and normalized it
             FVector CrossProd = FVector::CrossProduct(UpVectorNormal, ToOrigin.GetSafeNormal());
 
             // update velocity
             Particle.Velocity = CrossProd.GetSafeNormal() * Negator * Speed.GetValue();
         }
         END_UPDATE_LOOP;
     }
 }


Somehow, it makes crash in this line of the code.

in "Distribution.cpp"

 FVector FRawDistributionVector::GetValue(float F, UObject* Data, int32 Extreme, struct FRandomStream* InRandomStream)
 {
 #if WITH_EDITOR
     // make sure it's up to date
     if( GIsEditor || (Distribution && Distribution->bIsDirty) )
     {
         Initialize();
         if (!Distribution && LookupTable.IsEmpty())
         {
             return FVector::ZeroVector;
         }
     }
 #endif
 
     if ( (LookupTable.IsEmpty() && Distribution) || GDistributionType == 0 )
     {
         return Distribution->GetValue(F, Data, Extreme, InRandomStream);
     }
 
     // if we get here, we better have been initialized!
     check(!LookupTable.IsEmpty()); // THIS IS WHERE IT GETS CRASH!
 
     FVector Value;
     FRawDistribution::GetValue3(F, &Value.X, Extreme, InRandomStream);
     return Value;
 }

I put a comment "// THIS IS WHERE IT GETS CRASH!" where it was causing crash. so, how would I resolve this issue?

log crash

 KERNELBASE.dll!UnknownFunction (0x000007fefd7baaad) + 0 bytes [UnknownFile:0]
 ShooterGame.exe!FOutputDeviceWindowsError::Serialize() (0x000000013f78fb2c) + 0 bytes [c:\trees\rs1\engine\source\runtime\core\private\windows\windowsplatformoutputdevices.cpp:95]
 ShooterGame.exe!FOutputDevice::Logf__VA() (0x000000013f5ec918) + 159 bytes [c:\trees\rs1\engine\source\runtime\core\private\misc\outputdevice.cpp:144]
 ShooterGame.exe!FDebug::AssertFailed() (0x000000013f5ca8b9) + 113 bytes [c:\trees\rs1\engine\source\runtime\core\private\misc\outputdevice.cpp:224]
 ShooterGame.exe!FRawDistributionVector::GetValue() (0x0000000140b889d7) + 0 bytes [c:\trees\rs1\engine\source\runtime\engine\private\distributions.cpp:1098]
 ShooterGame.exe!UParticleModuleVelocitySpin::Update() (0x000000014146747d) + 0 bytes [c:\trees\rs1\engine\source\runtime\engine\private\particles\particlemodules_velocity.cpp:688]
 ShooterGame.exe!FParticleEmitterInstance::Tick_ModuleUpdate() (0x00000001413ee195) + 0 bytes [c:\trees\rs1\engine\source\runtime\engine\private\particles\particleemitterinstances.cpp:825]
 ShooterGame.exe!FParticleEmitterInstance::Tick() (0x00000001413eb48f) + 0 bytes [c:\trees\rs1\engine\source\runtime\engine\private\particles\particleemitterinstances.cpp:646]
 ShooterGame.exe!UParticleSystemComponent::ComputeTickComponent_Concurrent() (0x00000001413ae1bc) + 0 bytes [c:\trees\rs1\engine\source\runtime\engine\private\particles\particlecomponents.cpp:3979]
 ShooterGame.exe!UParticleSystemComponent::TickComponent() (0x00000001413ecc31) + 0 bytes [c:\trees\rs1\engine\source\runtime\engine\private\particles\particlecomponents.cpp:3913]
 ShooterGame.exe!UActorComponent::ConditionalTickComponent() (0x00000001409e28f7) + 22 bytes [c:\trees\rs1\engine\source\runtime\engine\private\actorcomponent.cpp:1042]
 ShooterGame.exe!FActorComponentTickFunction::ExecuteTick() (0x00000001409ed474) + 0 bytes [c:\trees\rs1\engine\source\runtime\engine\private\actorcomponent.cpp:603]
 ShooterGame.exe!FTickTaskSequencer::FTickFunctionTask::DoTask() (0x000000014100412c) + 0 bytes [c:\trees\rs1\engine\source\runtime\engine\private\ticktaskmanager.cpp:322]
 ShooterGame.exe!TGraphTask<FTickTaskSequencer::FTickFunctionTask>::ExecuteTask() (0x000000014100ee26) + 0 bytes [c:\trees\rs1\engine\source\runtime\core\public\async\taskgraphinterfaces.h:671]
 ShooterGame.exe!FTaskThread::ProcessTasks() (0x000000013f50a66f) + 0 bytes [c:\trees\rs1\engine\source\runtime\core\private\async\taskgraph.cpp:428]
 ShooterGame.exe!FTaskThread::ProcessTasksUntilQuit() (0x000000013f50a83d) + 0 bytes [c:\trees\rs1\engine\source\runtime\core\private\async\taskgraph.cpp:271]
 ShooterGame.exe!FTaskGraphImplementation::WaitUntilTasksComplete() (0x000000013f5294e6) + 0 bytes [c:\trees\rs1\engine\source\runtime\core\private\async\taskgraph.cpp:984]
 ShooterGame.exe!FTaskGraphInterface::WaitUntilTaskCompletes() (0x000000013f6b1fe5) + 0 bytes [c:\trees\rs1\engine\source\runtime\core\public\async\taskgraphinterfaces.h:189]
 ShooterGame.exe!FTickTaskSequencer::ReleaseTickGroup() (0x00000001410379e1) + 396 bytes [c:\trees\rs1\engine\source\runtime\engine\private\ticktaskmanager.cpp:187]
 ShooterGame.exe!FTickTaskManager::RunTickGroup() (0x0000000141039f27) + 0 bytes [c:\trees\rs1\engine\source\runtime\engine\private\ticktaskmanager.cpp:722]
 ShooterGame.exe!UWorld::RunTickGroup() (0x0000000140d21065) + 0 bytes [c:\trees\rs1\engine\source\runtime\engine\private\leveltick.cpp:696]
 ShooterGame.exe!UWorld::Tick() (0x0000000140d269b9) + 0 bytes [c:\trees\rs1\engine\source\runtime\engine\private\leveltick.cpp:1120]
 ShooterGame.exe!UGameEngine::Tick() (0x0000000140ba6ed5) + 0 bytes [c:\trees\rs1\engine\source\runtime\engine\private\gameengine.cpp:830]
 ShooterGame.exe!FEngineLoop::Tick() (0x000000013f1c769d) + 0 bytes [c:\trees\rs1\engine\source\runtime\launch\private\launchengineloop.cpp:2257]
 ShooterGame.exe!GuardedMain() (0x000000013f1b8c6c) + 0 bytes [c:\trees\rs1\engine\source\runtime\launch\private\launch.cpp:142]
 ShooterGame.exe!GuardedMainWrapper() (0x000000013f1b8cba) + 5 bytes [c:\trees\rs1\engine\source\runtime\launch\private\windows\launchwindows.cpp:126]
 ShooterGame.exe!WinMain() (0x000000013f1c94d9) + 17 bytes [c:\trees\rs1\engine\source\runtime\launch\private\windows\launchwindows.cpp:202]
 ShooterGame.exe!__tmainCRTStartup() (0x00000001423d3221) + 21 bytes [f:\dd\vctools\crt\crtw32\dllstuff\crtexe.c:618]
 kernel32.dll!UnknownFunction (0x00000000777759cd) + 0 bytes [UnknownFile:0]
 ntdll.dll!UnknownFunction (0x00000000779ab981) + 0 bytes [UnknownFile:0]
 ntdll.dll!UnknownFunction (0x00000000779ab981) + 0 bytes [UnknownFile:0]

Product Version: UE 4.7
Tags:
more ▼

asked Jun 01 '15 at 04:59 PM in C++ Programming

avatar image

JaeYoo
15 3 10

(comments are locked)
10|2000 characters needed characters left

0 answers: sort voted first
Be the first one to answer this question
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question