예제 #1
0
void FApexChunkReport::onStateChangeNotify(const apex::ChunkStateEventData& visibilityEvent)
{
	UDestructibleComponent* DestructibleComponent = Cast<UDestructibleComponent>(FPhysxUserData::Get<UPrimitiveComponent>(visibilityEvent.destructible->userData));
	check(DestructibleComponent);

	if (DestructibleComponent->IsPendingKill())	//don't notify if object is being destroyed
	{
		return;
	}

	DestructibleComponent->OnVisibilityEvent(visibilityEvent);
}
예제 #2
0
void FApexChunkReport::onDamageNotify(const apex::DamageEventReportData& damageEvent)
{
	UDestructibleComponent* DestructibleComponent = Cast<UDestructibleComponent>(FPhysxUserData::Get<UPrimitiveComponent>(damageEvent.destructible->userData));
	check(DestructibleComponent);

	if (DestructibleComponent->IsPendingKill())	//don't notify if object is being destroyed
	{
		return;
	}

	DestructibleComponent->GetWorld()->GetPhysicsScene()->AddPendingDamageEvent(DestructibleComponent, damageEvent);
}