This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FCollisionShape BoxCollision = FCollisionShape::MakeBox(SweepExtent); | |
GetWorld()->SweepSingleByChannel(HitResult, WorldCenter, WorldCenter, QuatRotation, ECC_WorldStatic, BoxCollision, QueryParams); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FVector WorldCenter = Mesh->GetComponentLocation(); // Get the center of the mesh | |
FVector SweepExtent = Mesh->GetStaticMesh()->GetBounds().BoxExtent; // Get the extent of the mesh | |
FCollisionShape BoxCollision = FCollisionShape::MakeBox(SweepExtent); | |
GetWorld()->SweepSingleByChannel(HitResult, WorldCenter, WorldCenter, FRotator(), ECC_WorldStatic, BoxCollision, QueryParams); | |
DrawDebugBox(GetWorld(), WorldCenter, SweepExtent, FRotator(), FColor::Red, false, 2.0f); // Draw a debug box around the mesh |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FVector WorldCenter = Mesh->GetComponentLocation(); // Get the center of the mesh | |
FVector SweepExtent = Mesh->GetStaticMesh()->GetBounds().BoxExtent; // Get the extent of the mesh | |
FRotator ActorRotation = Mesh->GetComponentRotation(); // Get the rotation of the mesh | |
FQuat QuatRotation = FQuat(ActorRotation); // Convert the rotation to a quaternion | |
FCollisionShape BoxCollision = FCollisionShape::MakeBox(SweepExtent); | |
GetWorld()->SweepSingleByChannel(HitResult, WorldCenter, WorldCenter, QuatRotation, ECC_WorldStatic, BoxCollision, QueryParams); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SweepExtent += FVector(5.0f, 5.0f, 5.0f); // Add a little extra to the extent |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FHitResult HitResult; | |
FVector WorldCenter = Mesh->GetComponentLocation(); // Get the center of the meshFVector | |
SweepExtent = Mesh->GetStaticMesh()->GetBounds().BoxExtent; // Get the extent of the meshFRotator | |
ActorRotation = Mesh->GetComponentRotation(); // Get the rotation of the meshFQuat | |
QuatRotation = FQuat(ActorRotation); // Convert the rotation to a quaternion | |
SweepExtent += FVector(5.0f, 5.0f, 5.0f); // Add a little extra to the extent | |
FCollisionQueryParams QueryParams; |
OlderNewer