Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

What would it take to add a touch_xyz event?

bucky Barkley
Registered User
Join date: 15 May 2006
Posts: 200
02-26-2007 12:17
I really wish we could get x, y, z coordinates for a touch event. It is remarkable that it has been left out. You would think the data is all there, at least on the client side.

Anyone familiar with the client source? Does it involve a round trip? How hard could this be?

(just frustrated with having to work around it)
Talarus Luan
Ancient Archaean Dragon
Join date: 18 Mar 2006
Posts: 4,831
02-26-2007 12:32
It's not as simple as it sounds on first glance.

First of all, there are a lot of prim shapes and parameter values for same. What may be meaningful for a cube/box in terms of coords may be completely meaningless for a torus, for example.

Next, it would require more than just a client-side change if you wanted the script to receive and be able to process that information.

It may be more meaningful to return a rotation of where the object was touched. It wouldn't necessarily be the most accurate thing, but it would work in most situations.
bucky Barkley
Registered User
Join date: 15 May 2006
Posts: 200
02-26-2007 12:39
T - I know what you mean. Long ago I had wondered out loud about simply knowing the face that was clicked on.

A rotation sounds interesting, except for objects that have multiple faces with the same value.

For old X11 programmers, it's akin to wanting to know the XLib event, as opposed to getting a glossed over 'something happened' toolkit reponse ;-)
AJ DaSilva
woz ere
Join date: 15 Jun 2005
Posts: 1,993
02-26-2007 15:40
From: Talarus Luan
It's not as simple as it sounds on first glance.

I say it is. Most of the client code is already there being used to pick the camera anchor point and I think most people would be happy with it returning a face number and a mapping coordinate.
Winter Ventura
Eclectic Randomness
Join date: 18 Jul 2006
Posts: 2,579
02-26-2007 16:06
even a low resolution coordinate grid, like even something like 15x15 per side

take a 15x15 grid and use that for laying out your texture.. could work marvelously..

In the meantime, here's a neat trick. if you stick a script in the master prim, it can detect the linknumber of which child prim was clicked.. even if the children are unscripted. a one script hud.. at the expense of one invisible prim per "button"

another adjunct to this neat trick.. if you "name" the "button prims" the same as the command you want send... the code becomes reallysimple, because it just turns into "say name of prim touched in linkset."
_____________________

● Inworld Store: http://slurl.eclectic-randomness.com
● Website: http://www.eclectic-randomness.com
● Twitter: @WinterVentura
Talarus Luan
Ancient Archaean Dragon
Join date: 18 Mar 2006
Posts: 4,831
02-26-2007 16:43
From: AJ DaSilva
I say it is. Most of the client code is already there being used to pick the camera anchor point and I think most people would be happy with it returning a face number and a mapping coordinate.


OK. Then tell me how that would work on a twisted torus with both path and profile cuts + skew and hollow, let alone a truly tortured prim.

You can't assume that it will always want to be used on flattened, rectangular boxes all the time. If it is going to be supported, it needs to support all the possible shapes in some way.

If you say it is simple, the source code to the client is out there. Please feel free to demonstrate. :)
AJ DaSilva
woz ere
Join date: 15 Jun 2005
Posts: 1,993
02-26-2007 16:50
From: Talarus Luan
OK. Then tell me how that would work on a twisted torus with both path and profile cuts + skew and hollow, let alone a truly tortured prim.

There might be a better way to do it, I've only got a working knowledge of this stuff, but you could get the face the same way as the pick texture tool and the mapping co-ordinate by the rendered pixel value using a texture with a different colour on each pixel (i.e. a 32x32 texture would provide a 32x32 resolution per face for the click detection).
bucky Barkley
Registered User
Join date: 15 May 2006
Posts: 200
02-26-2007 17:20
@ Winter
> another adjunct to this neat trick.. if you "name" the "button prims" the same as the
> command you want send...

Right.. I do stuff with transparent prims for a quicktime RSS browser.
And llGetLinkName is tres cool ...

But one hits a limit of how many prims they want to throw at an object
just to get coordinates. Let's say you have a map of a sim, and you
want to click anywhere and be offered a tp to the nearest store. How
granular do you go? 10x10? that's 100 prims right there :-)

Ya know.. an option for llPassTouches() to fire off events for every
child prim in a layered stack would be cool.. you could get away with a
prim grid of 10 vert columns x 10 horizontal rows prims instead of 100.
Frikken hack though...

Getting back to original request.. even if it only worked for flat surfaces,
it would suffice for the needs of many UI projects. I dont think most
people would complain if it came out of gate not supporting every type
of prim. It would be a heck of a lot better than what we have to work with now.