in0finite / SanAndreasUnity

Open source reimplementation of GTA San Andreas game engine in Unity
https://discord.gg/p6jjud5
MIT License
2.15k stars 353 forks source link

Bullet raycasting against ped's body parts #46

Closed in0finite closed 4 years ago

in0finite commented 4 years ago

Bullet raycasting should not be done against CharacterController (capsule collider), but against ped's mesh. The problem is that there is no way to raycast against skinned mesh. The best solution seems to be attaching colliders to each body part, and raycasting against them. This creates additional problems. Should these colliders be the same for all peds ? Or should they be generated at runtime based on ped's model (which adds performance costs) ?

This is needed for:

This issue is related to #34, which also needs colliders attached to each body part.

slapin commented 4 years ago

Doesn't Unity build colliders for ragdolls using bones? These colliders could be used for that.

On Sat, Oct 12, 2019 at 3:39 AM in0finite notifications@github.com wrote:

Bullet raycasting should not be done against CharacterController (capsule collider), but against ped's mesh. The problem is that there is no way to raycast against skinned mesh. The best solution seems to be attaching colliders to each body part, and raycasting against them. This creates additional problems. Should these colliders be the same for all peds ? Or should they be generated at runtime based on ped's model (which adds performance costs) ?

This is also needed for detecting which part of body was hit (so that damage can be applied accordingly).

This issue is related to #34 https://github.com/GTA-ASM/SanAndreasUnity/issues/34, which also needs colliders attached to each body part.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/GTA-ASM/SanAndreasUnity/issues/46?email_source=notifications&email_token=AAABPUY6EKFZZ7E3W5Z5RRLQOEMCRA5CNFSM4JAAOVJ2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4HRKSMIQ, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAABPU64DTVMLGLGNOOG7GTQOEMCRANCNFSM4JAAOVJQ .

in0finite commented 4 years ago

Yes, he does. That's why I referenced other issue. Still, it's not clear if it can be done at runtime, and how much time it takes.

in0finite commented 4 years ago

Done as of commit 83659395e12c916e66aa906f013418272b8f3452.