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"

How to delete or hide Chunks?

Everytime i'm trying to 'release' or 'SetChunkVisible' my project got crushed. What am i doing wrong? Here is my(mostly Rama's) code:

 void AHappyDestructible::Tick(float DeltaTime)
 {
     Super::Tick(DeltaTime);
 
 #if WITH_PHYSX
     
     for (FDestructibleChunkInfo& Each : GetDestructibleComponent()->ChunkInfos)
     {
         physx::PxRigidDynamic* Actor = Each.Actor;
         
         PxTransform Trans = Actor->getGlobalPose();
         PxVec3& PxLoc = Trans.p;
         
         FVector CLocation(PxLoc.x, PxLoc.y, PxLoc.z);
         FVector OffsetLoc = CLocation + FVector(30, 0, 0);
         
         PxVec3 PxTargetLoc = U2PVector(TargetALocation) - PxLoc;
         FVector PxTargetLocC = P2UVector(PxTargetLoc);
         float PxTargetLocSize = PxTargetLocC.Size();
         
         if (Actor)
         {
             Actor->addForce(PxTargetLoc, PxForceMode::eIMPULSE);
         }
         
         if (PxTargetLocSize < 500)
         {
             Actor->setLinearDamping(0);
             //Actor->release();
             //or
             //GetDestructibleComponent()->SetChunkVisible(Each.ChunkIndex,false);            
         }
         else
         {
             Actor->setLinearDamping(3);
         }
     }
 #endif // WITH_PHYSX
 }

Product Version: Not Selected
Tags:
more ▼

asked Mar 11 '15 at 05:00 AM in C++ Programming

avatar image

kmskazka
41 12 17 16

avatar image Moss Mar 12 '15 at 06:18 PM

Could you provide the crash log?

avatar image kmskazka Mar 22 '15 at 10:40 AM

sry for the delay - heres is my crash log

codephystests.log (17.4 kB)
avatar image Moss Mar 23 '15 at 08:34 AM

The log states that you have a null access. Check the following line in your code:

 UE4Editor-CodePhysTests.dll!AHappyDestructible::Tick() (0x000007fed835427a) + 16 bytes [d:\unreal projects\codephystests\source\codephystests\happydestructible.cpp:33]

I guess 'physx::PxRigidDynamic* Actor = Each.Actor;' is null though :)

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

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