Advertisement
BorrowTheProgrammer

floatingActor.h

Jun 12th, 2022
978
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.84 KB | None | 0 0
  1. // Fill out your copyright notice in the Description page of Project Settings.
  2.  
  3. #pragma once
  4.  
  5. #include <vector>
  6.  
  7. #include "CoreMinimal.h"
  8. #include "GameFramework/Actor.h"
  9. #include "FloatingActor.generated.h"
  10.  
  11. UCLASS()
  12. class FORLR_API AFloatingActor : public AActor
  13. {
  14.     GENERATED_BODY()
  15.    
  16.     // для того чтобы объект staticMesh был виден внутри движка
  17.     UPROPERTY(VisibleAnywhere)
  18.     UStaticMeshComponent *VisualMesh;
  19.  
  20. public:
  21.     // Sets default values for this actor's properties
  22.     AFloatingActor();
  23.    
  24.     UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="FloatingActor")
  25.     float FloatSpeed = 20.0f;
  26.    
  27.     UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="FloatingActor")
  28.     float RotationSpeed = 10.0f;
  29.  
  30. protected:
  31.     // Called when the game starts or when spawned
  32.     virtual void BeginPlay() override;
  33.    
  34.     int StartPoint, EndPoint;
  35.     float ActorSpeed;
  36.     FVector CurrentActorPosition, NextActorPosition;
  37.     std::vector<int> ActorShortPath;
  38.     bool ActorCanBeMoved;
  39.     int CurrentVertex;
  40.     std::vector<FVector> ActorPoints;
  41.     std::vector< std::vector<double> > CopiedMatrix;
  42.     ULineBatchComponent *LineBatch;
  43.     int NumberOfActors;
  44.     FLinearColor ActorPathColor;
  45.    
  46. public:
  47.     // Called every frame
  48.     virtual void Tick(float DeltaTime) override;
  49.  
  50.     void SetStartPoint(const int PointIndex);
  51.     void SetEndPoint(const int PointIndex);
  52.     void SetActorShortPath(const std::vector<int> ShortPath);
  53.     void SetActorSpeed(const float Speed);
  54.     void CreateActorPath();
  55.     void SetPoints(std::vector<FVector> GraphPoints);
  56.     void SetNumberOfActors(int ActorsNumber) { NumberOfActors = ActorsNumber; }
  57.     void SetActorPathColor(FLinearColor Color) { this-> ActorPathColor = Color; }
  58.     void CopyMatrix(std::vector< std::vector<double> > Matrix) { CopiedMatrix = Matrix; }
  59.     std::vector<int> getShortPathWhenFinished(int Start, int End);
  60. };
  61.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement