Ok, I've been asking various questions and getting some good answers, but I think I need to rethink my method, so I'll describe the problem.

I have a player who has a big blue box in front of him. This box shows which KActors will be pushed when he pulls the trigger:

enter image description here

Currently, the blue box spawns a descendant of Actor which checks collision to see which KActors are touching it:

foreach Owner.TouchingActors(class'DynamicSMActor', DynamicActorItt)
      // do stuff

The problem is, if you check for touching between Actors and KActors, it looks like it does a plain axis-aligned bounding-box collision. The power will push the box on the lower right, when it's clear it's not touching the blue box.

How should I do this properly? I just need a way to find out which KActors are touching that area, on a poly-by-poly level. These collisions are only done with rectangular boxes and simple sphere collision; we are aware of the potential for performance issues with complex objects and poly-collision.

I've tried making the collision checker a KActor, but it doesn't report any TouchingActors.

This issue is causing us trouble in a lot of other places as well. So solving this problem is a core issue in our game.

  • 1
    \$\begingroup\$ I've not worked with UDK, but is there not a way to use non-axis aligned bounding box? \$\endgroup\$ – MichaelHouse Dec 12 '12 at 17:35
  • \$\begingroup\$ bCollideComplex is supposed to do that, but setting it on my actors doesn't change anything. \$\endgroup\$ – Almo Dec 12 '12 at 18:49
  • \$\begingroup\$ Maybe this thread is useful? forums.epicgames.com/archive/index.php/t-616506.html \$\endgroup\$ – MichaelHouse Dec 12 '12 at 19:09
  • \$\begingroup\$ I don't think so, because we're not using cooked assets. \$\endgroup\$ – Almo Dec 12 '12 at 19:39

Current solution:

local Vector ImpulseToApply, PointA, PointB;
local GJKResult theResult;
local DynamicSMActor TempActor;

foreach Owner.TouchingActors(class'DynamicSMActor', TempActor)
    theResult = 
    if(theResult != GJK_Fail && VSizeSq(PointA - PointB) < 0.01)
    // if(theResult == GJK_Intersect) // TODO: GJK_Intersect is never returned, for some reason
        // handle collision

The ClosestPointOnComponentToComponent function returns GJK_NonIntersecting regardless of whether or not the components intersect. However, the two closest points returned overlap when they intersect. I think this is a bug in the function. Have reported it to Epic; we'll see what they about that.

This works very well for rectangular solids, spheres and cylinders (the three types of PrimitiveComponents).


When you spawn the Actor for collision checks, what is that actor's CollisionComponent set to? I think if you set its CollisionComponent to a copy of that blue box mesh, it will do its collision (and thus "Touching") checks based off of that component. (the component will probably need to have CollideActor=true)

  • \$\begingroup\$ The collision component is a copy of the blue box mesh, as you suggest. \$\endgroup\$ – Almo Dec 13 '12 at 16:12
  • \$\begingroup\$ Ah. Yeah, doing some more research it appears that Unreal collision between two actors requires one of the actors to use AABB. :( \$\endgroup\$ – Phillip Dec 14 '12 at 15:41
  • \$\begingroup\$ Is this the case even for Actor-Actor with no KActors involved? \$\endgroup\$ – Almo Dec 14 '12 at 15:49
  • \$\begingroup\$ It would appear so. :/ Of course, with PHYS_RigidBody, you can do checks against more complex collision. Also, I suppose you could check for actors within the cube by approximating its shape. For example, you could do multiple radius checks (via something like CollidingActors()) along the "path" of the cube. \$\endgroup\$ – Phillip Dec 17 '12 at 22:16
  • \$\begingroup\$ Thanks for your help. I'll update this question with the best solution I can once I have it. \$\endgroup\$ – Almo Dec 17 '12 at 23:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.