Direction not normalized in isect_ray_aabb_v3_simple()? #55964
Labels
No Label
Interest
Animation & Rigging
Interest
Blender Cloud
Interest
Collada
Interest
Core
Interest
Documentation
Interest
Eevee & Viewport
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
Import and Export
Interest
Modeling
Interest
Modifiers
Interest
Nodes & Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds, Tests & Devices
Interest
Python API
Interest
Rendering & Cycles
Interest
Sculpt, Paint & Texture
Interest
Translations
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Meta
Good First Issue
Meta
Papercut
Module
Add-ons (BF-Blender)
Module
Add-ons (Community)
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
3 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender-addons#55964
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Blender Version
2.79
Short description of error
In rna_Object_ray_cast() , which implements the code for
Object.ray_cast(origin, direction, distance)
in the bpy API, the direction vector is normalized before the call toBLI_bvhtree_ray_cast()
.However, the more efficient bounding box test that is run before that calls
isect_ray_aabb_v3_simple()
with the original direction vector and it is not normalized in that function: https://developer.blender.org/diffusion/B/browse/master/source/blender/blenlib/intern/math_geom.c;f6367ecfb65502a1ec40c5e382800b2ac214a499$2479Does it simply not matter whether a unit vector is passed or not, or could this be a bug?
Added subscriber: @CodeManX
Added subscriber: @mont29
Checking code of said
isect_ray_aabb_v3_simple
makes it obvious it does not care whetherdirection
is normalized or not, for its 'match or not match' main result.However, it does affect the distance return parameters - which are used in said RNA function, so I guess indeed
direction
vector should be normalized here.And there is also a risk of division by zero in
isect_ray_aabb_v3_simple
, will fix as well.This issue was referenced by blender/blender@29d1db9ed6
Changed status from 'Open' to: 'Resolved'