Game Development Community

[BUG 1.0 RESOLVED] Gun in Head FirstPerson

by Steve Acaster · in Torque 3D Professional · 09/29/2009 (5:17 pm) · 6 replies

First person appears to be using the eyenode instead of mountpoint0, thus causing the (custom) Gun in Head syndrome. Renders at the correct position (mountpoint0) in 3rd person.

Obviously I am not using eyeoffset, which would cause the weapon to not animate with the arms (I broke the English language then)

Not an issue in betas.

img80.imageshack.us/img80/1180/guninhead.jpg
Ouchie! More than aspirin required for this

Also gun appears to vanish totally inside a zone if not looking into a portal ... but one issue at a time.

edit: Just to add; the muzzleflash and projectile both appear as they would from the mountpoint0 position and not from the gun in head rendering model.

Update: Resolved and moved there

#1
09/29/2009 (9:00 pm)
img193.imageshack.us/img193/1655/guninheadstock.jpg
And just to show that this faux pais isn't mine (cos something else I was about to write a thread about was) Gun-in-Head affects stock models too, indeed anything mounted to mount0 which does not use eyeoffset is affected this way whilst in first person.

Replicateable in New Project and FPS Example by commenting out eyeoffset in any of the 2 stock weapon files.
//eg:

datablock ShapeBaseImageData(RocketLauncherImage)
{
   // Basic Item properties
   shapefile = "art/shapes/weapons/SwarmGun/swarmgun.dts";
   emap = true;

   // Specify mount point & offset for 3rd person, and eye offset
   // for first person rendering.
   mountPoint = 0;
   offset = "0.0 0.15 0.025";
   eyeOffset = "0.25 0.6 -0.4"; // 0.25=right/left 0.5=forward/backward, -0.5=up/down

//to

   mountPoint = 0;
//   offset = "0.0 0.15 0.025";
//   eyeOffset = "0.25 0.6 -0.4"; // 0.25=right/left 0.5=forward/backward, -0.5=up/down
#2
09/29/2009 (9:54 pm)
Bleh! Uh! Yeah, I don't think that's right. Something new, something awful... I wonder why?
#3
09/30/2009 (1:42 am)
Ahha, found it.

Player.cpp line 4003

This line:
if ( !rstate.getSceneState()->isShadowPass() && isFirstPerson() )

Should be this:

if ( !rstate.getSceneState()->isShadowPass() && isFirstPerson() && data.useEyeOffset )
#4
09/30/2009 (10:19 am)
I figured it'd be a one line fix - Line 3967 in Release.

Bit of glaring one to slip through into 1.0, but if that's the closest there is to a "show stopper", I reckon release went fairly well.

This also seems to clear up this issue with the gun colliding with triggers.

Graciously moved to Resolved.
#5
09/30/2009 (12:53 pm)
I hope to get some time to work on my project tonight and test if my issues with triggers can be solved with this fix also.
#6
09/30/2009 (6:47 pm)
Thanks James!

So used to working with the Torque 3D examples that do use eyeOffset that I had forgotten to check my own things until Steve reported this... glad to see it resolved :)