swordlegend / recastnavigation

Automatically exported from code.google.com/p/recastnavigation
zlib License
0 stars 0 forks source link

Minor editor enhancements #52

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
A bunch of minor editor enhancements that make it slightly nicer to use:

1) Make arrow keys work as well as W,A,S,D
2) Drop "start" position using RMB - as well as SHIFT+LMB (BTW: The help text  
at the top of the main window has them the wrong way around)
3) Mouse wheel to move camera in/out of view
4) GUI slider to control camera speed
5) Allow main window to be maximised (see issue 50)
6) Allow scaling of OBJ file as it's loaded (The OBJs I have assume that 
100.0f is 1 metre...this tends to crash the rcCreateHeightfield due to editor 
treating the world as enormous)

Original issue reported on code.google.com by armstron...@gmail.com on 23 Feb 2010 at 5:06

GoogleCodeExporter commented 9 years ago
Code for (2):

case SDL_MOUSEBUTTONUP:
    // Handle mouse clicks here.
    if(event.button.button == SDL_BUTTON_RIGHT)
    {
        rotate = false;
        if ( !mouseMovedWhilstDown )
        {
            // Hit test mesh.
            float t;
            if (geom->raycastMesh(rays, raye, t))
            {
                float pos[3];
                pos[0] = rays[0] + (raye[0] - rays[0])*t;
                pos[1] = rays[1] + (raye[1] - rays[1])*t;
                pos[2] = rays[2] + (raye[2] - rays[2])*t;
                sample->handleClick(pos, true);
            }
        }
        mouseMovedWhilstDown = false;
    }
    break;

case SDL_MOUSEMOTION:
    mx = event.motion.x;
    my = height-1 - event.motion.y;
    if (rotate)
    {
        mouseMovedWhilstDown = true;
        int dx = mx - origx;
        int dy = my - origy;
        rx = origrx - dy*0.25f;
        ry = origry + dx*0.25f;
    }
    break;

Original comment by armstron...@gmail.com on 23 Feb 2010 at 5:25

GoogleCodeExporter commented 9 years ago
The demo should not be mistaken as editor :) I will fix some of these when time 
permits.

Original comment by memono...@gmail.com on 2 Mar 2010 at 10:09

GoogleCodeExporter commented 9 years ago
>> 1) Make arrow keys work as well as W,A,S,D

Won't fix. I want to use the arrow keys for "slides". I do presentations with 
the
demo every now and then, and having a slideshow there helps me to do stuff.

>> 2) Drop "start" position using RMB - as well as SHIFT+LMB (BTW: The help 
text  
>> at the top of the main window has them the wrong way around)

Done. R158.

>> 3) Mouse wheel to move camera in/out of view

Done in R158. Not very useful, though.

>> 4) GUI slider to control camera speed

Won't fix. I don't want to make the demo too complex (i.e. save config).

>> 5) Allow main window to be maximised (see  issue 50 )

Won't fix. Not easily supported by SDL.

>> 6) Allow scaling of OBJ file as it's loaded (The OBJs I have assume that 
>> 100.0f is 1 metre...this tends to crash the rcCreateHeightfield due to 
editor 
>> treating the world as enormous)

Won't fix. You should scale the objects in 3D program. For example free version 
of
Silo allows to do that (http://www.nevercenter.com/).

Original comment by memono...@gmail.com on 15 Apr 2010 at 7:49