http://www.youtube.com/watch?v=_zxU1khDXcU

I can tell you more about this, been doing it for half a year.

I think the pie tool is a good example.

If you look under lltoolpie.cpp, you can see the execution go around.
Although it is more ideal for slower asynchronous raycasting.

On the other hand to raycast from the screen at once, you can do this:
S32 face_hit = -1;
LLVector3 intersection, normal, binormal;
LLVector2 uv;
LLViewerObject* hit_object = gViewerWindow->cursorIntersect(-1, -1, 512.f,
                                                                                
        NULL, -1, FALSE, FALSE, &face_hit,
                                                                                
        &intersection, &uv, &normal, &binormal);

Or for raycasting from world coordinates of a segmented line.
S32 face_hit = -1;
LLVector3 intersection, normal, binormal, rayStart = {Start of your
Ray}, rayEnd = {End of your Ray};
LLVector2 uv;
LLViewerObject* hit_object =
gPipeline.lineSegmentIntersectInWorld(rayStart, rayEnd, FALSE, FALSE,
                                                                                
                                          &face_hit, &intersection, &uv, 
&normal, &binormal);

Before you go anywhere, you'll probably have to understand to get a
better idea of how the tools work in the client, they are handled in a
somewhat complex way.

Depends what your goals are exactly, for a MSPaint-esque system, it
might actually be much cheaper short-term to look into the media
plugins really.

- Nexii

On Tue, Jan 26, 2010 at 7:50 AM, Tateru Nino <tateru.n...@gmail.com> wrote:
> There's ray-casting functions in the code that essentially inverts the
> process of mapping 3D points within the frustum to 2D screen coordinates
> -- that handles object touching, selection and more. I'm not 100% sure
> where it is in the code, but virtually every mouse-click goes near it,
> from memory.
>
> On 26/01/2010 6:11 PM, Lawson English wrote:
>> Ryan McDougall wrote:
>>
>>> I think he's asking if there is any projection function that would
>>> automatically convert screen coordinates to local prim coordinates.
>>>
>>> Cheers,
>>>
>>>
>>>
>> I suspect that the viewer functions that help the LSL touch functions do
>> this. Probably the control widgets for builders have much the same
>> functionality (if they are not the same st of functions underneath it
>> all). The Pupetteering code definitely could track the mouse on the
>> avatar and render control widgets but I don't know how accurate it is.
>>
>> The media plugin SDK has a way of tracking mouse movements along a prim,
>> but I'm not sure if its working yet or not.
>>
>> What he wants to do is certainly doable but I'm not sure how (yet).
>>
>> Lawson
>>
>> _______________________________________________
>> Policies and (un)subscribe information available here:
>> http://wiki.secondlife.com/wiki/SLDev
>> Please read the policies before posting to keep unmoderated posting 
>> privileges
>>
>>
>
> --
> Tateru Nino
> http://dwellonit.taterunino.net/
>
> _______________________________________________
> Policies and (un)subscribe information available here:
> http://wiki.secondlife.com/wiki/SLDev
> Please read the policies before posting to keep unmoderated posting privileges
>
_______________________________________________
Policies and (un)subscribe information available here:
http://wiki.secondlife.com/wiki/SLDev
Please read the policies before posting to keep unmoderated posting privileges

Reply via email to