SpiderPig Posted April 25 Share Posted April 25 This may be silly but I'm constantly forgetting which function does what when it comes to the camera functions Project() & UnProject(). It might be helpful if the first argument of both commands were renamed to "Vec3 &screen_position" & "Vec3 &world_position" respectively. That way it be easy to identify what does what! Quote Link to comment Share on other sites More sharing options...
SpiderPig Posted April 25 Author Share Posted April 25 Also screen_position should probably be an iVec3 like is returned by window->GetMousePosition(), unless there's a need for it to be Vec3? Quote Link to comment Share on other sites More sharing options...
Josh Posted April 25 Share Posted April 25 Yes, I always forget which is which. Maybe these should be ScreenToWorld and WorldToScreen? 1 Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Josh Posted April 25 Share Posted April 25 10 hours ago, SpiderPig said: Also screen_position should probably be an iVec3 like is returned by window->GetMousePosition(), unless there's a need for it to be Vec3? z coordinate is the distance in front of the camera. 1 Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
SpiderPig Posted April 25 Author Share Posted April 25 6 hours ago, Josh said: Yes, I always forget which is which. Maybe these should be ScreenToWorld and WorldToScreen? Yeah, in one of my projects I made a wrapper for them. I called them CastToScreen and CastToWorld. Naming them to show what they do will help. Quote Link to comment Share on other sites More sharing options...
SpiderPig Posted April 25 Author Share Posted April 25 6 hours ago, Josh said: z coordinate is the distance in front of the camera Ah so it needs to be a float then. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.