CreativeOcclusion Posted October 2, 2012 Share Posted October 2, 2012 I have just started working with leadwerks. i have been playing with the tunnels.sbx example. i was just wondering if there is a way to control the zdepth of the weapon to keep it from poking through the walls? i have looked at the fpscontroller.lua in the scripts file and and tried to increase the radius of the controller, but the gun still goes into the wall. any help will be appreciated. thanks in advance. Quote Link to comment Share on other sites More sharing options...
Pixel Perfect Posted October 2, 2012 Share Posted October 2, 2012 You could try disabling the weapon's material depthtest by setting depthtest=0 in the mat file This is taken from the Materials section on the Wiki: depthtestIf disabled the surface will be drawn on top of all previously rendered surfaces. However, triangles within a surface may not appear in correct order. This might cause issues of its own though! Quote Intel Core i5 2.66 GHz, Asus P7P55D, 8Gb DDR3 RAM, GTX460 1Gb DDR5, Windows 7 (x64), LE Editor, GMax, 3DWS, UU3D Pro, Texture Maker Pro, Shader Map Pro. Development language: C/C++ Link to comment Share on other sites More sharing options...
Rick Posted October 2, 2012 Share Posted October 2, 2012 You might be able to place the weapon in another world and play around with how you clear the camera between world drawing. This way it'll can always look like it's always on top of everything and shouldn't look like it goes through anything. Quote Link to comment Share on other sites More sharing options...
Daimour Posted October 2, 2012 Share Posted October 2, 2012 You might be able to place the weapon in another world... With two worlds it can be tricky to light weapon properly. Quote Link to comment Share on other sites More sharing options...
Rick Posted October 2, 2012 Share Posted October 2, 2012 For sure. Every way is going to have it's challenges I think. I suppose one could loop through all entities in the main world and find lights and duplicate those in the "weapon" world via code to make it easier. Quote Link to comment Share on other sites More sharing options...
Pixel Perfect Posted October 2, 2012 Share Posted October 2, 2012 One other way I've seen suggested to avoid this issue is to raise the weapon when approaching obstacles (some simple ray casting would facilitate this). Quote Intel Core i5 2.66 GHz, Asus P7P55D, 8Gb DDR3 RAM, GTX460 1Gb DDR5, Windows 7 (x64), LE Editor, GMax, 3DWS, UU3D Pro, Texture Maker Pro, Shader Map Pro. Development language: C/C++ Link to comment Share on other sites More sharing options...
CreativeOcclusion Posted October 2, 2012 Author Share Posted October 2, 2012 thanks for the replies...i ended up moving the weapon back a little when colliding...works for now...thanks for the help...i know i will need plenty more help....thanks, CreativeOcclusion 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.