![]() |
Mortar Pro Plugin
Version 2
Modular Turret Plugin
|
#include <MortarProGenericMeshComponent.h>
Public Member Functions | |
float | GetDecelerateRotationRate () const |
float | GetMaxRecoilOffset () const |
float | GetMaxRecoilSpeed () const |
float | GetMaxRotationDegreesSpeed () const |
void | SetDecelerateRotationRate (const float &DecelerateRate) |
void | SetMaxRecoilOffset (const float &RecoilOffset) |
void | SetMaxRecoilSpeed (const float &MaxRecoilSpeed) |
void | SetMaxRotationDegreesSpeed (const float &Speed) |
void | StartRecoil () |
void | StartRotation () |
void | StopRotation () |
UMortarProGenericMeshComponent () | |
Protected Member Functions | |
virtual void | BeginPlay () override |
Protected Attributes | |
float | DecelerateRotationRate = 45.f |
int32 | MaxRecoilOffset = 15 |
float | MaxRecoilSpeed = 150.f |
float | MaxRotationDegreesSpeed = 500 |
Private Member Functions | |
void | DecelerateRotationTimerFunction () |
void | StartRecoilTimerFunction () |
void | StartRotationTimerFunction () |
Private Attributes | |
uint32 | bRecoilReverseOffset: 1 |
int32 | CurrMeshOffset = 0 |
FTimerHandle | DecelerateRotationTimerHandle |
float | DecelerateTimerRate = 0.5f |
float | OrignalMaxRotationDegreesSpeed = 0.f |
float | RecoilDuration = 0.1 |
float | RecoilTime = 0.f |
FTimerHandle | RecoilTimerHandle |
float | SmoothedDeltaTime = 0.0f |
float | SmoothingFactor = 0.2f |
FVector | StartLocation |
FTimerHandle | StartRotationTimerHandle |
FVector | TargetLocation |
float | TimerRate = 0.01f |
This is the extra componenet of mortar. This is not compulsory in the main mortar pawn This allows us to add more meshwith some built in movement like rotation,recoil effect etc
UMortarProGenericMeshComponent::UMortarProGenericMeshComponent | ( | ) |
|
overrideprotectedvirtual |
Called when the game starts or when spawned
|
private |
Reduces Rotation to 0.This is a call back function for stop rotation
float UMortarProGenericMeshComponent::GetDecelerateRotationRate | ( | ) | const |
Getter Function To get Decelerate Rotation Rate
float UMortarProGenericMeshComponent::GetMaxRecoilOffset | ( | ) | const |
Getter Function To get Max Recoil Offset
float UMortarProGenericMeshComponent::GetMaxRecoilSpeed | ( | ) | const |
Getter Function To get Max Recoil Speed
float UMortarProGenericMeshComponent::GetMaxRotationDegreesSpeed | ( | ) | const |
Getter Function To get Max Rotation Degrees Per Second
void UMortarProGenericMeshComponent::SetDecelerateRotationRate | ( | const float & | DecelerateRate | ) |
Sets how fast mesh will decelerate when we stop rotation. This helps in achieving slow deceleration instead of abrupt stop param[in] DecelerateRate Rate by which decrease rotation
void UMortarProGenericMeshComponent::SetMaxRecoilOffset | ( | const float & | RecoilOffset | ) |
Sets how much mesh will go in negative x direction param[in] RecoilOffset telling how much will the mesh will move
void UMortarProGenericMeshComponent::SetMaxRecoilSpeed | ( | const float & | MaxRecoilSpeed | ) |
Sets how fast mesh recoil in negative x direction param[in] Max Recoil speed per second denoting how fast will mesh go backwards
void UMortarProGenericMeshComponent::SetMaxRotationDegreesSpeed | ( | const float & | Speed | ) |
Sets Max Rotation Degrees Per Second for mesh. this defines how fast mesh will rotate around z axis param[in] MaxRotationDegrees Max Rotation Degrees speed that can be covered in a second
void UMortarProGenericMeshComponent::StartRecoil | ( | ) |
Function to Start Recoil. All Movement Happens in tick
|
private |
Reduces Rotation to 0
void UMortarProGenericMeshComponent::StartRotation | ( | ) |
Function to Start Rotation
|
private |
Cllback Function for Mesh Rotation
void UMortarProGenericMeshComponent::StopRotation | ( | ) |
Function to Start Movement
|
private |
Flag to reverse movement of mesh to forward instead of backwards
|
private |
Mesh Position Offset. That is where the mesh currently is
|
protected |
How much to reduce rotation per second
|
private |
Timer Handle For Rotation Stopping
|
private |
Timer Rate for Deacceleration timer
|
protected |
Maximum offset we will do for recoil effect for Mesh
|
protected |
Maximum rotation speed of Mesh
|
protected |
Maximum rotation speed of Mesh
|
private |
Stores Copy of MaxRotationDegreesSpeed;
|
private |
Duration for which recoil will happen
|
private |
Current Recoil Time. Increments with Delta time
|
private |
Timer Handle For Recoiling
|
private |
Smoothed delta time for recoil calculation
|
private |
Smoothing factor for delta time smoothing
|
private |
Start Relative Location of generic Mesh
|
private |
Timer Handle For Starting Mesh Rotation
|
private |
Target Relative Location of generic Mesh. This is For Recoil
|
private |
Timer Rate for Rotation