Weaponimage disappears when looking in certain angles.
by Stefan Lundmark · in Torque Game Engine · 09/26/2004 (2:21 pm) · 16 replies
Hello
When the weaponimage starts disappearing in certain angles (mostly when you look straight and a bit upwards) I feel like I'm going to burst. :P
I don't know where to look and the logfiles show nothing.
So I figured it was my model. Changed it to the standard crossbow, still the same problem. When facing down it's almost always visible, not not when you're looking up.
I thought it was something with occlusion and terrain, so I removed the terrain. Problem still there.
Anyone seen this behaviour before?
When the weaponimage starts disappearing in certain angles (mostly when you look straight and a bit upwards) I feel like I'm going to burst. :P
I don't know where to look and the logfiles show nothing.
So I figured it was my model. Changed it to the standard crossbow, still the same problem. When facing down it's almost always visible, not not when you're looking up.
I thought it was something with occlusion and terrain, so I removed the terrain. Problem still there.
Anyone seen this behaviour before?
About the author
#2
09/29/2004 (9:24 am)
Thanks Xavier, that works.
#3
10/02/2004 (8:36 pm)
Increasing the bounding box might cause other problems, we fixed the same problem by moving the eye cam back a bit.
#4
10/02/2004 (8:37 pm)
What kind of other problems?
#5
I think the best solution is to find the part in the engine that renders the gun and bypass any checks for bounds just for the render part but havent found the spot yet.
02/26/2005 (10:18 am)
By making the bound box bigger in the player.cs file you wind up being able to shoot way in front or behind a player to kill them. Also you can step off the edge of a building top and stand out in space which looks goofey.I think the best solution is to find the part in the engine that renders the gun and bypass any checks for bounds just for the render part but havent found the spot yet.
#6
11/14/2005 (10:33 am)
Has anyone come up with a fix for this yet? I've recently been having this problem as well, only my is when looking down at an angle. I tried increasing the bounding box a little bit, and that worked for about an hour then it went back to being broke. I've also tried moving the eye cam but it hasn't affected it.
#7
11/15/2005 (3:56 pm)
The only reason for it to disappear is because the bounds box is too small to encompass both the player and the gun, so make it yet bigger.
#8
11/16/2005 (6:15 am)
Yeah that's the problem, that solution doesn't work for me. I need the smaller bounding box that I've created. The missions focus on close quarter combat and we've got some really narrow stairwells and hallways in some buildings and the values that fix the problem screw things up there. This demo is going to be shown at I/ITSEC which means I've got about a week and a half. I've since learned that the visibility of the object is tied in with the bounding box.
#9
11/17/2005 (7:56 pm)
Well, it has to be in something that calls the rendering code for the weapon or something that controls the rendering code for the weapon. I think I remember seeing somewhere that a shapebase object calls to render mounted images. Player may be different. I would look there to start. Possibly that is an obvious suggestion, but maybe it will help.
#10
11/18/2005 (6:56 am)
I think I may have found a solution. It involves manually setting the bounding box. I'll let you know if it works.
#11
11/18/2005 (7:26 am)
Ok, it worked. I've got the new positions resource integrated in and I realized that in setPlayerPosition the bounding box was being resized. So I figured, why not make it do a more custom box? So I was able to put in the script the values that allowed me to see the weaponimage and in the code I just trimmed off the sides that needed trimming. The only variable I needed to adjust was mObjBox.min.y as the back half of the box was way too long.
#12
The line that you need to play with is: boundingBox = "1.2 1.2 2.3"; (Line 579)
In my case I modified the last number from 2.3 to 2.5 to make the box taller. To see if this is your problem, go into Inspection Mode (F11) and then Alt-C to go into camera mode. Fly around until you find your player and move the cursor on top of it. The box that forms around your player should completely enclose the player mesh. In my case the head was not in the box that of course included the Eye node.
Hope this helps!
12/29/2005 (10:34 am)
I fixed this problem in a different way and thought it might be of interest. I fixed the 1st person problem of the vanishing crossbow by changing the bounding box settings in the player.cs in the server->scripts directory. The line that you need to play with is: boundingBox = "1.2 1.2 2.3"; (Line 579)
In my case I modified the last number from 2.3 to 2.5 to make the box taller. To see if this is your problem, go into Inspection Mode (F11) and then Alt-C to go into camera mode. Fly around until you find your player and move the cursor on top of it. The box that forms around your player should completely enclose the player mesh. In my case the head was not in the box that of course included the Eye node.
Hope this helps!
#13
12/29/2005 (2:13 pm)
Which is what i've been saying all the time...
#14
my weapon has hand use to 1rd ,but in 3rd weapon has hand still! how can i look hand in 1rd but not in 3rd?
04/28/2006 (12:57 am)
Help me! help me! how to hide hand?my weapon has hand use to 1rd ,but in 3rd weapon has hand still! how can i look hand in 1rd but not in 3rd?
Torque 3D Owner Xavier "eXoDuS" Amado
Default Studio Name