#Physics colider origin

1 messages · Page 1 of 1 (latest)

distant bronze
#

Is there any way to get collision origin using ICollector<DistanceHit> without component lookup?

#

        float3 directionToCenter = hitPosition - SelfPosition;```

this is what i have right now but it assumes collider radius is 0.5.

I can assume all colliders are capsules
distant bronze
#

Anyone?

cobalt aspen
#

not exactly sure what you're looking for tbh

#

you want the position of the collider that hit you?

#

DistantHit has a RigidBodyIndex

#

and you use use the RigidBodyIndex to get rigidbod from the phyiscs world

distant bronze
#

Is it cache friendly? probably not, right?

cobalt aspen
#

well...

#

most of the data is already going to be in the cache considering it was just used to create the collision

distant bronze
#

With just rigidbody i can`t get origin, right?

#

I need entity lookup probably

#

I found world from body hmm

cobalt aspen
#

physics only uses the data in the simulation

#

i imagine knowing position is important and should be accessible

distant bronze
#

Ty

#

Is it the best way for performance?

#

It will run a lot of times (using for AimAssist code)

cobalt aspen
#

yes