yingminisize / droidar

Automatically exported from code.google.com/p/droidar
0 stars 0 forks source link

MultiMarkerSetup #45

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.
2.
3.

What is the expected output? What do you see instead?

What version of the product are you using? On what operating system?

Please provide any additional information below.
Hi, 
When i use the MultiMarker setup, when he recognize the Marker he put the obj 
on the Marker but when i remove the marker, the obj stays in the world. i tried 
to clear the world in the method onUnrecognizedMarkerDetected, but it didn't 
work. 
how can i do it?

Original issue reported on code.google.com by o...@fetch-app.com on 24 Jul 2012 at 9:20

GoogleCodeExporter commented 9 years ago
onUnrecognizedMarkerDetected is called when a marker is displayed that was not 
registered. you need to remove the object when the marker detection method isnt 
called for a while. i would use a update component for this. use the 
systemupdater directly in the setup or add it as a custom component to the 
displayed object ( i would do the second solution and hide the object when the 
counter in the custom update component is greater then x ). read the other 
components in the framework to understand how to create one and how to compose 
an Obj out of components.

Original comment by simon.heinen on 25 Jul 2012 at 6:46

GoogleCodeExporter commented 9 years ago
Hi,
I tried to do it, but it didn't work.
I know it's too much to ask, but is there any chance you can send me a
similar example?!
I don't think i understand it right. the obj is allready a component
(Meshcomp), so i need to add the systemudapter to it?
anyway,  i really  appreciate your help!
thanks a lot!

Original comment by o...@fetch-app.com on 5 Aug 2012 at 9:57

GoogleCodeExporter commented 9 years ago
Hi again,
How can i hide the object just untill the marker is recognize again?
cause now if the method is not called for x time, the obj is gone, but he
is not coming back when i recognize the marker again
2012/8/5 אורית ברדה <orit@fetch-app.com>

Original comment by o...@fetch-app.com on 5 Aug 2012 at 12:19

GoogleCodeExporter commented 9 years ago
use a field in your component to keep a reference to the object when you remove 
it from the world, otherwise you cannot add it again of course. this is just 
normal object orientation in java. maybe create a small class diagram for 
yourself to get an idea how to compose your component system, this is nothing 
specific about droidar just simple java. the things about droidar you already 
know, the world is a list with objects and each object can have mutliple 
components. one is the render component for opengl and it should be plugged out 
if the marker isnt visible for some time and plugged in again when it is shown 
again. this is the way i would probably do it :)

Original comment by simon.heinen on 5 Aug 2012 at 12:56

GoogleCodeExporter commented 9 years ago
what is exactly the Meshcomp idea? and the meaning of the parents and
children??

Original comment by o...@fetch-app.com on 6 Aug 2012 at 9:58

GoogleCodeExporter commented 9 years ago
The meshComp represents to 3d representation of the object. an object can also 
be placed in the world without having a meshcomp, then it would be invisible to 
the user, but can still interact with the user, e.g. via a 
components.ProximitySensor.java (which is also a component you can plug into an 
object;)
The parent is always passed to the component in the update method so that it 
knows who its current parent object ist, it is important to not store the 
parent as a fixed field because then it has to be updated manually when the 
component is plugged into a new object. the right way is to use the parent to 
get access to the other components in the object. so if CompA wants to talk to 
CompB it uses parent.getComp(CompB.class).heyCompBYouKnowWhat(..) instead of 
CompA having a CompB field

Original comment by simon.heinen on 6 Aug 2012 at 2:50

GoogleCodeExporter commented 9 years ago
so when i remove the meshcomp from the obj, it's representation is
invisible to the user. is there a way to set the meshcomp again so the 3d
representation will be in the world again? (the shape is invisible when i
remove the meshcomp, but can i make it visible again without adding the obj
 to the world again?) i tried to do it by calling to setcomp agin, but it
didn't work for me.

Original comment by o...@fetch-app.com on 7 Aug 2012 at 1:47

GoogleCodeExporter commented 9 years ago
you leave the object in the world all the time and if you do not want to 
display the 3d representation you remove the component from the object (but not 
the object from the world). if you want to display it again, just add the mesh 
component back to the object. also check the logcat output if it doesn't work 
as you expect it should.

Original comment by simon.heinen on 7 Aug 2012 at 3:17

GoogleCodeExporter commented 9 years ago
Hi again... and sorry i have to many questions.
I'm trying to measure the obj GPS distance( the one i enter when i created
theGeoObj) to the current GPS position. i calculate this every time the
GeoObj is update. the problem i have is that the distance allways change
even if i'm not moving the device. What am i doing rong?
is there any other way to do it? i want to move the MeshComp from the Obj
if the obj gps position is far from the current gps position, and then add
it back when i get close to the obj gps position.

Original comment by o...@fetch-app.com on 8 Aug 2012 at 4:47

GoogleCodeExporter commented 9 years ago
There is a quadtree list for this, take a look at the large worlds setup, i 
think that is what you want to do. how do you calculate the distance to the 
geoObj? i would use the virtual position because the length in the virtual 
world is the same as in the real world so 1 in the virtual world is 1 meter in 
the real world. this is why you can use the virtual position of the obj and the 
glcamera and use Pythagoras (sqrt(a²+b²)) to get the distance from a to b. i 
do this in the collition component, e.g in the setup where you can collect 
these huge arrows, take a look at there too

Original comment by simon.heinen on 9 Aug 2012 at 7:01

GoogleCodeExporter commented 9 years ago
I use the getCurrentlocation to get the Gps position and then calculate the 
distance between the Geoobj I get to my obj by fistFrom(Harvesine function )
The Quadtree is not only for 2D world?
And what is the collition comp ? I couldn't find it

תודה רבה, 
אורית ברדה

ב-9 באוג 2012, בשעה 10:02, droidar@googlecode.com כתב/ה:

Original comment by o...@fetch-app.com on 9 Aug 2012 at 7:45

GoogleCodeExporter commented 9 years ago
the collision comp is called components.ProximitySensor.java

i would not do the gps calculations to get the distance its not needed once the 
objects are positioned and you just get inconsistencies of the displayed 
distance in the virtual world and the calculated distance of the two gps 
positions. check the ProximitySensor and do it in a similar way (also check the 
other components;)

the quadtree uses the x and y position in the virtual world and this way 
displays the objects around the user in a very efficient way. read the java 
docs, if you want to display only the objects close to the user then this 
should be the right coise.

Original comment by simon.heinen on 9 Aug 2012 at 11:40