Commit Graph

729 Commits

Author SHA1 Message Date
matt breindel
e0875eb5df Updating docs for TRotator based on further discussion and experimentation. Rotator interprets angles as intrinsic rotations and applies them in the order yaw, pitch, then roll. Positive angles are left-handed around Z, right-handed around +Y, and right-handed around +X.
[REVIEW] [at]*zak.middleton [at]*tim.tillotson [at]steve.robb [at]robert.manuszewski
#rb [at]zak.middleton [at]steve.robb
#preflight none (comment only)

#ROBOMERGE-AUTHOR: matt.breindel
#ROBOMERGE-SOURCE: CL 19612632 via CL 19613597 via CL 19613826 via CL 19613926
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v938-19570697)

[CL 19615841 by matt breindel in ue5-main branch]
2022-04-04 17:58:40 -04:00
Zak Middleton
d9a2ab92f8 #ue5 - LWC: VectorMod() on Neon updated to match newer SSE implementation.
#jira none
#rb Dmytro.Vovk
#preflight 62460227e434babd8af9c24d

[CL 19579974 by Zak Middleton in ue5-main branch]
2022-03-31 18:09:52 -04:00
kriss gossart
5100b3d5a6 Add missing GetHash functions for TIntVector2 and TIntVector4.
#rb Benn.Gallagher
#jira none
#okforgithuib public
#preflight 6245bd20c51908059abcbee0

[CL 19572840 by kriss gossart in ue5-main branch]
2022-03-31 10:49:30 -04:00
jonathan adamczewski
e4e24758f8 IncludeTool: add UE_INCLUDETOOL_IGNORE_INCONSISTENT_STATE as a way to turn off warnings about inconsistent state, from code, in IncludeTool
#define UE_INCLUDETOOL_IGNORE_INCONSISTENT_STATE

... warning is ignored

#undef UE_INCLUDETOOL_IGNORE_INCONSISTENT_STATE

#jira none
#rb steve.robb
#rnx
#preflight 6244e0ac927e60e3415bf13f

[CL 19566668 by jonathan adamczewski in ue5-main branch]
2022-03-30 19:34:21 -04:00
Steve Robb
4bc29be92b Re-enable the removal of the legacy math macros from Core, removed in CL# 19494088.
A couple of other macro fixes in Core.

#rb none
#jira UE-140139
#preflight 6244bbb9f73c316f68e76bf3

[CL 19564411 by Steve Robb in ue5-main branch]
2022-03-30 16:57:01 -04:00
charles bloom
a3c7d9cb9b fix Volume Textures with LeaveExistingMips
was not correctly mipping down Volume Depth in TextureSources
need to correct the calculation in various places where its code duped
add some size checking

#preflight 624279a8292f228e09db756d
#rb fabian.giesen

[CL 19542095 by charles bloom in ue5-main branch]
2022-03-29 10:48:15 -04:00
Brice Criswell
280bb9f1ca Math : Added serialization support for IntVector4
#rb Benn.Gallagher
#preflight 623bc6cada56b5683a0eb028

[CL 19514564 by Brice Criswell in ue5-main branch]
2022-03-25 12:28:47 -04:00
Steve Robb
467fcae255 Fix for the legacy math macros always being defined even when UE_DEFINE_LEGACY_MATH_CONSTANT_MACRO_NAMES=0.
#rb jonathan.adamczewski
#jira none
#preflight 623dd85aa67e4e1ab7032287

[CL 19513888 by Steve Robb in ue5-main branch]
2022-03-25 11:50:47 -04:00
charles bloom
3c55db59b6 Float16 Max constant and comments about clamp behavior change in Set
no change in existing behavior

#rb none
#preflight none

[CL 19493873 by charles bloom in ue5-main branch]
2022-03-24 08:44:31 -04:00
Steve Robb
51802de52f UE_ prefix added to math macros, with switches for turning on deprecation and removal for the old macros.
Fixes for all the macro use in Core.

#rb robert.manuszewski
#jira UE-140139
#preflight 623c54628900c14eecdea9c6

[CL 19493359 by Steve Robb in ue5-main branch]
2022-03-24 07:49:46 -04:00
zach bethel
50274e3050 Converted FIntPoint / FIntVector / FIntRect to a template type and added unsigned variants.
#rb luke.thatcher, andrew.davidson, steve.robb
#preflight 6239e9d204769ab49354a30f

[CL 19468937 by zach bethel in ue5-main branch]
2022-03-22 13:40:58 -04:00
Zak Middleton
878b4416b8 #ue5 - TransformCalculus converted to support templated types, and converted existing types to use templates.
Currently the old types (eg FTransform2D) are typedef'd to use the float version for backwards compat. After Slate converts its internal usage, this can be revisited and swapped to double by default for consistency with engine types; this will require Slate to start using its own defined type for all slate code for clarity.

#jira UE-138848
#rb Patrick.Boutot, Andrew.Davidson
#fyi Patrick.Boutot
#preflight 6238b3c1c73745c6008c37d3

