I have never seen this in code before. From what I am reading, FCollisionObjectQueryParams is a structure… how is it possible to put a struct in as the argument. Where is the object?
In the first case, you have a function that takes an argument FHitResult as an output parameter, in other words, it takes the structure you declared and writes data to it that you can then use. In the second case, the structure is initialized with a certain immediately specified UEnum parameter.
Otherwise it would look like this:
Ok thanks!! The longer version that you wrote is what I am familiar with in code. I have never seen just a type (in this case type FCollisionObjectQuereyParams) used as an argument by itself to a function that takes that type parameter.
Like if I have a function that is defined to take an int you cannot type foo(int) as a valid argument. I guess what you are saying is… because of the enum parameter something magical is happening to initialize a value.
Nothing magical at all. An enum is basically a type wrapped around an int but the type itself is ECollisionChannel and the value is ECollisionChannel::ECC_PhysicsBody. It is like calling foo(1) or foo(2) not like calling foo(int). Maybe read up on enums and it will all make sense.