Laurens Posted December 26, 2009 Share Posted December 26, 2009 Hi Ubu, I was just looking at the code of your library and noticed that CameraProject and CameraUnproject return void and take only two parameters (camera and position). As far as I can see, position is either used to specify the position to project/unproject or to store the results in. Is this intended? How would I project/unproject a position? Great work on the wrapper though! Cheers! Quote Link to comment Share on other sites More sharing options...
TylerH Posted December 26, 2009 Share Posted December 26, 2009 The command replaces the values in the vec3 you pass in to the projected/unprojected coordinates respectively. Kind of sloppy, but passing my reference is indeed faster than it returning a copy of the vec3. Quote nVidia 530M Intel Core i7 - 2.3Ghz 8GB DDR3 RAM Windows 7 Ultimate (64x)----- Visual Studio 2010 Ultimate Google Chrome Creative Suite 5 FL Studio 10 Office 15 ----- Expert Professional Expert BMX Programmer ----- Link to comment Share on other sites More sharing options...
Laurens Posted December 27, 2009 Author Share Posted December 27, 2009 Ah got it! Thanks! Quote Link to comment Share on other sites More sharing options...
L B Posted December 27, 2009 Share Posted December 27, 2009 These were indeed marked "To review" in my code. Tell me if that seems to fit you more, it will be in the next version: public Vector3 Project(Vector3 position) { float[] result = new float[3]; Core.CameraProject(this.Pointer, result); return new Vector3(result); } public Vector3 Unproject(Vector3 position) { float[] result = new float[3]; Core.CameraUnproject(this.Pointer, result); return new Vector3(result); } Thanks for reporting bugs Laurens Quote Link to comment Share on other sites More sharing options...
Laurens Posted December 27, 2009 Author Share Posted December 27, 2009 That looks way better, looking forward to it Thanks for keeping up the great work on the wrapper 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.