Roku Developer Program

Join our online forum to talk to Roku developers and fellow channel creators. Ask questions, share tips with the community, and find helpful resources.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
dev42
Visitor

subset of a roList

OK. Here goes...

I would like to have a master roList ( of Strings ) that rules all other roLists. roListes. BUT, I really don't want the secondary roLists, which will be subsets or the Master roList, to copy the values from the Master roList. They should just reference them.

Playing around with this, the only way I've been able to do it is if the Master roList is a roList of AA's.

Is this the only way? Best way? Fastest way?
---------------------------------------------------------------------
Case #2 - Similarly, but different: I'd like to have a Master roList of all 3D points used in a scene. Triangle Objects would reference these points. Transformations would be done on the 3D points in the Master roList, not on the Vertices of the Triangle Objects so as to not do redundant work.

Should the Triangle Objects reference the points in the Master roList *OR* should they use an index to look up the values? The latter of which leans more towards using roArray instead. Which, if I understand correctly, would be faster as long as the array never had to resize.

--> Going further, a Master roArray of roArray's would be the ultimate efficient storage retrieval system, no?

Point[0][0] ==> Point[0]'s x value....
Point[0][1] ==> Point[0]'s y value.... & finally,
Point[0][2] ==> Point[0]'s z value.

peace & 42
0 Kudos
2 REPLIES 2
EnTerr
Roku Guru

Re: subset of a roList

How do you imagine referencing a specific Point in a roList?
If roList is indeed a linked list, using [ ] should be extremely slow.
0 Kudos
dev42
Visitor

Re: subset of a roList

"EnTerr" wrote:
How do you imagine referencing a specific Point in a roList?
If roList is indeed a linked list, using [ ] should be extremely slow.


I've heard, “It's better to keep your mouth shut and appear stupid than open it and remove all doubt” ― Mark Twain ( Mark Twain?! Really? )

Anyway, ignoring that sage's advice... *ahem* ... If the Master List had all the points that objects could reference... and said objects were comprised of triangles that used roArray's could they access the same memory location? If so, wouldn't they access those address faster? We wouldn't be moving over the Master List's roList each time thru the loop, we'd be cycling over each Object's points -- aha! another gotcha! -- Not each Triangle's points as they share vertices with other Triangles in the same object!

The point being is to not duplicate points in memory and not do repeated calculations on the same point multiple times ( Think about the poles of a disco ball made out of triangles ).

This is probably all moot anyway as I'm not sure how big "our" 3D universe can be on a Roku. ( I still stand by my belief 2 spinning triangles is possible on a Roku 2XS in BrightScript.) I'm close, so very close!

FWIW, my other example, Master roList of Strings, isn't as time constrained and I'm hoping to keep an entire history of the game's session. Duplicating this would be much more likely to run into memory issues, I'd think, but I'm not sure. Furthermore, roArray's need contiguous memory, right?

Regardless, we don't want memory thrashing or garbage collection going on during the "action."

peace & 42
0 Kudos