erictuvesson / Voreeal

Voreeal is a voxel library for Unreal Engine 4 powered by PolyVox.
MIT License
29 stars 13 forks source link

Rebuild of Plugin fails #17

Closed guyvert1 closed 7 years ago

guyvert1 commented 7 years ago

Hi,

Firstly, well done on getting this far :)

I thought I'd try it out, here's what I done:

Create new 4.14 3rd person C++ project git cloned voreeal and all submodules, then restart unreal and compile.

This is what I get :

../MyVox/Plugins/Voreeal/Source/Voreeal/Private/VoreealPagedVolumeComponent.cpp:187:15: error: no matching constructor for initialization of 'FSparseOctree'
auto oc = new FSparseOctree(Volume, this, EOctreeConstructionModes::BoundCells);
              ^             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../MyVox/Plugins/Voreeal/Source/Voreeal/Classes/VoreealOctree.h:100:2: note: candidate constructor not viable: no known conversion from 'UVoreealPagedVolume *' to 'UBasicVolume *' for 1st argument
        FSparseOctree(UBasicVolume* Volume, UVoreealVolumeComponent* VolumeComponent,
        ^
../MyVox/Plugins/Voreeal/Source/Voreeal/Classes/VoreealOctree.h:104:2: note: candidate constructor not viable: requires 4 arguments, but 3 were provided
        FSparseOctree(UVoreealVolume* Volume, UVoreealVolumeComponent* VolumeComponent,
        ^
../MyVox/Plugins/Voreeal/Source/Voreeal/Classes/VoreealOctree.h:96:7: note: candidate constructor (the implicit copy constructor) not viable: requires 1 argument, but 3 were provided
class FSparseOctree
      ^
2 warnings and 1 error generated.

I'm running on OSX/Xcode (iMac).

Was wondering if I'm missing something here ?

Thanks again for the efforts so far, its great to see voxels developing in UE4

--- UPDATE:

I may be wrong, but would this be the cause 👍

For the octree you have these Constructors...

FSparseOctree(UBasicVolume* Volume, UVoreealVolumeComponent* VolumeComponent,
        const EOctreeConstructionModes& ConstMode);

FSparseOctree(UVoreealVolume* Volume, UVoreealVolumeComponent* VolumeComponent,
        const FVoreealRegion& Region, const EOctreeConstructionModes& ConstMode);

So you have options for UBasicVolume or UVoreealVolume in construction , but 'UPagedVolumeComponent' has its 'volume' as:

UVoreealPagedVolume* Volume;

So when this is called in UPagedVolumeComponent::CreateChunk

TSharedPtr<FPagedVolumeChunk> Result = MakeShareable(new FPagedVolumeChunk(MakeShareable(new FSparseOctree(Volume, this, EOctreeConstructionModes::BoundCells)), LocationHash, Region));

Its calling the octree with a UVoreealPagedVolume ?

erictuvesson commented 7 years ago

Hey, it seems to have been my latest merge. It should compile fine now.

I will probably remove the octree from the paged volume just to get it working properly.