Arma Reforger Script API
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | List of all members
ScriptedBaseZeroingGenerator Interface Reference
Inheritance diagram for ScriptedBaseZeroingGenerator:
[legend]

Public Member Functions

bool WB_GetZeroingData (float weaponAngle, float distance, out vector offset, out vector angles)
 Called to obtain zeroing data for a given weapon angle.
 
float WB_CalculateWeaponZeroingAnimationValue (float pitch, float distance, out vector offset, out vector angles)
 Return the animation value for the sights animation.
 
vector WB_GetPivotPoint ()
 Returns the pivot point of the sights.
 
bool WB_InitGenerator ()
 Initialize the generator.
 
void WB_CleanupGenerator ()
 Clean up.
 
- Public Member Functions inherited from BaseZeroingGenerator
proto external IEntity GetOwnerEntity ()
 Gets the owning entity of the generator object, which might or might not be the same as the owner of the Sights component.
 
proto external BaseSightsComponent GetSights ()
 Get the sights component that the zeroing is computed for.
 
proto external WeaponAnimationComponent GetWeaponAnimationComponent ()
 Get the Weapon animation component of the sights.
 
proto external void SetPointInfoGeneration (bool doGenerate)
 Flag the generation of PointInfo's.
 
proto external void SetProjectileResource (ResourceName resourceName)
 

Protected Member Functions

void OnInit (IEntity owner, BaseSightsComponent sights)
 Called on initialization.
 
void OnUpdate (IEntity owner, BaseSightsComponent sights, float timeSlice)
 Called every frame when active to update current state.
 

Member Function Documentation

◆ OnInit()

void ScriptedBaseZeroingGenerator.OnInit ( IEntity  owner,
BaseSightsComponent  sights 
)
protected

Called on initialization.

Parameters
ownerParent entity.
sightsParent sights component.

◆ OnUpdate()

void ScriptedBaseZeroingGenerator.OnUpdate ( IEntity  owner,
BaseSightsComponent  sights,
float  timeSlice 
)
protected

Called every frame when active to update current state.

Parameters
ownerParent entity.
sightsParent sights component.
timeSliceDelta of time since last update.

◆ WB_CalculateWeaponZeroingAnimationValue()

float ScriptedBaseZeroingGenerator.WB_CalculateWeaponZeroingAnimationValue ( float  pitch,
float  distance,
out vector  offset,
out vector  angles 
)

Return the animation value for the sights animation.

This usually outputs a value that makes the sight line up with the eye as close as possible.

Parameters
pitchThe angle at which the weapon is held.
distanceThe distance this zeroing data is calculated for
offsetoutput Computed offset of the weapon to the eye position
anglesoutput Computed angles for holding the weapon
Returns
a float value, usually between 0 and 1, representing the percentage to forward into the sights animation

Implemented in SCR_2DPiPScopeZeroingGenerator.

◆ WB_CleanupGenerator()

void ScriptedBaseZeroingGenerator.WB_CleanupGenerator ( )

Clean up.

This method is only called automatically if WB_InitGenerator has return true. Otherwise, cleanup either needs to take place within WB_InitGenerator itself, or WB_InitGenerator must call this function

◆ WB_GetPivotPoint()

vector ScriptedBaseZeroingGenerator.WB_GetPivotPoint ( )

Returns the pivot point of the sights.

Usually defined in the sights component, but might be missing if for example the front sight pivot is not on the owner but rather on the entity it is attached to (like the M203)

Parameters
ownerParent entity
sightsParent Sights component
Returns
pivot point

◆ WB_GetZeroingData()

bool ScriptedBaseZeroingGenerator.WB_GetZeroingData ( float  weaponAngle,
float  distance,
out vector  offset,
out vector  angles 
)

Called to obtain zeroing data for a given weapon angle.

Parameters
weaponAngleAngle how the weapon should be held
distanceThe distance this zeroing data is calculated for
offsetoutput Computed offset of the weapon to the eye position
anglesoutput Computed angles for holding the weapon
Returns
true if the value could be computed, false otherwise. Returning false usually implies that something catastrophic is wrong (missing sight component, missing owner, etc)

Implemented in SCR_2DPiPScopeZeroingGenerator.

◆ WB_InitGenerator()

bool ScriptedBaseZeroingGenerator.WB_InitGenerator ( )

Initialize the generator.

Returns
False if the initialization failed. This can be a misconfiguration of the prefab or any other reason

Implemented in SCR_2DPiPScopeZeroingGenerator.


The documentation for this interface was generated from the following file: