Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Vector clamp( ) {
- if ( !std::isfinite< float >( x ) || !std::isfinite< float >( y ) ) {
- x = y = z = 0.f;
- }
- y = std::remainder( y, 360.f );
- x = std::remainder( x, 180.f );
- std::clamp< float >( x, -89.f, 89.f );
- std::clamp< float >( y, -180.f, 180.f );
- z = 0;
- return *this;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement