Results 1 to 10 of 121

Thread: G.T.A.2 Map Editor

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #24
    Seems that i got it:
    Here is the small pic (thanks to Greenshot and Paint.NET for neat features):


    You see arrow and dotted lines. The dotted lines just show how the selectorblock looks like below (!) main map block(s) tiles.
    If you could see through that (ER) tile below mouse cursor you could see one of the faces of the selectorblock (in this case BOTTOM face).

    And the problem was, it "picked" or detected that face and didnt move selectorblock to the position where this white mouse cursor actually is.
    Because it "picked" that bottom face, it "saw" that coordinates are same and didnt move it.

    Now i used nxPascal picking demo pieces to actually make it work. I was thinking about distances and surprisingly it seems to work fine. Tried different angles and stuff..
    Code:
              with intersect do
                d:=hypot3d(rayPos.x-x, rayPos.y-y, rayPos.z-z);
              if d < nearD then
              begin
                nearest:=i; nearD:=d;
    I use value of "d". I take one "d" (D1) value from picking of main map blocks and second (D2) from the picking of selectorblocks.
    So if D1 < D2 then cursor is probably on some side of the selectorblock and not on the top (LID face) of it. If D1=D2 then its on the top of the LID face.

    I will do some more checks to really make sure it works in all cases.
    Then i can continue with other stuff.

    EDIT: I could just move selectorblock to the actual clicked position, no problem. But this way i cannot "pick" selectorblocks from any position (air or ground). This now works and the above stuff i explained seems to work.

    2 weeks and finally, working solution. Again thanks to nxPascal. I couldnt do anything without it. Thank you User137!
    Last edited by hwnd; 14-03-2014 at 10:16 PM.

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •