|
-
April 28th, 2009, 01:42 PM
#1
unsigned local variable
Hey, with the following code i get errors for all the variables. I don't know what to do to fix it.
I have the following code:
Code:
private void generateLand()
{
int iCount = 0;
float fX, fY, fZ = 0;
float fNx, fNy, fNz = 0;
float fTu1, fTv1, fTu2, fTv2 = 0;
float fLVX, fLVZ = 0;
int iColour = 0;
Landscape = Scene.CreateLandscape();
Mesh = Scene.CreateMeshBuilder();
Mesh.LoadXFile("..\\..\\plane.x");
iCount = Mesh.GetVertexCount();
for(int i = 0; i < iCount; i++)
{
Mesh.GetVertex(i, ref fX, ref fY, ref fZ, ref fNx, ref fNy, ref fNz, ref fTu1, ref fTv1, ref fTu2, ref fTv2, ref iColour);
Landscape.SetHeight(fX, fZ, fY, true, false, false);
}
Landscape.FlushHeightChanges(true, true);
Landscape.ComputeNormals(true);
}
This is the error that i get for all the variables:
Use of unassigned local variable 'fX'
Use of unassigned local variable 'fy'
...etc
How can i have to fix this??
-
April 28th, 2009, 01:55 PM
#2
Re: unsigned local variable
float fX, fY, fZ = 0;
This line declares the varibles fX and fY, but it on initizlizes fZ.
You need to seperate the variables out.
float fX = 0;
float fY = 0;
float fZ = 0;
-
April 28th, 2009, 02:03 PM
#3
Re: unsigned local variable
The error message is clear enough. It clearly says that you have not initialized fX & fY. Similarly for other variables too.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|