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"

GetActorBounds affected by rotation

I'm using GetActorBounds to create a bounding sphere around my actor. I get the box extents and use it to find the box diagonal and use that as the radius for a SphereCollision.

Everything works fine, but when i rotate my actor it affects the results of GetActorBounds, changing the radius of the sphere for any rotation values different from 0, 90, 180 and 270.

My question is: how can i get the actor bounds ignoring its rotation?

Thanks!

Product Version: UE 4.9
Tags:
more ▼

asked Nov 18 '15 at 07:12 PM in Blueprint Scripting

avatar image

TiagoLing
36 4 7 9

avatar image 刘振涛 May 10 '16 at 03:01 PM

have you solve this? i have the same question.

avatar image TiagoLing May 10 '16 at 03:08 PM

I didn't solve it, but i used a workaround: - Set your desired Actor rotation - GetActorBounds with this rotation - Store the result inside a variable - Use this cached bounds value to avoid the changes in bounds with rotation.

This is not ideal though, since not all actors are perfectly square or spherical you might want to add some offsets to the cached bounds to cover the actor in all rotations.

Hope this helps!

(comments are locked)
10|2000 characters needed characters left

3 answers: sort voted first

Be aware that the Extent of a box changes if you rotate it's contents: it is calculated from the center to the most distanced point, but stays a box. When I applied the box extent of a component to a collisionbox size and rotated the collisionbox to the world rotation of the actor, it kept pretty good measure. This applies to sphere collisions too.

more ▼

answered May 12 '16 at 11:36 AM

avatar image

Trent LeBreaux
103 3 5 11

(comments are locked)
10|2000 characters needed characters left

unfortunately AActor::GetActorBounds is affected by rotation.

For getting actor bounding box and not affected by actor rotation, choose AActor::CalculateComponentsBoundingBoxInLocalSpace function

more ▼

answered Sep 17 '18 at 01:29 PM

avatar image

Homer Xing
1 2

(comments are locked)
10|2000 characters needed characters left
more ▼

answered May 18 '17 at 05:54 AM

avatar image

Jin_VE
4.3k 31 77 40

(comments are locked)
10|2000 characters needed characters left
Your answer
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