Oceax
08-06-2009 01:33:05
I am trying to create a heightfield for my terrain but i get an error i dont know how to solve.
The program fails in the following code in NxOgreManualHeightField.cpp with "access violation reading location 0x00000000" when trying to set the heightfield pointer to sdk->createHeightField(description);
I would prefer to just use an xhf file created with flour but i dont know how to create valid .raw file for input. I have created a game editor but there i save the terrain in image format. I tried to convert an image to raw with photoshop but flour just crashes when i try to convert. How can i create a valid raw file?
The program fails in the following code in NxOgreManualHeightField.cpp with "access violation reading location 0x00000000" when trying to set the heightfield pointer to sdk->createHeightField(description);
NxHeightField* ManualHeightField::cook(void)
{
NxHeightField* heightfield = 0;
NxHeightFieldDesc description;
description.setToDefault();
description.nbRows = mHeightField->mNbRows;
description.nbColumns = mHeightField->mNbColumns;
description.samples = mHeightField->mSamples.first();
description.format = NX_HF_S16_TM;
description.thickness = mHeightField->mThickness;
description.verticalExtent = mHeightField->mVerticalExtent;
description.flags = 0;
description.convexEdgeThreshold = mHeightField->mConvexEdgeThreshold;
description.format = NX_HF_S16_TM;
description.sampleStride = sizeof(unsigned int);
description.flags = 0;
if (description.isValid() == false)
{
SharedStringStream message(SharedStringStream::_LARGE);
message << "An error occured creating the NxHeightFieldDesc.\nThe reason(s) and cause(s) could be:\n\n" << Reason::whyAsStream(description);
NxOgre_ThrowError(message.get());
return 0;
}
NxPhysicsSDK* sdk = NxGetPhysicsSDK();
heightfield = sdk->createHeightField(description);
return heightfield;
}
I would prefer to just use an xhf file created with flour but i dont know how to create valid .raw file for input. I have created a game editor but there i save the terrain in image format. I tried to convert an image to raw with photoshop but flour just crashes when i try to convert. How can i create a valid raw file?