I was able to get some basic setup into the editor. I have added a new class EditorLogic, in parallel with GameLogic, that will take care of the general editor operation (add entities, remove entities, save, load). So far the system seems to work out well. I was able to add in tiles with mouse clicks quite easily. Also I was able to use the same debugging message mechanism I used in the game application, except it's display in Windows Form instead of CEGUI. It seems to show that the initial architecture of the system is quite adequate, and working out well so far.
But right now the "picking" system doesn't seem to work accurately. Right now I am just using the same Project and Unproject technique I used for the robot movement boundary detection, but it seems to be off. Now I think of it...it could be that the sprites are drawn half way off from it's position, in another word they are drawn with their center on the position, not the corner. While when I am calculating the picking position I am using the corner...that's why it seems off. Anyway, I should try to figure this out and use a consistent coordinate system (either use the corner or the center). Another thing that really got me confused is I need to multiply the 2D sprite entity's position with it's width and height...it's just weird. I have to review how I calculated the size and position of the sprite etc.
And if the picking is still not accurate enough...then I have to consider using a more conventional method:
http://www.toymaker.info/Games/html/picking.html
http://www.mvps.org/directx/articles/improved_ray_picking.htm
13 Feb 2009
Editor Setup
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment