Jump to content

Recommended Posts

Posted

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.

Posted

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:

depthtest

If 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!

 

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++

Posted

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.

Posted

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.

Posted

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).

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++

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...