Another regression between 2.69 and current (related to rayCast) #37673

Closed
opened 2013-12-01 22:19:57 +01:00 by Arnaud Degroote · 20 comments

System Information
Ubuntu 13.10 / Nvidia Quadro FX 880M

Blender Version
Broken: Blender current (666b54752c2e1bb0fff2a1abbd5a04612355d5de49)
Worked: Blender 2.69 / 2.66

Short description of error

Basically, rayCast fails to hit target in situation where it previously hit them in an repeatable way.

Exact steps for others to reproduce the error

Just launch the associated blend file and press p.

On 2.69 / 2.66, I have reliably

RedBox <Vector (-6.9924, 0.0000, 1.0000)> <Vector (1.0000, -0.0098, 0.0013)>

while on current, I often get

None None None

Sometimes, it looks like it hits something, but normal seems strange in this case

RedBox <Vector (-6.9861, 0.0000, 1.0000)> <Vector (0.7197, -0.2924, 0.6297)>

RedBox <Vector (-6.9861, 0.0000, 1.0000)> <Vector (0.9885, 0.0919, -0.1205)>
...

Thanks in advance.

laser_issue2.blend

**System Information** Ubuntu 13.10 / Nvidia Quadro FX 880M **Blender Version** Broken: Blender current (666b54752c2e1bb0fff2a1abbd5a04612355d5de49) Worked: Blender 2.69 / 2.66 **Short description of error** Basically, rayCast fails to hit target in situation where it previously hit them in an repeatable way. **Exact steps for others to reproduce the error** Just launch the associated blend file and press p. On 2.69 / 2.66, I have reliably RedBox <Vector (-6.9924, 0.0000, 1.0000)> <Vector (1.0000, -0.0098, 0.0013)> while on current, I often get None None None Sometimes, it looks like it hits something, but normal seems strange in this case RedBox <Vector (-6.9861, 0.0000, 1.0000)> <Vector (0.7197, -0.2924, 0.6297)> RedBox <Vector (-6.9861, 0.0000, 1.0000)> <Vector (0.9885, 0.0919, -0.1205)> ... Thanks in advance. [laser_issue2.blend](https://archive.blender.org/developer/F35543/laser_issue2.blend)

Changed status to: 'Open'

Changed status to: 'Open'

Added subscriber: @adegroot

Added subscriber: @adegroot

Changed status from 'Open' to: 'Archived'

Changed status from 'Open' to: 'Archived'
Angus Hollands self-assigned this 2013-12-27 17:43:04 +01:00

This isn't a bug.
Your box is falling under gravity, and when it hits the floor it bounces slightly, causing it to rotate. This means the hitPosition differs slightly each time.
Closing.

This isn't a bug. Your box is falling under gravity, and when it hits the floor it bounces slightly, causing it to rotate. This means the hitPosition differs slightly each time. Closing.

Hum, I trust you, but why does it work properly in 2.69 (or 2.66a) ? All my unit-tests (https://github.com/morse-simulator/morse) using rayCast fails consistently in -current, while they success properly in 2.69.

Hum, I trust you, but why does it work properly in 2.69 (or 2.66a) ? All my unit-tests (https://github.com/morse-simulator/morse) using rayCast fails consistently in -current, while they success properly in 2.69.

The cause is self évident, the question is why the cube did not move upon collision in earlier builds. Try repeating your test, ensuring that the cube does fall under gravity and collide with the floor.

The cause is self évident, the question is why the cube did not move upon collision in earlier builds. Try repeating your test, ensuring that the cube does fall under gravity and collide with the floor.

I uploaded a new scene which exhibit the issue. The red block is now 'static', so it does not move at all. I added some print of the position of both "robot.sick" and "redbox" to be sure they are the same in both version (2.66 and current).

The output in 2.66 is the following

scanner pos <Vector (-4.5000, 0.0000, 1.0000)> <Euler (x=0.0000, y=0.0000, z=3.1400), order='XYZ'>
box pos <Vector (-7.4973, 0.0000, 0.9600)> <Euler (x=0.0000, y=0.0000, z=0.0000), order='XYZ'>
rayCast hits RedBox <Vector (-6.9973, 0.0000, 1.0000)> <Vector (1.0000, 0.0000, 0.0000)>

while on current

scanner pos <Vector (-4.5000, 0.0000, 1.0000)> <Euler (x=0.0000, y=0.0000, z=3.1400), order='XYZ'>
box pos <Vector (-7.4973, 0.0000, 0.9600)> <Euler (x=0.0000, y=0.0000, z=0.0000), order='XYZ'>
rayCast hits None None None

If you move the box of one millimetre (from -7.4973 to -7.4974), it hits something, but the normal is completely wrong

scanner pos <Vector (-4.5000, 0.0000, 1.0000)> <Euler (x=0.0000, y=0.0000, z=3.1400), order='XYZ'>
box pos <Vector (-7.4974, 0.0000, 0.9600)> <Euler (x=0.0000, y=0.0000, z=0.0000), order='XYZ'>
rayCast hits RedBox <Vector (-6.9974, 0.0000, 1.0000)> <Vector (0.8097, -0.1518, -0.5668)>

laser_issue4.blend

I uploaded a new scene which exhibit the issue. The red block is now 'static', so it does not move at all. I added some print of the position of both "robot.sick" and "redbox" to be sure they are the same in both version (2.66 and current). The output in 2.66 is the following scanner pos <Vector (-4.5000, 0.0000, 1.0000)> <Euler (x=0.0000, y=0.0000, z=3.1400), order='XYZ'> box pos <Vector (-7.4973, 0.0000, 0.9600)> <Euler (x=0.0000, y=0.0000, z=0.0000), order='XYZ'> rayCast hits RedBox <Vector (-6.9973, 0.0000, 1.0000)> <Vector (1.0000, 0.0000, 0.0000)> while on current scanner pos <Vector (-4.5000, 0.0000, 1.0000)> <Euler (x=0.0000, y=0.0000, z=3.1400), order='XYZ'> box pos <Vector (-7.4973, 0.0000, 0.9600)> <Euler (x=0.0000, y=0.0000, z=0.0000), order='XYZ'> rayCast hits None None None If you move the box of one millimetre (from -7.4973 to -7.4974), it hits something, but the normal is completely wrong scanner pos <Vector (-4.5000, 0.0000, 1.0000)> <Euler (x=0.0000, y=0.0000, z=3.1400), order='XYZ'> box pos <Vector (-7.4974, 0.0000, 0.9600)> <Euler (x=0.0000, y=0.0000, z=0.0000), order='XYZ'> rayCast hits RedBox <Vector (-6.9974, 0.0000, 1.0000)> <Vector (0.8097, -0.1518, -0.5668)> [laser_issue4.blend](https://archive.blender.org/developer/F58076/laser_issue4.blend)

Angus, can you check the last scene, check the issue, and at least reopen the bug if you can repeat the issue ? Thanks in advance.

Angus, can you check the last scene, check the issue, and at least reopen the bug if you can repeat the issue ? Thanks in advance.

Changed status from 'Archived' to: 'Open'

Changed status from 'Archived' to: 'Open'

The collision margin is set to 0, which is the reason it doesn't work in trunk.
However, I'm not sure why this has changed between 2.69 release and current git state so this should be reopened.

The collision margin is set to 0, which is the reason it doesn't work in trunk. However, I'm not sure why this has changed between 2.69 release and current git state so this should be reopened.

Added subscriber: @Ace_Dragon

Added subscriber: @Ace_Dragon

I had the issue too recently, took me about two hours to figure out that the way to fix it was to set the collision margin from 0 to 0.001.

Clearly, we need to make sure that the collision margin by default is not 0.000 and that one double-checks the code to make sure that it won't be reset to 0 on older files, otherwise we'll have more people asking if ray casting is broken and thus cannot work on their projects anymore.

I had the issue too recently, took me about two hours to figure out that the way to fix it was to set the collision margin from 0 to 0.001. Clearly, we need to make sure that the collision margin by default is not 0.000 and that one double-checks the code to make sure that it won't be reset to 0 on older files, otherwise we'll have more people asking if ray casting is broken and thus cannot work on their projects anymore.

Added subscriber: @sreich

Added subscriber: @sreich

There was a change in the bullet defaults to the way raycasting works. Now a more accurate (but slower) method is used.
The behaviour has changed, but I'm not sure whether it's wrong now since I'm not a GE user and it would take more time to look into.

To use the other method you can try this patch: ge_subsimplex_raycast.diff

There was a change in the bullet defaults to the way raycasting works. Now a more accurate (but slower) method is used. The behaviour has changed, but I'm not sure whether it's wrong now since I'm not a GE user and it would take more time to look into. To use the other method you can try this patch: [ge_subsimplex_raycast.diff](https://archive.blender.org/developer/F75449/ge_subsimplex_raycast.diff)

I can confirm that it works, as previously, with your patch sergof. Do you know how much overhead the new method have over the previous one ?

If we want to keep the current raycast setting, we must make it works properly on older scene, as stated by ace_dragon.

I can confirm that it works, as previously, with your patch sergof. Do you know how much overhead the new method have over the previous one ? If we want to keep the current raycast setting, we must make it works properly on older scene, as stated by ace_dragon.

I'm not sure about the performance difference, it's probably not too big but will add up when doing many calls.

Since nobody complained about the accuracy before, I'll just apply the patch to stay compatible with old files.

I'm not sure about the performance difference, it's probably not too big but will add up when doing many calls. Since nobody complained about the accuracy before, I'll just apply the patch to stay compatible with old files.

Changed status from 'Open' to: 'Resolved'

Changed status from 'Open' to: 'Resolved'

Closed by commit 6fe5b3be38.

Closed by commit 6fe5b3be38.

This issue was referenced by blender/blender-addons-contrib@6fe5b3be38

This issue was referenced by blender/blender-addons-contrib@6fe5b3be38af229640d1926bd908361d5e7a2b15

This issue was referenced by 6fe5b3be38

This issue was referenced by 6fe5b3be38af229640d1926bd908361d5e7a2b15
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
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
5 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#37673
No description provided.