- Home /
Looking for a to check a list of vector3's quickly.
The problem is needing to be able to have a array that stores a int at two vector 3 index's. The lookup has to be really fast, I have tried looping through a more basic array, but that is too slow and other solutions run me out of memory fairly quickly because the array gets pretty large.
Any ideas?
Example of what I need to be able to do: Array[Vector1, Vector2] = 1; (or something with the same functionality)
You list the need for quick lookup, the need to set two entries???, and an out of memory issue with some implementations. Without better definition and/or your code, it will be difficult to help you. What is your code trying to do? How large does the array get? Does the array grow dynamically or do you know how big it will be before you start processing? This is an array of integers?
Fast lookup is the most important. In the end what I need to be able to do is this: if(Array[Vector1, Vector2]==1){ect}, where that position was set further up by the code.
It is unclear here what you are asking. You cannot use a Vector3 as an index into an array. Array indexes are always integers. So there is something more to your problem you are not presenting. You need to spell out in detail what you are trying to solve.
That is precisely the problem. You cant use an Vector3 as a index, but I need to store a value at the index of two vector3's to speed up lookup time. So I need some method that will allow me to store a value at somecollectiontype[vector1, vector2]
Right now im trying to generate a unique number from the variables in each vector then storing them in a normal array, but not getting very far.
Your answer
Follow this Question
Related Questions
What is the order/connection of array elements in mesh.vertices? 2 Answers
c# : Accessing Struct variables inside an Array 1 Answer
Read variable from txt to Vector3 1 Answer
Vector3 Position returns 0 when applied to GameObject 1 Answer
Store Vector3 from Array of GameObjects to Vector3Array 1 Answer