Jump to content

3-dimension Unigine::Vector using problem


photo

Recommended Posts

I use next code:

Unigine::Vector matrix[0];

for (int i = 0; i < 30; i++)
{
matrix.append(new Unigine::Vector());

for (int j = 0; j < 30; j++)
{
	matrix[i].append(new Unigine::Vector());

	for (int k = 0; k < 30; k++)
	{
		matrix[i][j].append(2);
	}
}
}

this causes error:

source/scripts/game/Matrix.h:141: Interpreter::parse_user_array_variable(): unknown operation ".append(2)" for array variable

instead of it we must use:

Unigine::Vector(matrix[i][j]).append(2); // that's all right

 

When I want get value from Vector, I use:

int b = matrix[0][0][0];

it causes error too:

source/scripts/game/Matrix.h:148: Interpreter::parse_expression(): unknown token '[' in "matrix[0][0][0]" expression

instead of it I must use:

Unigine::Vector a = matrix[0][0];
int b = a[0];

This is not very convenient, and, maybe, it's a bug?

Link to comment

No, It's not bug.

 

This line of code will cause an error too:

matrix[i].append(new Unigine::Vector());

You can use this:

Unigine::Vector matrix2 = matrix[i];
matrix2.append(new Unigine::Vector());

Link to comment

No, It's not bug.

 

This line of code will cause an error too:

matrix[i].append(new Unigine::Vector());

 

I use this code right now, all works. Check it.

Link to comment
×
×
  • Create New...