MainFrameActions: Packaging (Windows): UnrealBuildTool: C:\dev\Unreal\Projects\MyProject5\Source\MyProject5\GeneratedMeshComponent.cpp(221) : error C2039: 'InvalidatePhysicsData' : is not a member of 'UBodySetup'
You would be correct I have updated the wiki with the new UGeneratedMeshComponent code, with the caveat that it will only work in the Editor until 4.2 or 4.3 as indicated in the Feedback Thread.
On my end, it allows me to progress with the development of my project until it can be packaged. Thanks JamesG for the feedback and support.
It is one of the things I wanted to look at. My first thought was simply to use an FBox with the maximum X/Y/Z of the vertices. What is the gain to make it more precise? Also you can get the list of points from GetPhysicsTriMeshData and pass the CollisionData->Vertices array to the FBox constructor for less code.
I do know one concrete advantage, which is occlusion! With a size as big as the world the actor will never get properly occluded and is being rendered all over the world even if player is far far away.
I imagine it would help with touch events / collision detection somehow? Not really sure about that part
Iād just like to take a moment to thank , , and the UnrealEngine developers for taking this thread and running with it. You guys are incredible!
Itāll be a few more days before I can get back to working on this, but I hope that by the time I do there are still a few unsolved problems in this space so that I can contribute something back to the community!
Iām now working off your latest code on the wiki. Collisions are working with pawns just fine, but donāt seem to be working with physics objects. Have you (or anyone else) gotten collisions with physics objects working yet?
If I fill out an AggGeom, I can get physics objects to collide with the shapes in the AggGeom. For instance, if I wrap my triangle mesh in a bounding box, I can get objects to bounce off of the bounding box.
However, I canāt seem to get physics objects to collide with the actual triangle mesh itself, even when I set the CollisionTraceFlag to CTF_UseComplexAsSimple. In that case, physics objects just fall right through my triangle mesh.
My geometry is basically environment geometry, there are many concavities and it does not obey any particular nice shape. I cannot construct a representation for it out of an aggregation of boxes, spheres, and cylinders.
It should totally be possible to throw a physically simulated sphere or something onto this environment and have it roll down hills and into valleys, etc., colliding with the actual triangles of the mesh, but so far, Iām stuck with the choice of either wrapping my mesh in a convex volume that is far too large, or allowing physics objects to pass through my mesh altogether.
Has anyone figured out how to get physics objects to collide with the actual triangles of a triangle mesh? Thanks in advance!
For static geometry, setting āuse complex as simpleā as the Collision Complexity in the StaticMesh Editor will cause physics to collide with the graphics triangles. We do not support per-poly collision on the actual physics object - we need collision geometry with āvolumeā so we can calculate mass/inertia etc., and it would be too slow.
Yeah I was having the same problem myself for a while, an as usual the solution turned out to be a one line fix.
To get the generated mesh working with physics youāll just need to make sure you set the mobility of the component to Static or Stationary as the component will default to movable.
SetMobility(EComponentMobility::Stationary);
This should get physics objects colliding with your generated mesh, its even happy if your deforming or updating the mesh while its colliding as Iām using destructible terrain in some situations.
The Stationary mobility option still lets you move your component as well with collision working, but obviously that movement needs to be blueprint or code driven from JamesG comment above about per-poly on physics objects.
This all seems happy in the editor simulating and dropping to game, an hopefully with the work being done in the related thread weāll have the cooked PhysX data in the built projects for 4.2 or 4.3.