I havn't read the topic from the beginning but according to my own
experience, the best thing to do to find an object in an array is to
have an ID property (an ID is a unique number delivered to any new
object when it is created) since you re using your own subclass of
Group3D, just add an integer call ID and have a global that would keep
track of what was the last ID you assigned, this would give something
like this:
(Have a global integer called for example LastID)
when creating your Group3D:
------------------------------------------------------------
Dim m As New MyObject
'fill m with what you need
m.ID = LastID
LastID = LastID + 1
m.Object3D.Append ACloneOfTheObject
------------------------------------------------------------
'Then, when looking for your object, your code would become something
like this
Dim which as Object3D
Dim i as integer
which = me.FindObject(x,y)
if which = nil then return
for i = 0 to NumMyObjects
if MyObjectsArray(i).ID=which.ID then exit
next
if i = NumShips+1 then Return
The objective is to clone the Object3D that is shown in your RBSpace
but not the Group3D itself (which might not be possible in fact)
So in the end, the objects contained in your Group3D (MyObject in fact)
are clones from another one, but the id's of your MyObject is unique...
(Hope this is easy to understand and that it solves your problem)
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>
|