Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incompatibility of UVoxelProjectionTools::FindProjectionVoxels() with customised collision profile for the VoxelWorld. #427

Open
alexGuntha opened this issue Jul 5, 2021 · 1 comment

Comments

@alexGuntha
Copy link

Hello,

For reasons I'm not sure I can totally explain myself (it's a big project), we needed to create a specific collision profile for the VoxelWorld to add new capabilities to our camera system.

It turns out this broke the "Flatten" tool in the editor (and some in-game functions that also used UVoxelProjectionTools::FindProjectionVoxels() ), it's adding spheres on top of the pointed terrain instead of behaving properly.

A collision profile was added as below in DefaultEngine.ini:
+Profiles=(Name="PLVoxelWorld",CollisionEnabled=QueryOnly,bCanModify=True,ObjectTypeName="LandscapeObject",CustomResponses=((Channel="LandscapeObject"),(Channel="Paths"),(Channel="CameraFocus")),HelpMessage="Voxel World") [...] +DefaultChannelResponses=(Channel=ECC_GameTraceChannel10,DefaultResponse=ECR_Ignore,bTraceType=False,bStaticObject=False,Name="LandscapeObject")

UVoxelProjectionTools::FindProjectionVoxels() ends up using FCollisionResponseContainer::DefaultResponseContainer with now way to override that (other than ignoring more channels), so a trace with LandscapeObject as the collision channel was behaving as if collisions were ignored.

I had to change this line in Voxel\Private\VoxelTools\VoxelProjectionTools.cpp
const FCollisionResponseContainer ResponseContainer = Parameters.GetResponseContainer();
to
FCollisionResponseContainer ResponseContainer = Parameters.GetResponseContainer(); ResponseContainer.SetResponse(Parameters.CollisionChannel, World->CollisionPresets.GetResponseToChannel(Parameters.CollisionChannel));
as a quick fix to be able to use our collision profile.

I'm pretty sure this is an unhandled case because customising the VoxelWorld's collision profile is not very common, so I'm filing this bug.

Thanks,

@Phyronnaz
Copy link
Collaborator

Thanks for the bug report!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants