DanielChappuis / reactphysics3d

Open source C++ physics engine library in 3D
http://www.reactphysics3d.com
zlib License
1.54k stars 223 forks source link

Quaternion constructor should construct identity quaternion #31

Closed perkele1989 closed 6 years ago

perkele1989 commented 7 years ago

As the title states. Right now it constructs an invalid quaternion, which would result in an assert if you were to use a default-constructed quaternion in the transform for a collision shape.

// Constructor of the class
Quaternion::Quaternion() : x(0.0), y(0.0), z(0.0), w(1.0) {

}

Btw, thank you for a splendid library! Very clean API, a breeze to work with 💯

DanielChappuis commented 7 years ago

Yes this is a good idea. I will make this change for the next release (version 0.7.0) of the library.

ZelimDamian commented 6 years ago

Is this issue solved simply by changing the constructor initialiser? I ran tests after making the changes - all succeeded. All testbeds work just fine. If there are usages which could be broken, I am willing to look into it, but could really use some directions. Otherwise, I will PR?

DanielChappuis commented 6 years ago

This issue is already solved in the "develop" branch. I will merge this branch into "master" soon in order to release the next version (0.7.0) of the library. I will close this issue only when it has been part of the "master" branch.

DanielChappuis commented 6 years ago

This is now available in the version v0.7.0 of ReactPhysics3D that has just been released. Thanks a lot for reporting this.