Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
FieldOfViewLimit
#1
Hello coders i want to make angle view of aim So i made it Code: case 1 : FieldOfViewLimit = 10 ; break ; case 2 : FieldOfViewLimit = 15 ; break ; case 3 : FieldOfViewLimit = 20 ; break ; case 4 : FieldOfViewLimit = 25 ; break ; case 5 : FieldOfViewLimit = 30 ; break ; case 6 : FieldOfViewLimit = 35 ; break ; case 7 : FieldOfViewLimit = 40 ; break ; case 8 : FieldOfViewLimit = 45 ; break ; case 9 : FieldOfViewLimit = 50 ; break ; case 10 : FieldOfViewLimit = 55 ; break ; case 11 : FieldOfViewLimit = 60 ; break ; case 12 : FieldOfViewLimit = 65 ; break ; case 13 : FieldOfViewLimit = 70 ; break ; case 14 : FieldOfViewLimit = 75 ; break ; case 15 : FieldOfViewLimit = 80 ; break ; case 16 : FieldOfViewLimit = 85 ; break ; case 17 : FieldOfViewLimit = 90 ; break ; but aim all the same use 360 SSystemGlobalEnvironment::GetInstance()->pIRenderer()->WorldToScreen(pExp->GBA()); what i should do?
Reply
#2
FieldOFView is not done with worldtoscreen, or i do not understand your code you have shown us. Code: bool InFOV ( Vec3 vPos ) { SMovementState sState ; pLclActor -> GetMovementController ()-> GetMovementState ( sState ); Vec3 vDir = vPos - sState . pos ; Vec3 AimDir = sState . aimDirection ; vDir . Normalize (); float fVal = acos ( vDir . Dot ( AimDir )/( AimDir . GetLength () * vDir . GetLength () ) ) * ( 180 / PI ); return ( fVal <= iFOV / 2 ); } iFOV is the number you want to set the fov limit.
Reply
#3
Set iFov to 360
Reply
#4
why you need Field Of View?
Reply
#5
So use the code I gave you to determine if the enemy is within your FOV setting to aim at them.
Reply
#6
Quote: Originally Posted by noobified999 So use the code I gave you to determine if the enemy is within your FOV setting to aim at them. do have discord or somthing else? what is SMovementState
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)