CARLA
Loading...
Searching...
No Matches
BaseVegetationActor.h
Go to the documentation of this file.
1// Copyright (c) 2026 Computer Vision Center (CVC) at the Universitat Autonoma
2// de Barcelona (UAB).
3//
4// This work is licensed under the terms of the MIT license.
5// For a copy, see <https://opensource.org/licenses/MIT>.
6
7#pragma once
8
10
11#include <util/ue-header-guard-begin.h>
12#include "GameFramework/Actor.h"
13#include <util/ue-header-guard-end.h>
14
15#include "BaseVegetationActor.generated.h"
16
17USTRUCT(BlueprintType)
19{
20 GENERATED_BODY()
21 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Spring Based Vegetation Component")
22 float Beta = 0.5f;
23
24 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Spring Based Vegetation Component")
25 float Alpha = 0.f;
26
27 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Spring Based Vegetation Component")
28 FVector Gravity = FVector(0,0,-1);
29
30 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Spring Based Vegetation Component")
31 float BaseSpringStrength = 10000.f;
32
33 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Spring Based Vegetation Component")
34 float MinSpringStrength = 2000.f;
35
36 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Spring Based Vegetation Component")
37 float HorizontalFallof = 0.1f;
38
39 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Spring Based Vegetation Component")
40 float VerticalFallof = 0.1f;
41
42 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Spring Based Vegetation Component")
43 float RestFactor = 0.5f;
44
45 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Spring Based Vegetation Component")
46 float DeltaTimeOverride = -1.f;
47
48 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Spring Based Vegetation Component")
49 float CollisionForceParameter = 10.f;
50
51 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Spring Based Vegetation Component")
52 float CollisionForceMinVel = 1.f;
53
54 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Spring Based Vegetation Component")
55 float ForceDistanceFalloffExponent = 1.f;
56 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Spring Based Vegetation Component")
57 float ForceMaxDistance = 180.f;
58 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Spring Based Vegetation Component")
59 float MinForceFactor = 0.01;
60 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Spring Based Vegetation Component")
61 float LineTraceMaxDistance = 180.f;
62 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Spring Based Vegetation Component")
63 float CapsuleRadius = 6.0f;
64 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Spring Based Vegetation Component")
65 float MinBoneLength = 10.f;
66 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Spring Based Vegetation Component")
67 FVector SpringStrengthMulFactor = FVector(1,1,1);
68 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Spring Based Vegetation Component")
69 float VehicleCenterZOffset = 120.f;
70
71 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Spring Based Vegetation Component")
73
74 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Spring Based Vegetation Component")
75 bool bAutoComputeStrength = true;
76
77};
78
79UCLASS()
80class CARLA_API ABaseVegetationActor : public AActor
81{
82 GENERATED_BODY()
83
84public:
85
86 virtual void BeginPlay() override;
87
88 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Spring Based Vegetation")
90
91 UFUNCTION(BlueprintCallable, CallInEditor, Category = "Spring Based Vegetation")
92 void GetParametersFromComponent();
93
94 UFUNCTION(BlueprintCallable, CallInEditor, Category = "Spring Based Vegetation")
95 void SetParametersToComponent();
96
97 UFUNCTION(BlueprintCallable, CallInEditor, Category = "Spring Based Vegetation")
98 void UpdateSkeletonAndParameters();
99
100};