[CL 19457342 by Zak Middleton in ue5-main branch]
2022-03-21 16:08:17 -04:00
fabian giesen
44b81d0e43 FLinearColor conversion optimizations and some fixes.
FLinearColor ctor from FColor is mainly three table lookups, make it inline and move to the header.
Quantize, QuantizeFloor, QuantizeRound are similarly trivial, now inline.
Move Clamp01 to FColor as static method so it's namespaced; rename to Clamp01NansTo0 to explain why it's not just FMath::Clamp to [0,1]
SSE2-ified FLinearColor::ToFColorSRGB for x86 targets, bitwise exact same results as before for all input floats (tested exhaustively, test included)
Don't want to make ToFColorSRGB inline, it's a bit large for that, but make an array version that does multiple at once. Mainly try to avoid doing a cross-DLL call per pixel for large batches.
Switch ImageCore Linear->sRGB conv to use array version.
FLinearColor R,G,B,A members union'd with "deprecated" RGBA[] array, Component() updated to use it (matching recent fix for FVector)
ImageCore vector loads from FLinearColors updated to use &Component(0) which gives &RGBA[0], pointer to a 4-elem array
Add tests to UnrealMathTest.cpp to verify that sRGB<->Linear and UNORM<->Linear conversions behave as expected, plus the separate ColorConversionHeavy test that does the exhaustive equivalence check between the SSE2 ToFColorSRGB() and reference (warning: takes a while)

#rb danny.couture, martins.mozeiko
#preflight 6238c86f04769ab493469a3f

[CL 19456245 by fabian giesen in ue5-main branch]
2022-03-21 15:07:04 -04:00
gamergenic
8a960da395 Fixed variables named X64 to avoid collision with preprocessor definition X64.
#rb Steve.Robb
#jira UE-146617 - GitHub 8989 : Minor change: Avoid name collisions with common preprocessor definition (X64)
PR #8989: Minor change: Avoid name collisions with common preprocessor definition (X64) (Contributed by gamergenic)
#preflight 6238ba3888538cd45ecb3124

[CL 19454771 by gamergenic in ue5-main branch]
2022-03-21 14:02:19 -04:00
matt breindel
6b34b80690 Added additional detail to the TRotator class to make it clear in what order the roll, pitch, and yaw are applied.
[REVIEW] [at]robert.manuszewski [at]steve.robb [at]tim.tillotson
#preflight none (comment only change)

#ROBOMERGE-AUTHOR: matt.breindel
#ROBOMERGE-SOURCE: CL 19408904 via CL 19410779 via CL 19413103 via CL 19426717 via CL 19426848
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v930-19419903)

[CL 19429531 by matt breindel in ue5-main branch]
2022-03-17 19:08:20 -04:00
Jeff Fisher
9ef147fc21 VectorVM fix for arm64 Neon
-Need return type of MakeVectorRegisterInt64 for Neon to match SSE.
#review-19410500
#rb Shawn.McGrath
#preflight 62335c02ed772061b6160f91

[CL 19422263 by Jeff Fisher in ue5-main branch]
2022-03-17 12:27:47 -04:00
rob krajcarski
9fc29320b1 Fixup some warnings generated from usage of VectorRegister2Int64 with new experimental VectorVM
#jira UE-146165
#preflight 623231286c05dd6bbc6e005a
#rb stu.mckenna

[CL 19410336 by rob krajcarski in ue5-main branch]
2022-03-16 15:26:36 -04:00
andrew davidson
b4e45c095b Fix serialization when switching between LWC variant types
#jira UE-145516
#rb marc.audy
#lockdown nick.whiting
#preflight 623115746e25767a218023a3

#ROBOMERGE-AUTHOR: andrew.davidson
#ROBOMERGE-SOURCE: CL 19398361 in //UE5/Release-5.0/... via CL 19399948
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v926-19321884)

[CL 19405683 by andrew davidson in ue5-main branch]
2022-03-16 10:27:04 -04:00
andy sonnenburg
beb33b0faf Add OptionalFwd.h for TOptional
#rb andrew.scheidecker
#rb markus.breyer
#rb michael.noland
#rb steve.robb

#preflight 622f75c1223365469e3b9a4f


#ROBOMERGE-AUTHOR: andy.sonnenburg
#ROBOMERGE-SOURCE: CL 19376614 via CL 19378292 via CL 19381215 via CL 19393896 via CL 19394130
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v926-19321884)

[CL 19402380 by andy sonnenburg in ue5-main branch]
2022-03-16 03:07:13 -04:00
shawn mcgrath
61cf03bac1 VectorVM bug fixes & half float support. Experimental VM on by default. #rb Rob.Krajcarski #preflight 6230b204421403c1553829fc
[CL 19388907 by shawn mcgrath in ue5-main branch]
2022-03-15 13:46:08 -04:00
fred kimberley
e7e64e1749 Make FVector conversions explicit.
#preflight 6221270ea00412627d0b7dd3
#jira UE-122078
#lockdown Julien.Marchand
#rb Andrew.Davidson

