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

[Resonance] Quaternion fixes #2750

Merged
merged 3 commits into from
Jul 23, 2024
Merged

Conversation

ITeMbI4
Copy link
Contributor

@ITeMbI4 ITeMbI4 commented Jul 22, 2024

Changes

  • Make rotation optional for Pickup.Spawn, Pickup.CreateAndSpawn, Projectile.Spawn, Projectile.CreateAndSpawn and Ragdoll.CreateAndSpawn
  • Fix zero Quaternion

@ITeMbI4 ITeMbI4 marked this pull request as draft July 22, 2024 08:23
@ITeMbI4
Copy link
Contributor Author

ITeMbI4 commented Jul 22, 2024

A bit of context, why I delete default from Quaternion:

When you create a Quaternion with default value, it will be - new Quaternion(0f, 0f, 0f, 0f).
So, myRotation *= Quaternion.AngleAxis(90f, Vector3.up); will fail to rotate an object, because rotation is invalid.

So, I just change all zero Quaternion to a proper one - identity = new Quaternion(0f, 0f, 0f, 1f)

More in https://discussions.unity.com/t/why-are-quaternions-initialized-to-an-invalid-rotation-by-default/816397

@ITeMbI4 ITeMbI4 marked this pull request as ready for review July 22, 2024 11:16
@ITeMbI4 ITeMbI4 changed the title [Resonance] Make rotation optional [Resonance] Quaternion fixes Jul 22, 2024
@xNexusACS xNexusACS merged commit b65ea96 into Exiled-Team:dev Jul 23, 2024
3 checks passed
@ITeMbI4 ITeMbI4 deleted the SimplifySpawn branch July 23, 2024 08:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants