Unity ScreenToWorldPoint behaving differently on Mac (compared to PC)? - macos

I have written some tools to be used in Unity for level editing in my project. But when opening the project on a Mac, there is one thing that seems to behave differently. Getting the coordinates within the scene seem to work in the same fashion, but when I call
camera.ScreenToWorldPoint(posInScene)
on Windows the correct position is returned but on the mac it returns something entirely different. Any ideas, what could be the reason for this? Or how I could fix this? The code is run in OnSceneGUI. Of course if things need to be written differently for a mac, then I'll just make the code compile platform dependently. Understanding the the reason for the difference would of course also be nice.
A possibly related thing I've noticed is that camera.rect is always camera.rect(x:0.00, y:0.00, width:1.00, height:1.00) on PC, but for some weird reason on a mac for "Layout" events it's (x:0.00, y:-0.99, width:2.00, height:2.00). Could someone explain that? :o

I don't know what is the root cause of this issue, but the workaround is to use HandleUtility.GUIPointToWorldRay instead of camera.ScreenToWorldPoint.

Related

My Netbeans Editor Lags Heavily (Running on Mac, Programming in C)

I'm a student who uses Netbeans on Mac to Program in C. Due to my previous experience with Java, I really like the feeling of Netbeans IDE. However, I recently noticed, as my projects gets longer and longer, simply coding the plain text is starting to lag heavily, inside the IDE editor.
For example, when I type in any words, even if just comments, if feels like it takes the computer a second or two to respond to every type. Things get even worse when I try to scroll up and down in my code, the response takes a long time, making it feel really bad.
I thought this might be a problem that the IDE haven't been given enough memory. However, after increasing the memory given to the program, it still lags heavily.
Is this all due to the fact running Netbeans to program in C is a bad idea? Or is it something else going wrong in my case?
Thank you very much!
Let's see...
The result is kind of clear. There just wasn't really any viable plan to make it work...
I started working on another computer instead. It seems mac just don't really want to work with netbeans, especially about C.
In my case (MacOS Monterey) the problem was the font size. The more I increased it, the worse the IDE would work.
Over 14 font size the lag is pretty extreme.
I would recommend using another IDE as it looks like this problem has not been fixed even in the latest version.

XCode or make - what should I use?

I started my career on Linux/Unix, and moved over to Windows and Visual Studio. XCode feels pretty alien to me. My feeling is that I'm not in control with XCode. It could be the case that I simply haven't understood how to use the IDE, I am new at developing for Apple OSs. One thing that kind of irks me, is that nobody seem to have found a clean way to compile for multiple platforms (iOS and Mac OS X), using the same sources. I've found two ways to "hack it", but the hacks sound fragile.
I've been pondering the idea of using simple make files instead of XCode (except for the occasional use of Interface Builder).
Is this a sane route to go? Has anyone done this? Are there any major drawbacks I need to be aware of before I take the leap, or should I just bite the bullet and wait for the enlightenment?
Use Xcode, use as many high-level tools as possible. The "loss of control" is replaced by more focus on the application, which IMHO is a great tradeoff.
It is kind of like the loss of control when I went from assembly code to "C", but it was worth it. We keep moving to higher level of abstraction and that allows us to accomplish more, focus on the big picture instead of the minor details.
You've just got to learn new ways of doing things. For example, in the situation you describe (building an OS X and iOS app with shared code), I'd put any shared code into a library/framework that is used by both projects, and create a workspace that contains all three projects.
The loss of control you speak of is offset by the fact that this can all be set up without knowing anything about compiler command-line options in around 10 minutes.
It's a different way of thinking, and it can be frustrating if you know how you would do it on a different platform, but there are advantages to both options. You may never have to think about the build process again!

Mac/Cocoa: Embed a terminal window in my app

Anyone found out if it's possible to "embed" an instance of Terminal into an app? It would be awesome if it also just inherited the tab functionality and drag-drop-ness as well. I saw a couple similar questions on here that mentioned iTerm but it seems like there should be an easier way. Like a NSTerminal object I can pop into a view.
I asked the Panic guys about this. They have a terminal window in Coda that for all intents and purposes looks/functions exactly like Terminal.app running standalone on the desktop. However, their response was that they had to write that themselves from scratch. I'm hoping someone has figured out a better way!
Thanks!
You can do this with the Pathfinder SDK from Cocoatech.
No such thing AFAIK. I don't think embedding a full-featured terminal into an unrelated app is a common enough need that anybody would have made a control like that — even Panic only use it in the one app.

Xcode Code Sense horribly broken?

Ever since I started using Xcode, I've experienced extremely annoying problems with Code Sense. The problem is that when Code Sense kicks in for code completion, sometimes the source code text below the line I'm working on goes "crazy". If I continue typing, the problem gets worse, and after a while the source code is completely screwed up (funny colors, missing lines and characters, ...). Strange enough, the source code itself is unaffected, because when I select another source file and then go back to the one I was working on, everything looks fine again.
The problem can be seen in this screencast: http://www.screencast.com/t/OGY3NWE5
Interesting facts:
This problem has occurred on 3 different machines, so it's not related to a corrupt installation.
Sometimes it's fine for a while (up to one hour) after launching Xcode, but once it starts happening, it's getting worse and worse, until Xcode is restarted. Then it's fine again (for a while)
I've searched the web for similar experiences, and I can't find anything. I would think that it is a known problem, since it occurs on 3 different Macs here (both running 10.5 and 10.6).
Anyone having the same problems? Or a suggestion for fixing this?
Yeah, it can be a real pain. I didn't find a 'fix for it as such, but I do a quick switch from implementation to header (or vice versa) and then back again using Command-option-up. The screen redraws and everything is fine again
Well, I finally (kind of) fixed this problem by simply turning off Quick Help. Previously, I left this on all the time, and it resulted in a very unstable code sense (to the point where Xcode simply became unusable).
This is not a real solution, but it should at least help people experiencing the same issue.
I wrote about it here
My issue was with localization. if your XIB file is localized using xcode 4's, then it was failing for me. removing the localization worked, though not a proper solution.

Building an application with "drawer" in Linux/Mac/Windows

I'd like to build an application with a "drawer" GUI element, like it is all over the place in Mac OS X.
Is it possible to do so in Linux/Windows? Is it possible to build it crossplatform?
I like OS X drawers, but they are not used nearly as often as they used to be. The only apps that I currently use that makes use of them are OmniWeb and TextMate.
I don't think it's worth trying to recreate that UI feature for Windows or Linux. In addition to being too much work, your users likely will find it jarring.
Generally speaking, a standard sidebar ought to support whatever you might use a drawer for.
I think you'd have to roll your own drawer in Linux/Windows.
You all say that drawer is not in use "anymore", which doesn't really help. In any case, I see it fit on a TextMate perfectly, and noone complains about it :-)
KDE seems to have a drawers-like functionality as seen in KDevelop, and some other applications (Kate, the editor, uses them too), but I have never tried to use them in anything I've written, and so would have no idea how to write them.
I haven't used Osx a lot, but cant just a normal sidebar do the job?
Drawers are no long really used on the Mac. I only know of a few that still use them and most of these are older applications. Most have moved the sidebar into the app in a collapsable split view.

Resources