You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
RayCollision object returned from GetRayCollisionBox contains incorrect distance value if Ray object passed to GetRayCollisionBox has direction value that is not normalized (i.e. Vector3Normalize wasn't applied to it).
I don't know if Ray.direction is supposed to be normalized for correct results of RayLib functions and haven't found it in any documentation.
If it is then it would make sense to expand struct comment
typedef struct Ray {
Vector3 position; // Ray position (origin)
Vector3 direction; // Ray direction (normalized)
} Ray;
If it's not, then there is a bug somewhere in GetRayCollisionBox.
using Vector3Normalize on the caller side solves the issue, it's just unclear if it's supposed approach
RayCollision rayCollision = GetRayCollisionBox(Ray{ projectile.position, Vector3Normalize(projectile.speed) }, boundingBox);
Issue description
RayCollision object returned from GetRayCollisionBox contains incorrect distance value if Ray object passed to GetRayCollisionBox has direction value that is not normalized (i.e. Vector3Normalize wasn't applied to it).
I don't know if Ray.direction is supposed to be normalized for correct results of RayLib functions and haven't found it in any documentation.
If it is then it would make sense to expand struct comment
typedef struct Ray {
Vector3 position; // Ray position (origin)
Vector3 direction; // Ray direction (normalized)
} Ray;
If it's not, then there is a bug somewhere in GetRayCollisionBox.
using Vector3Normalize on the caller side solves the issue, it's just unclear if it's supposed approach
RayCollision rayCollision = GetRayCollisionBox(Ray{ projectile.position, Vector3Normalize(projectile.speed) }, boundingBox);
Environment
Windows7, RayLib 5.0, Visual C++ 2019
Code Example
The text was updated successfully, but these errors were encountered: