picked to type

Blitz3D Forums/Blitz3D Beginners Area/picked to type

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

Sounds simple: create an index of triangle numbers to wall object pointers.

Dim tri_to_wall.wall(MAX_TRIS)

; add triangles for wall object
tri_index = AddTriangle(...)
tri_to_wall(tri_index) = the_wall

; find picked wall
local the_wall.wall = tri_to_wall(PickedTriangle(...))


Make sense?

If it isn't feasible to use an array to index (because you are going to continually add triangles) use a hash table instead. They're super fast for lookups!