Skip to content
This repository has been archived by the owner on Jan 19, 2025. It is now read-only.

[Resonance] Quaternion fixes #2750

Merged
merged 3 commits into from
Jul 23, 2024
Merged

[Resonance] Quaternion fixes #2750

merged 3 commits into from
Jul 23, 2024

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

@github-actions github-actions bot added the regarding-api An issue or PR targeting the Exiled API project label Jul 22, 2024
@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
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
regarding-api An issue or PR targeting the Exiled API project
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants