◆ OnInit()
Called on initialization.
- Parameters
-
owner | Parent entity. |
sights | Parent sights component. |
◆ OnUpdate()
void ScriptedBaseZeroingGenerator.OnUpdate |
( |
IEntity |
owner, |
|
|
BaseSightsComponent |
sights, |
|
|
float |
timeSlice |
|
) |
| |
|
protected |
Called every frame when active to update current state.
- Parameters
-
owner | Parent entity. |
sights | Parent sights component. |
timeSlice | Delta 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
-
pitch | The angle at which the weapon is held. |
distance | The distance this zeroing data is calculated for |
offset | output Computed offset of the weapon to the eye position |
angles | output 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
-
owner | Parent entity |
sights | Parent 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
-
weaponAngle | Angle how the weapon should be held |
distance | The distance this zeroing data is calculated for |
offset | output Computed offset of the weapon to the eye position |
angles | output 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:
- Game/generated/ScriptedBaseZeroingGenerator.c