mirror of
https://github.com/sinbad/StevesUEHelpers.git
synced 2025-02-23 09:35:25 +00:00
Allow VLOG of camera collision to be turned on/off in the editor
This commit is contained in:
parent
7127c9e729
commit
92d7000dbe
@ -1,10 +1,8 @@
|
|||||||
|
|
||||||
#include "StevesSpringArmComponent.h"
|
#include "StevesSpringArmComponent.h"
|
||||||
|
|
||||||
#include "StevesUEHelpers.h"
|
#include "StevesUEHelpers.h"
|
||||||
|
|
||||||
// Set this to 1 to VLOG where camera is being occluded from
|
|
||||||
#define ENABLE_VLOG_CAMERA_OCCLUSION 0
|
|
||||||
|
|
||||||
UStevesSpringArmComponent::UStevesSpringArmComponent()
|
UStevesSpringArmComponent::UStevesSpringArmComponent()
|
||||||
{
|
{
|
||||||
@ -17,9 +15,8 @@ FVector UStevesSpringArmComponent::BlendLocations(const FVector& DesiredArmLocat
|
|||||||
float DeltaTime)
|
float DeltaTime)
|
||||||
{
|
{
|
||||||
|
|
||||||
#if ENABLE_VLOG_CAMERA_OCCLUSION
|
#if WITH_EDITORONLY_DATA && ENABLE_VISUAL_LOG
|
||||||
#if ENABLE_VISUAL_LOG
|
if (bHitSomething && bVisualLogCameraCollision)
|
||||||
if (bHitSomething)
|
|
||||||
{
|
{
|
||||||
FVector NewDesiredLoc = PreviousDesiredLoc - PreviousDesiredRot.Vector() * TargetArmLength;
|
FVector NewDesiredLoc = PreviousDesiredLoc - PreviousDesiredRot.Vector() * TargetArmLength;
|
||||||
// Add socket offset in local space
|
// Add socket offset in local space
|
||||||
@ -33,7 +30,7 @@ FVector UStevesSpringArmComponent::BlendLocations(const FVector& DesiredArmLocat
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
#endif
|
|
||||||
// These locations are in world space, we only want to blend the arm length, not the rest
|
// These locations are in world space, we only want to blend the arm length, not the rest
|
||||||
const FVector Base = Super::BlendLocations(DesiredArmLocation, TraceHitLocation, bHitSomething, DeltaTime);
|
const FVector Base = Super::BlendLocations(DesiredArmLocation, TraceHitLocation, bHitSomething, DeltaTime);
|
||||||
|
|
||||||
|
@ -21,6 +21,10 @@ public:
|
|||||||
protected:
|
protected:
|
||||||
TOptional<float> PrevArmLength;
|
TOptional<float> PrevArmLength;
|
||||||
|
|
||||||
|
#if WITH_EDITORONLY_DATA
|
||||||
|
UPROPERTY(Transient, EditAnywhere, Category=CameraCollision)
|
||||||
|
bool bVisualLogCameraCollision = false;
|
||||||
|
#endif
|
||||||
|
|
||||||
public:
|
public:
|
||||||
UStevesSpringArmComponent();
|
UStevesSpringArmComponent();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user