Skip to content

Commit

Permalink
[unreal]FVector等几个系统USTUCT改为用模板绑定,以解决ue5下的精度丢失问题
Browse files Browse the repository at this point in the history
  • Loading branch information
chexiongsheng committed Nov 12, 2024
1 parent 7f560be commit 81f74d4
Show file tree
Hide file tree
Showing 16 changed files with 694 additions and 15,474 deletions.
766 changes: 32 additions & 734 deletions unreal/Puerts/Source/JsEnv/Private/Gen/FBox2D_Wrap.cpp

Large diffs are not rendered by default.

563 changes: 23 additions & 540 deletions unreal/Puerts/Source/JsEnv/Private/Gen/FColor_Wrap.cpp

Large diffs are not rendered by default.

425 changes: 21 additions & 404 deletions unreal/Puerts/Source/JsEnv/Private/Gen/FGuid_Wrap.cpp

Large diffs are not rendered by default.

735 changes: 30 additions & 705 deletions unreal/Puerts/Source/JsEnv/Private/Gen/FIntPoint_Wrap.cpp

Large diffs are not rendered by default.

654 changes: 26 additions & 628 deletions unreal/Puerts/Source/JsEnv/Private/Gen/FIntVector_Wrap.cpp

Large diffs are not rendered by default.

1,255 changes: 50 additions & 1,205 deletions unreal/Puerts/Source/JsEnv/Private/Gen/FLinearColor_Wrap.cpp

Large diffs are not rendered by default.

1,901 changes: 67 additions & 1,834 deletions unreal/Puerts/Source/JsEnv/Private/Gen/FQuat_Wrap.cpp

Large diffs are not rendered by default.

1,276 changes: 48 additions & 1,228 deletions unreal/Puerts/Source/JsEnv/Private/Gen/FRotator_Wrap.cpp

Large diffs are not rendered by default.

2,559 changes: 105 additions & 2,454 deletions unreal/Puerts/Source/JsEnv/Private/Gen/FTransform_Wrap.cpp

Large diffs are not rendered by default.

1,485 changes: 74 additions & 1,411 deletions unreal/Puerts/Source/JsEnv/Private/Gen/FVector2D_Wrap.cpp

Large diffs are not rendered by default.

1,219 changes: 52 additions & 1,167 deletions unreal/Puerts/Source/JsEnv/Private/Gen/FVector4_Wrap.cpp

Large diffs are not rendered by default.

3,220 changes: 123 additions & 3,097 deletions unreal/Puerts/Source/JsEnv/Private/Gen/FVector_Wrap.cpp

Large diffs are not rendered by default.

66 changes: 0 additions & 66 deletions unreal/Puerts/Source/JsEnv/Private/Gen/GenHeaders.h

This file was deleted.

7 changes: 6 additions & 1 deletion unreal/Puerts/Source/JsEnv/Private/Gen/UsingTypeDecl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,9 @@ UsingUStruct(FRotator);
UsingUStruct(FTransform);
UsingUStruct(FVector4);
UsingCppType(ScalarRegister);
UsingUStruct(FPlane);
UsingUStruct(FPlane);
UsingUStruct(FFloat16Color);
UsingUStruct(FMatrix);
UsingCppType(TArray<FVector2D>);
UsingUStruct(FIntVector4);
UsingCppType(VectorRegister);
27 changes: 27 additions & 0 deletions unreal/Puerts/Source/JsEnv/Public/DataTransfer.h
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,33 @@ struct TScriptStructTraits<FPlane>
}
};

template <>
struct TScriptStructTraits<FMatrix>
{
static UScriptStruct* Get()
{
return GetScriptStructInCoreUObject(TEXT("Matrix"));
}
};

template <>
struct TScriptStructTraits<FFloat16Color>
{
static UScriptStruct* Get()
{
return GetScriptStructInCoreUObject(TEXT("Float16Color"));
}
};

template <>
struct TScriptStructTraits<FIntVector4>
{
static UScriptStruct* Get()
{
return GetScriptStructInCoreUObject(TEXT("IntVector4"));
}
};

template <class...>
using ToVoid = void;

Expand Down
10 changes: 10 additions & 0 deletions unreal/Puerts/Source/JsEnv/Public/UEDataBinding.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -536,6 +536,16 @@ struct Converter<T, typename std::enable_if<internal::IsUStructHelper<T>::value>
}
};

template <typename T>
struct Converter<const T, typename std::enable_if<internal::IsUStructHelper<T>::value>::type> : Converter<T>
{
};

} // namespace v8_impl

template <typename T>
struct ScriptTypeName<const T, typename std::enable_if<internal::IsUStructHelper<T>::value>::type> : ScriptTypeName<T>
{
};

} // namespace PUERTS_NAMESPACE

0 comments on commit 81f74d4

Please sign in to comment.