Jump to content

How to read matrix values?


konstantin magnus

Recommended Posts

Thank you. Your methods work!

Just for the record: @test = @m[2][3]; throws:

/obj/geo1/attribwrangle1/attribvop1/snippet1: Call to undefined array index operator 'matrix[int]', returning one of vector4, vector2, vector, float[], int[], vector4[] or vector[]. (2,25)
/obj/geo1/attribwrangle1/attribvop1/snippet1: Ambiguous call to array index operator ''. Candidates are: 'float vector4[int]', 'float vector2[int]', 'float vector[int]', 'float float[][int]' (2,28).
Error: Error in VOP 'snippet1'.

 

Link to comment
Share on other sites

Even for arrays, I cannot read the value directly from @. So I define temporary "non" @ variable like this:

vector array[] = v[]@atrail;
vector position = array[i];

Even in the documentation, they don't acces directly the @ attribute. They say float a = m3[0][1]; // not @m3[0][1]

EDIT: Now I have tried to read directly the v[]@atrail and my "workaround" is not needed. I think it was needed. Sorry for the confusion.

Edited by ikoon
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...