#ROBOMERGE-AUTHOR: fred.kimberley
#ROBOMERGE-SOURCE: CL 19253774 in //UE5/Release-5.0/... via CL 19257968
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v924-19243027)

[CL 19263535 by fred kimberley in ue5-main branch]
2022-03-04 03:48:53 -05:00
frederic doll
08cfd2a4bd Add FVector::RotateAngleAxis method taking radian angle as parameter
#ROBOMERGE-AUTHOR: frederic.doll
#ROBOMERGE-SOURCE: CL 19249714 via CL 19253224 via CL 19253703 via CL 19253778
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v924-19243027)

[CL 19263474 by frederic doll in ue5-main branch]
2022-03-04 03:44:11 -05:00
alex mcadams
de2e50191f Chaos Cloth - Fix collisions against convexes now that they're floats.
Additionally add lots of compile time verification that the ispc structs and enums match the c structs and enums for collision objects. This required adding a new accessor (which I called ISPCDataVerifier) to many of the implicit objects which can report the offset and size of its members.

Highlighted code changes:

TaperedCylinder.h
Switched this to hold FPlaneConcrete instead of FPlane. The difference is that FPlane is an FImplicitObject and otherwise has a bunch of passthroughs to FPlaneConcrete. We never use the fact that these are FImplicitObjects, so we don't need this additional 32 bytes per plane.

PerParticlePBDCollisionConstraint.ispc
On top of updating the convex code to be the correct float types, I also added th e FTaperedCapsule and FTaperedCylinder ispc structs. This makes it easier to verify this data.

ImplicitObject.h, ChaosClothingSimulationCollider.cpp
Technically all TSpheres think they have ImplicitObjectType::Sphere, but all of our code assumes that ImplicitObjectType::Sphere corresponds with TSphere<FReal,3> when casting to the derived type. I added a new typedef for FSphere which is this one type.

#rb michael.lentine
#preflight 620e9200e55d9645848ecf90
#jira UE-143152
#lockdown michael.lentine


#ROBOMERGE-AUTHOR: alex.mcadams
#ROBOMERGE-SOURCE: CL 19098395 via CL 19099712 via CL 19100195 via CL 19100716 via CL 19109898
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v921-19075845)

[CL 19147223 by alex mcadams in ue5-main branch]
2022-02-25 10:09:57 -05:00
zak middleton
cbbda06e18 #ue5 - Fix FMath::Clamp() and FMath::GridSnap() incorrectly mixing signed/unsigned types when an explicit signed template type is requested.
Changed macro used to resolve overloads for these 2 functions to the one requiring one actual float/double type in the arguments. Removed old macro that allowed mixing signed/unsigned int types and replaced it with one that requires all the types to be signed to match any overloads (tested but currently unused).

Resolved some compile errors that resulted from newly ambiguous calls that mixed signed/unsigned integer types.

#jira UE-143473
#rb Andrew.Davidson
#preflight 6215382b30639b44d2f52355


#ROBOMERGE-AUTHOR: zak.middleton
#ROBOMERGE-SOURCE: CL 19098314 via CL 19099699 via CL 19100188 via CL 19100709 via CL 19109894
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v921-19075845)

[CL 19147214 by zak middleton in ue5-main branch]
2022-02-25 10:09:25 -05:00
alex mcadams
f2f31489fb Chaos Cloth Optimization - Store P and InvM together as a 4 vector.
During the main constraint update, P and InvM for a particle are almost always accessed together. By putting them together in memory, this makes them 64-byte aligned and faster to read/write. Currently only ISPC code makes full use of PandInvM.

I added a new Chaos::Softs::FSolverParticles type which holds the PandInvM array. This made code update easy since Chaos::Softs::FSolverParticles was previously an alias for TPBDParticles<FSolverReal,3>. InvM still has its single array representation -- it is combined with P when P is updated at the beginning of each frame. This choice is mostly to reduce the amount of code that I had to change so that InvM can continue to live in TDynamicParticles. As such, when accessing InvM() by index, you will get the version that lives in TDynamicParticles. You can only access the value that lives with PandInvM  by accessing PandInvM() by index.

Overall per frame simulation for the Owen asset dropped from ~1.6ms per frame to ~1.4ms with this change. This comes from the Constraint updates where PandInvM is heavily leveraged.

Tested with the Owen asset for profiling and the Cloth ContentExamples map in editor for correctness.

#rb TBD
#preflight 620c567b492761fc5ca37c39
#jira UE-140723
#lockdown michael.lentine

#ROBOMERGE-AUTHOR: alex.mcadams
#ROBOMERGE-SOURCE: CL 19060468 in //UE5/Release-5.0/... via CL 19078358
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v921-19075845)

[CL 19121305 by alex mcadams in ue5-main branch]
2022-02-24 14:33:47 -05:00