Aiming high on wide squat targets.
by Kimberly Unger · in Torque Game Engine · 03/09/2004 (1:21 pm) · 6 replies
We are targeting at a wide nut squat player. When we target him the shot goes high (over). We've been looking into the code for both setting the target of a weapon.
setAimLocation(%TargetPos);
and
setAttackObject(%TargetObj);
We've also looked into the actual onFire logic and the
%muzzleVector = %obj.getMuzzleVector(%slot);
In looking into the engine code I found two functions that get the muzzleVector, on for use in the script and the other for rendering
getMuzzleVector() and
getRenderMuzzleVector() which are logicly identical (possible place for some code emprovent here). From what we see the aiming point is calculated using the eyepoint of the shooter and the head point of the target. Is this correct? Is this what is causeing the overshoot? If not can anyone help us out?
Beau
EKM's programmer
setAimLocation(%TargetPos);
and
setAttackObject(%TargetObj);
We've also looked into the actual onFire logic and the
%muzzleVector = %obj.getMuzzleVector(%slot);
In looking into the engine code I found two functions that get the muzzleVector, on for use in the script and the other for rendering
getMuzzleVector() and
getRenderMuzzleVector() which are logicly identical (possible place for some code emprovent here). From what we see the aiming point is calculated using the eyepoint of the shooter and the head point of the target. Is this correct? Is this what is causeing the overshoot? If not can anyone help us out?
Beau
EKM's programmer
#2
I'm not sure what you suggestion about placing a a small object at the targeted position. Do you mean at the location I'm using in setAimLocation()?
Beau;
P.S.
As to having the two functions getMuzzleVector() & getRenderMuzzleVector(). I think I see where I went off... It's the use of getRenderMuzzleTransform(imageSlot,&mat);
and
getMuzzleTransform(imageSlot,&mat); isn't it?
03/10/2004 (7:01 am)
Hi Ben;I'm not sure what you suggestion about placing a a small object at the targeted position. Do you mean at the location I'm using in setAimLocation()?
Beau;
P.S.
As to having the two functions getMuzzleVector() & getRenderMuzzleVector(). I think I see where I went off... It's the use of getRenderMuzzleTransform(imageSlot,&mat);
and
getMuzzleTransform(imageSlot,&mat); isn't it?
#3
Should the target object's position, as returned by getPosition(), and it's World Box Center, as returned by getWorldBoxCenter(), be identical?
03/10/2004 (8:04 am)
Hey Ben,Should the target object's position, as returned by getPosition(), and it's World Box Center, as returned by getWorldBoxCenter(), be identical?
#4
03/10/2004 (11:10 am)
What effect, if any would the target object not having a "Head" but eyepoints have on aiming at the target?
#5
03/10/2004 (3:41 pm)
Kimberly - yes. That way you can see where the AIPlayer thinks it is shooting.
#6
I added code to place an object where the projectile is being told to aim at and it appears to being given the correct location. The onl logical concultion I can draw is that there is a problem with how the projectile vector is being calculated at time of firing.
Could this be?
Beau
EKM's programmer.
03/10/2004 (5:48 pm)
Hi Ben;I added code to place an object where the projectile is being told to aim at and it appears to being given the correct location. The onl logical concultion I can draw is that there is a problem with how the projectile vector is being calculated at time of firing.
Could this be?
Beau
EKM's programmer.
Associate Kyle Carter
Have you tried placing a small object at the targetted position? Maybe you have some bounding box issues.