Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement ragdoll #103

Merged
merged 41 commits into from
Jan 12, 2021
Merged
Changes from 1 commit
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
64680f7
initial ragdoll stuff
in0finite Jan 3, 2021
d6d5d66
wip on ragdoll
in0finite Jan 4, 2021
9a224c0
remove additionally added colliders from ragdoll (jaw, neck box)
in0finite Jan 4, 2021
aa95d08
use continuous dynamic CollisionDetectionMode for ragdoll
in0finite Jan 4, 2021
988e250
...
in0finite Jan 4, 2021
3a5e237
add button to remove all dead bodies
in0finite Jan 5, 2021
003442d
add num dead bodies to Misc stats
in0finite Jan 5, 2021
c50bff8
add setting for dead body lifetime
in0finite Jan 5, 2021
59097a0
apply force on dead body when it is hit by weapon
in0finite Jan 5, 2021
acae616
cleanup
in0finite Jan 5, 2021
17f6aae
peds are killed with a separate function ; ragdoll is detached only w…
in0finite Jan 5, 2021
75d9ca5
when vehicle explodes, all peds inside are killed - this also fixes U…
in0finite Jan 5, 2021
8469f18
use prefab to spawn dead body
in0finite Jan 5, 2021
5c36e12
add dead body to list of spawnable objects
in0finite Jan 5, 2021
f9e320c
move creation of dead body to it's own class
in0finite Jan 5, 2021
8d400bf
syncing works
in0finite Jan 5, 2021
20100a3
add "dead body sync rate" setting
in0finite Jan 5, 2021
68413a5
sync velocity
in0finite Jan 5, 2021
3417597
syncing is finally decent enough
in0finite Jan 7, 2021
506bca3
cleanup
in0finite Jan 7, 2021
a9e70bf
cleanup
in0finite Jan 7, 2021
2d5d67f
cleanup
in0finite Jan 7, 2021
6b3e656
extract SetVelocity() method
in0finite Jan 7, 2021
31d7d3c
apply initial velocities
in0finite Jan 7, 2021
38d3035
use struct for storing info about bones
in0finite Jan 7, 2021
7990d25
extract SetPosition() and SetRotation()
in0finite Jan 7, 2021
2051451
fix commented code
in0finite Jan 7, 2021
de8439a
add extension method
in0finite Jan 7, 2021
9267660
configure interpolation in Inspector
in0finite Jan 7, 2021
34b9613
don't set rigid body to kinematic - it behaves a little better with h…
in0finite Jan 7, 2021
dcc65fa
tried to use MovePosition()/MoveRotation(), but it doesn't work
in0finite Jan 7, 2021
c8b4483
fix comments
in0finite Jan 7, 2021
38e205e
found almost perfect solution
in0finite Jan 7, 2021
4b20f5d
...
in0finite Jan 7, 2021
2451514
use custom serialization
in0finite Jan 8, 2021
be97e40
cleanup
in0finite Jan 8, 2021
ebaa36f
add "num bones in dead bodies" to misc stats
in0finite Jan 8, 2021
b7ab28f
add "num rigid bodies in dead bodies" to misc stats
in0finite Jan 8, 2021
206c67b
"request suicide" button will kill ped
in0finite Jan 8, 2021
a713853
Merge remote-tracking branch 'origin/dev' into feature/ragdoll
in0finite Jan 12, 2021
c016790
Merge remote-tracking branch 'origin/dev' into feature/ragdoll
in0finite Jan 12, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
configure interpolation in Inspector
in0finite committed Jan 7, 2021
commit 9267660a9753da402d2b9d4f6b8fc672a9bb4699
2 changes: 1 addition & 1 deletion Assets/Scripts/Behaviours/Ped/DeadBody.cs
Original file line number Diff line number Diff line change
@@ -92,7 +92,7 @@ private void InitialClientOnlySetup()
foreach (var rb in this.transform.GetComponentsInChildren<Rigidbody>())
{
rb.isKinematic = true;
rb.interpolation = RigidbodyInterpolation.Extrapolate;
rb.interpolation = PedManager.Instance.ragdollInterpolationMode;
}
model.RagdollBuilder.BuildJoints();

1 change: 1 addition & 0 deletions Assets/Scripts/Behaviours/PedManager.cs
Original file line number Diff line number Diff line change
@@ -66,6 +66,7 @@ public class PedManager : MonoBehaviour
public float ragdollDamageForceWhenDetached = 4f;
public CollisionDetectionMode ragdollCollisionDetectionMode = CollisionDetectionMode.Discrete;
[Range(1, 60)] public float ragdollSyncRate = 20f;
public RigidbodyInterpolation ragdollInterpolationMode = RigidbodyInterpolation.Extrapolate;


void Awake ()