MF_FxController
Describes the properties of a turret, and it will control the aiming of your turret. Place this in the root GameObject of your turret. Typically, this will be aiming a weapon at a target, but can be used with cameras, or other rotating objects.
Public Interface IFxUser
Offers an alternate way to track turret states. In this case, the turret can send a TurretEventType to any class that implements ITurretEvents.
TurretEvent : void ( eventType : TurretEventType )
enum TurretEventType { AimedAtTarget, GainedTargetAim, LostTargetAim, GainedTarget, LostTarget }
Text
Public Methods
AimCheck : bool ( aimTolerance : float )
AimCheck : bool ( targetSize : float, aimTolerance : float )
Returns true if the turret is aimed properly to hit the target. This takes into account intercept and ballistics.
targetSize in meters is the average size of the target. AimCheck() will use this to compute the angular size of the target.
aimTolerance is the angle is how close (in degrees) to the direction to the target location necessary to return a true result. This will be added to any given targetSize. Avoid using 0 due to floating point errors.
ClearAngleGoal : void ()
Clears and angle goal set by SetAngleGoal() and allows the turret to rotate as needed.
Public Variables
editorTarget : Transform
Target that can be initially set in the editor. Changing this during runtime has no effect.
aimType : AimType enum { Direct, Intercept, Ballistic, BallisticIntercept }
Direct: Will aim directly at target.
Intercept: Will compute linear intercept to hit a moving target.
Ballistic: Will aim in a ballistic arc to hit a target not moving relative to turret.
BallisticIntercept: Will aim in a ballistic arc to hit a target moving relative to the turret.
Public Class TurretEventTarget
A wrapper class is used because the editor doesn't serialize interfaces. The GameObjects will be searched for ITurretEvents upon Awake()
gameObject : GameObject
[Hidden] ITurretEvents : eventTarget
Public Class AudioObject
pitchMin : float
Minimum pitch multiplier at near 0 turn rate.
Describes the properties of a turret, and it will control the aiming of your turret. Place this in the root GameObject of your turret. Typically, this will be aiming a weapon at a target, but can be used with cameras, or other rotating objects.
Public Interface IFxUser
Offers an alternate way to track turret states. In this case, the turret can send a TurretEventType to any class that implements ITurretEvents.
TurretEvent : void ( eventType : TurretEventType )
enum TurretEventType { AimedAtTarget, GainedTargetAim, LostTargetAim, GainedTarget, LostTarget }
Text
Public Methods
AimCheck : bool ( aimTolerance : float )
AimCheck : bool ( targetSize : float, aimTolerance : float )
Returns true if the turret is aimed properly to hit the target. This takes into account intercept and ballistics.
targetSize in meters is the average size of the target. AimCheck() will use this to compute the angular size of the target.
aimTolerance is the angle is how close (in degrees) to the direction to the target location necessary to return a true result. This will be added to any given targetSize. Avoid using 0 due to floating point errors.
ClearAngleGoal : void ()
Clears and angle goal set by SetAngleGoal() and allows the turret to rotate as needed.
Public Variables
editorTarget : Transform
Target that can be initially set in the editor. Changing this during runtime has no effect.
aimType : AimType enum { Direct, Intercept, Ballistic, BallisticIntercept }
Direct: Will aim directly at target.
Intercept: Will compute linear intercept to hit a moving target.
Ballistic: Will aim in a ballistic arc to hit a target not moving relative to turret.
BallisticIntercept: Will aim in a ballistic arc to hit a target moving relative to the turret.
Public Class TurretEventTarget
A wrapper class is used because the editor doesn't serialize interfaces. The GameObjects will be searched for ITurretEvents upon Awake()
gameObject : GameObject
[Hidden] ITurretEvents : eventTarget
Public Class AudioObject
pitchMin : float
Minimum pitch multiplier at near 0 turn rate.