It is currently Sat Aug 22, 2020 4:28 am


All times are UTC




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: LargeVolume::Constructor / LargeVolume::setVoxelAt
PostPosted: Fri Sep 20, 2013 11:24 am 

Joined: Fri Sep 20, 2013 10:16 am
Posts: 15
Hi everybody,
I am working with PolyVox in C# for about 3 weeks. For better usage I wrote my own wrapper, because there were problems with the SWIG bindings. (I couldn't change the Density of my Volume)
For SimpleVolume everything works fine, now I am trieing to do the same with LargeVolume and there is where I am having problems.

Code:
//LargeVolume(Region region)
var volData = new LargeVolume(new Region(0, 0, 0, 200, 200, 200));
//setVoxelAt(uint32_t x, uint32_t y, uint32_t z, byte material, byte density)
volData.setVoxelAt(100,100,100, 255,255);

Here I create a new LargeVolume Object with the Region from (0,0,0) to (200,200,200), which works fine. The problem is the time i try to call setVoxel() I get a NullRefernceException at getCompressedBlock and getUncompressedBlock.

I was wondering if I call the constructor or the setVoxel Method wrong or if this is a known problem.

Code:
PolyVox::LargeVolume<PolyVox::MaterialDensityPair88>* volData;
PolyVox::MinizBlockCompressor<PolyVox::BaseVolume<PolyVox::MaterialDensityPair88>::VoxelType>* minizCompressor;
PolyVox::Pager<PolyVox::BaseVolume<PolyVox::MaterialDensityPair88>::VoxelType>* pager;

LargeVolume::LargeVolume(Region region)
{
   minizCompressor = new PolyVox::MinizBlockCompressor<PolyVox::BaseVolume<PolyVox::MaterialDensityPair88>::VoxelType>();
   volData = new PolyVox::LargeVolume<PolyVox::MaterialDensityPair88>(region.getPolyVoxRegion(), minizCompressor, pager, 32);
}

bool LargeVolume::setVoxelAt(int32_t x, int32_t y, int32_t z, Byte value, Byte density)
{
       return volData->setVoxelAt(x, getHeight() - y -1, z, PolyVox::MaterialDensityPair88(value, density));
}

Those are my Wrapper Methods I use to create the Objects in C#


Top
Offline Profile  
Reply with quote  
 Post subject: Re: LargeVolume::Constructor / LargeVolume::setVoxelAt
PostPosted: Sat Sep 21, 2013 6:48 am 
Developer
User avatar

Joined: Sun May 04, 2008 6:35 pm
Posts: 1827
Possibly related to this post (the need for a Pager)?

http://www.volumesoffun.com/phpBB3/viewtopic.php?p=4026#p4026

In general we should handle this more nicely... the LargeVolume still has a few rough edges compared to the SimpleVolume. But the LargeVolume is being used in Cubiquity so hopefully it will improve over the coming weeks.


Top
Offline Profile  
Reply with quote  
 Post subject: Re: LargeVolume::Constructor / LargeVolume::setVoxelAt
PostPosted: Mon Sep 23, 2013 6:17 am 

Joined: Fri Sep 20, 2013 10:16 am
Posts: 15
Thank you a lot.
It was related to the other topic, I think I didn't see there was related topic.
But now everything works fine :)


Top
Offline Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
Theme created StylerBB.net