Jump to content

Culling mask for weapons


saindd

Recommended Posts

I'm pretty sure it already does this. I can't think of any examples where the gun doesn't render over things. The only difference is with T3D it pushes the weapon back as you get close to a wall. I haven't tested it, but I believe the only code doing this is this:


https://github.com/GarageGames/Torque3D/blob/development/Engine/source/T3D/shapeImage.cpp#L2155-L2189


Be advised though, that removing that bit will let you shoot through a wall. Once you move the muzzle into the wall the muzzle starting point will be past the wall and your bullet will start after the wall. I think this can be avoided by just approaching the problem from here:


https://github.com/GarageGames/Torque3D/blob/development/Engine/source/T3D/shapeImage.cpp#L1807-L1811


As far as I can tell removing that bit would prevent the rendered muzzle vector from being corrected for collision, but still leave the actual muzzle vector corrected. There is a chance drawing the weapon is depth tested ( I didn't look ), resulting in the weapon being clipped by the wall you're walking into, this can be avoid by turning off depth testing in the stateblock for the shape image.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

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