Picking help?
Blitz3D Forums/Blitz3D Programming/Picking help?
| ||
Hi, Q for 3D wizards out there. I've got a collection of types, each containing some data and a 3d entity. I can use CameraPick to get the picked entity, but how do I get the associated data from that? Do I have to roll through the entire collection comparing the entity of each to the one I got from the picking command? Is there an easier way? For reference, the type is below. M Type STAR Field sName$ Field sCompanion$ Field fX# Field fY# Field fZ# Field sSpectral$ Field fMagnitude# Field fNumber# Field eStar% End Type |
| ||
Nevermind. I just looped through checking. Thought it'd be slow but it's just fine. Would delete the topic but don't see any way to do it. |
| ||
you can use the object and handle commands to make this a lot faster. If you have a look at birdies sample in the code archives (http://www.blitzbasic.com/codearcs/codearcs.php?code=216) you will see what I mean. Basically you give the entity the same name as the handle of the type assigned to that entity then you use the object coammand to get straight to the correct type without looping through them all. |
| ||
Ooh, I'll check that out. Thanks for the tip. It *did* seem kludgy to do it that way. M |