MCPcopy Create free account
hub / github.com/arnaud-jamin/Cog / TickComponent

Method TickComponent

Source/CogSample/CogSampleProjectileComponent.cpp:169–219  ·  view source on GitHub ↗

--------------------------------------------------------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

167
168//--------------------------------------------------------------------------------------------------------------------------
169void UCogSampleProjectileComponent::TickComponent(float DeltaTime, enum ELevelTick TickType, FActorComponentTickFunction* ThisTickFunction)
170{
171 //if (CosmeticComponent != nullptr)
172 //{
173 // CosmeticComponent->AddLocalRotation(CurrentCosmeticAngularVelocity * DeltaTime);
174 // CurrentCosmeticAngularVelocity *= FMath::Clamp(1.0f - CosmeticAngularDrag * DeltaTime, 0.0f, 1.0f);
175 //}
176
177 //PreviousVelocity = Velocity;
178
179 Super::TickComponent(DeltaTime, TickType, ThisTickFunction);
180
181 //TravelingTime += DeltaTime;
182
183#if ENABLE_COG && !NO_LOGGING
184
185 if (FCogDebugLog::IsLogCategoryActive(LogCogProjectile))
186 {
187 const float CollisionRadius = Collision != nullptr ? Collision->GetScaledSphereRadius() : 0.0f;
188 const float AssistanceRadius = AssistanceOverlap != nullptr ? AssistanceOverlap->GetScaledSphereRadius() : 0.0f;
189 const float DebugRadius = FMath::Max(CollisionRadius, AssistanceRadius);
190 const bool Show = SpawnPrediction == nullptr || SpawnPrediction->GetRole() != ECogSampleSpawnPredictionRole::Replicated;
191 const FColor Color = (SpawnPrediction != nullptr ? SpawnPrediction->GetRoleColor() : FColor(128, 128, 128, 255)).WithAlpha(IsCatchingUp ? 100 : 255);
192
193 if (Show && UpdatedComponent != nullptr)
194 {
195 const FVector Location = UpdatedComponent->GetComponentLocation();
196 const FVector Delta = Location - LastDebugLocation;
197
198 if (LogCogProjectile.GetVerbosity() == ELogVerbosity::VeryVerbose)
199 {
200 FCogDebugDraw::Sphere(LogCogProjectile, GetOwner(), Location, DebugRadius, Color, true, 0);
201 FCogDebugDraw::Axis(LogCogProjectile, GetOwner(), Location, UpdatedComponent->GetComponentRotation(), 50.0f, true, 0);
202 }
203 else
204 {
205 FCogDebugDraw::Point(LogCogProjectile, GetOwner(), Location, 5.0f, Color, true, 0);
206 }
207
208 if (Delta.IsNearlyZero() == false)
209 {
210 FCogDebugDraw::Segment(LogCogProjectile, GetOwner(), LastDebugLocation, Location, Color, true, 0);
211 }
212
213 LastDebugLocation = Location;
214 }
215
216 }
217
218#endif //ENABLE_COG && !NO_LOGGING
219}
220//--------------------------------------------------------------------------------------------------------------------------
221void UCogSampleProjectileComponent::Catchup(float CatchupDuration)
222{

Callers

nothing calls this directly

Calls 3

GetOwnerFunction · 0.85
GetRoleMethod · 0.80
GetRoleColorMethod · 0.80

Tested by

no test coverage detected