RuntimeMeshCollision.h
Go to the documentation of this file.
1 // Copyright 2016-2018 Chris Conway (Koderz). All Rights Reserved.
2 
3 #pragma once
4 
5 #include "Engine/Engine.h"
6 #include "Components/MeshComponent.h"
7 #include "RuntimeMeshCollision.generated.h"
8 
9 struct RUNTIMEMESHCOMPONENT_API FRuntimeMeshCollisionSection
10 {
11  TArray<FVector> VertexBuffer;
12 
13  TArray<int32> IndexBuffer;
14 
15  friend FArchive& operator <<(FArchive& Ar, FRuntimeMeshCollisionSection& Section)
16  {
17  Ar << Section.VertexBuffer;
18  Ar << Section.IndexBuffer;
19  return Ar;
20  }
21 };
22 
23 struct RUNTIMEMESHCOMPONENT_API FRuntimeMeshCollisionConvexMesh
24 {
25  TArray<FVector> VertexBuffer;
27 
28  friend FArchive& operator <<(FArchive& Ar, FRuntimeMeshCollisionConvexMesh& Section)
29  {
30  Ar << Section.VertexBuffer;
31  Ar << Section.BoundingBox;
32  return Ar;
33  }
34 };
35 
36 
37 USTRUCT(BlueprintType)
38 struct RUNTIMEMESHCOMPONENT_API FRuntimeMeshCollisionSphere
39 {
40  GENERATED_USTRUCT_BODY()
41 
42 
43  UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = RuntimeMeshCollisionSphere)
44  FVector Center;
45 
47  UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = RuntimeMeshCollisionSphere)
48  float Radius;
49 
50  FRuntimeMeshCollisionSphere()
51  : Center(FVector::ZeroVector)
52  , Radius(1)
53  {
54 
55  }
56 
58  : Center(FVector::ZeroVector)
59  , Radius(r)
60  {
61 
62  }
63 
64  friend FArchive& operator <<(FArchive& Ar, FRuntimeMeshCollisionSphere& Sphere)
65  {
66  Ar << Sphere.Center;
67  Ar << Sphere.Radius;
68  return Ar;
69  }
70 };
71 
72 
73 USTRUCT(BlueprintType)
74 struct RUNTIMEMESHCOMPONENT_API FRuntimeMeshCollisionBox
75 {
76  GENERATED_USTRUCT_BODY()
77 
78 
79  UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = RuntimeMeshCollisionBox)
80  FVector Center;
81 
83  UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = RuntimeMeshCollisionBox)
84  FRotator Rotation;
85 
87  UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = RuntimeMeshCollisionBox)
88  FVector Extents;
89 
90 
91  FRuntimeMeshCollisionBox()
92  : Center(FVector::ZeroVector)
93  , Rotation(FRotator::ZeroRotator)
94  , Extents(1, 1, 1)
95  {
96 
97  }
98 
100  : Center(FVector::ZeroVector)
101  , Rotation(FRotator::ZeroRotator)
102  , Extents(s, s, s)
103  {
104 
105  }
106 
107  FRuntimeMeshCollisionBox(float InX, float InY, float InZ)
108  : Center(FVector::ZeroVector)
109  , Rotation(FRotator::ZeroRotator)
110  , Extents(InX, InY, InZ)
111 
112  {
113 
114  }
115 
116  friend FArchive& operator <<(FArchive& Ar, FRuntimeMeshCollisionBox& Box)
117  {
118  Ar << Box.Center;
119  Ar << Box.Rotation;
120  Ar << Box.Extents;
121  return Ar;
122  }
123 };
124 
125 USTRUCT(BlueprintType)
126 struct RUNTIMEMESHCOMPONENT_API FRuntimeMeshCollisionCapsule
127 {
128  GENERATED_USTRUCT_BODY()
129 
130 
131  UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = RuntimeMeshCollisionCapsule)
132  FVector Center;
133 
135  UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = RuntimeMeshCollisionCapsule)
136  FRotator Rotation;
137 
139  UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = RuntimeMeshCollisionCapsule)
140  float Radius;
141 
143  UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = RuntimeMeshCollisionCapsule)
144  float Length;
145 
146  FRuntimeMeshCollisionCapsule()
147  : Center(FVector::ZeroVector)
148  , Rotation(FRotator::ZeroRotator)
149  , Radius(1), Length(1)
150 
151  {
152 
153  }
154 
155  FRuntimeMeshCollisionCapsule(float InRadius, float InLength)
156  : Center(FVector::ZeroVector)
157  , Rotation(FRotator::ZeroRotator)
158  , Radius(InRadius), Length(InLength)
159  {
160 
161  }
162 
163  friend FArchive& operator <<(FArchive& Ar, FRuntimeMeshCollisionCapsule& Capsule)
164  {
165  Ar << Capsule.Center;
166  Ar << Capsule.Rotation;
167  Ar << Capsule.Radius;
168  Ar << Capsule.Length;
169  return Ar;
170  }
171 };
GLdouble s
FRuntimeMeshCollisionCapsule(float InRadius, float InLength)
std::ostream & operator<<(std::ostream &os, const textual_icon &i)
Definition: model-views.h:118
FRuntimeMeshCollisionBox(float InX, float InY, float InZ)
GLdouble GLdouble r


librealsense2
Author(s): Sergey Dorodnicov , Doron Hirshberg , Mark Horn , Reagan Lopez , Itay Carpis
autogenerated on Mon May 3 2021 02:47:41