Skip to content

Commit 68d8edb

Browse files
authored
Merge pull request #45 from 902D9/feature/compatible
feat(UE_Assimp): rename ToVector to aiVector3DToVector, because the engine plugin "LidarPointCloud" already has a ToVector
2 parents 0af4d24 + 79e4931 commit 68d8edb

File tree

4 files changed

+16
-16
lines changed

4 files changed

+16
-16
lines changed

Source/UE_Assimp/Private/AICamera.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,15 +34,15 @@ float UAICamera::GetAspectRatio()
3434

3535
FVector UAICamera::GetPosition()
3636
{
37-
return ToVector( camera->mPosition);
37+
return aiVector3DToVector( camera->mPosition);
3838
}
3939

4040
FVector UAICamera::GetUpVector()
4141
{
42-
return ToVector( camera->mUp);
42+
return aiVector3DToVector( camera->mUp);
4343
}
4444

4545
FVector UAICamera::GetLookAtVector()
4646
{
47-
return ToVector( camera->mLookAt);
47+
return aiVector3DToVector( camera->mLookAt);
4848
}

Source/UE_Assimp/Private/AILight.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,17 +20,17 @@ TEnumAsByte<EAssimpLightType> UAILight::GetLightType()
2020

2121
FVector UAILight::GetLightPosition()
2222
{
23-
return ToVector(Light->mPosition);
23+
return aiVector3DToVector(Light->mPosition);
2424
}
2525

2626
FVector UAILight::GetLightDirection()
2727
{
28-
return ToVector(Light->mDirection);
28+
return aiVector3DToVector(Light->mDirection);
2929
}
3030

3131
FVector UAILight::GetUpDirection()
3232
{
33-
return ToVector(Light->mUp);
33+
return aiVector3DToVector(Light->mUp);
3434
}
3535

3636
float UAILight::GetAttenuationConstant()

Source/UE_Assimp/Private/AIMesh.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ void UAIMesh::GetMeshVertices(TArray<FVector>& Vertices)
3232
Vertices.AddUninitialized(Mesh->mNumVertices);
3333
for (unsigned int Index = 0; Index < Mesh->mNumVertices; Index++)
3434
{
35-
Vertices[Index] = ToVector(Mesh->mVertices[Index]);
35+
Vertices[Index] = aiVector3DToVector(Mesh->mVertices[Index]);
3636
}
3737
}
3838

@@ -52,7 +52,7 @@ void UAIMesh::GetMeshNormals(TArray<FVector>& Normals)
5252
Normals.AddUninitialized(Mesh->mNumVertices);
5353
for (unsigned int Index = 0; Index < Mesh->mNumVertices; Index++)
5454
{
55-
Normals[Index] = ToVector(Mesh->mNormals[Index]);
55+
Normals[Index] = aiVector3DToVector(Mesh->mNormals[Index]);
5656
}
5757
}
5858

@@ -93,12 +93,12 @@ void UAIMesh::GetMeshDataForProceduralMesh(TArray<FVector>& Vertices, TArray<int
9393

9494
for (unsigned int Index = 0; Index < Mesh->mNumVertices; Index++)
9595
{
96-
Normals[Index] = ToVector(Mesh->mNormals[Index]);
97-
Vertices[Index] = ToVector(Mesh->mVertices[Index]);
96+
Normals[Index] = aiVector3DToVector(Mesh->mNormals[Index]);
97+
Vertices[Index] = aiVector3DToVector(Mesh->mVertices[Index]);
9898

9999
if (Mesh->mTangents)
100100
{
101-
Tangents[Index].TangentX = ToVector(Mesh->mTangents[Index]);
101+
Tangents[Index].TangentX = aiVector3DToVector(Mesh->mTangents[Index]);
102102
}
103103

104104
if (Mesh->HasTextureCoords(0))
@@ -136,14 +136,14 @@ UStaticMesh* UAIMesh::GetStaticMesh()
136136
VertexInstances.AddUninitialized(Mesh->mNumVertices);
137137
for (unsigned int Index = 0; Index < Mesh->mNumVertices; Index++)
138138
{
139-
auto VertexID = MeshDescBuilder.AppendVertex(ToVector(Mesh->mVertices[Index]));
139+
auto VertexID = MeshDescBuilder.AppendVertex(aiVector3DToVector(Mesh->mVertices[Index]));
140140

141141
auto Instance = MeshDescBuilder.AppendInstance(VertexID);
142142
VertexInstances[Index] = Instance;
143143

144144
if(Mesh->HasNormals())
145145
{
146-
MeshDescBuilder.SetInstanceNormal(Instance,ToVector(Mesh->mNormals[Index]));
146+
MeshDescBuilder.SetInstanceNormal(Instance,aiVector3DToVector(Mesh->mNormals[Index]));
147147
}else
148148
{
149149
UE_LOG(LogAssimp,Warning,TEXT("Normals not found consider generating them with assimp"))

Source/UE_Assimp/Public/UE_Assimp.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
#pragma once
44

55
#include "assimp/Logger.hpp"
6-
#include "assimp/LogStream.hpp"
76
#include "Modules/ModuleManager.h"
8-
#define ToVector(In) FVector(In.x, In.y, In.z)
9-
#define ToVectorCM(In) FVector(In.x*100, In.y*100, In.z*100) //convert Meters to cm (DEPRECATED)
7+
// rename ToVector to aiVector3DToVector, because the engine plugin "LidarPointCloud" already has a ToVector
8+
#define aiVector3DToVector(In) FVector(In.x, In.y, In.z)
9+
#define aiVector3DToVectorCM(In) FVector(In.x*100, In.y*100, In.z*100) //convert Meters to cm (DEPRECATED)
1010
DECLARE_LOG_CATEGORY_EXTERN(LogAssimp, Log, All);
1111

1212

0 commit comments

Comments
 (0)