x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Update of collision mesh for animated skeletal mesh is delayed

What I try to do

  1. Update the pose of a skeletal mesh using the AnimBP

  2. From the actor retrieve the updated bone position

  3. Line trace towards that bone position and retrieve the mesh intersection

To make sure the order of execution is correct I used AddTickPrerequisite to tick the actor after the skeletal mesh and just to be sure also set the tick group of the actor to Post Update Work. From the tick logs ( tick.LogTicks) the execution order looks correct.

Problem

It seems that the collision mesh is delayed by one frame. It becomes most apparent when using a low frame rate or small or fast objects. In these cases the line trace does not register a hit anymore, but visually it hits the (rendered != collision) mesh.

When looking at the engine code in USkeletalMeshComponent::PostAnimEvaluation() there is a call to USkeletalMeshComponent::UpdateKinematicBonesToAnim(), which in case of bEnablePerPolyCollision computes the skinned vertex positions and updates the collision mesh using FBodyInstance::UpdateTriMeshVertices(). But the changes only seem to be active in the next frame.

Using collision primitives (e.g. Capsules and not TriMesh) updates properly in the current frame, which is also executed in USkeletalMeshComponent::UpdateKinematicBonesToAnim() (but for my application I need to know the mesh vertex so this approach is not feasible).

Questions

When is the updated collision mesh activated in the physics engine? How can I force this update to happen?

Product Version: UE 4.22
Tags:
more ▼

asked May 14 '19 at 05:47 PM in Using UE4

avatar image

Domibor
1 2

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

0 answers: sort voted first
Be the first one to answer this question
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question