Raycast "Is Hit" returns inconsistent result in Simulation Zone #110867
Labels
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser Project (Legacy)
Interest
Asset System
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
4 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#110867
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?
System Information
Operating system: Windows-10-10.0.19045-SP0 64 Bits
Graphics card: NVIDIA GeForce RTX 2060/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 531.79
Blender Version
Broken: version: 3.6.0, branch: blender-v3.6-release, commit date: 2023-06-27 08:08, hash:
c7fc78b81ecb
Short description of error
Output "Is Hit" does not always return a hit when the position is animated through simulation nodes.
In the case shown in the video, the "Is Hit" does not always appear on the "Viewer Node" nor return hit for the node labeled "Switch (Teleport left and up)"
But it correctly seems to return "Is Hit" for the node labered "Switch (Reflect or keep CurrentVelocity)" (which changes direction of movement).
The intended behavior is for the points to accelerate downwards, and upon colliding with the plane: reflect the velocity along the plane's normal, and add the vector (0, 1, 1) to its position.
Instead, for the first few "collisions", only the reflection seems to occur (no teleport).
Exact steps for others to reproduce the error
Viewer Node
(the one with the value linked to "Is Hit")Note that the point is correctly reflected (indicating that "Is Hit" works in this case).
But the point is not always teleported.
( ps: a spherecast node (thicker raycast) would be incredibly useful for simulations 😄. Unity implements these: https://docs.unity3d.com/ScriptReference/Physics.SphereCast )
Hi, thsnks for report. Can you check this in last 4.0 blender?
The same appears to happen in 4.0.
I edited the description to make the issue clearer.
I believe what is happening is that, as the particle is reflected when "Is Hit", it is moved outside the hit threshold (25cm) and thus is no longer in the "Hit" condition.
This seems to be a kind of dependency cycle.
The
Raycast
node seems to be updated sometimes based on the initial position and sometimes based on the final position.Looks like a bug to me.
Here the viewer is showing the Ray direction input of the raycast node (CurrentVelocity), and the position of the point:
21: ray points down, doesn't hit within 0.25m.
22: ray points up, so it doesn't hit either.
74: only then, z < 0.25 and Vz < 0, so the ray hits. It is here also the first frame where "Hit normal" is not zero (I'm asuming that's the default, no-hit value).
So in a certain way, the Raycast node seems to be doing what it should, using always the position of the point at the current frame, before being modified by the Set Position node, which comes right after the Raycast node is used. But then, why is the point bouncing? Maybe some step is being processed that is not seen with this viewer setup. This is in version 3.6.0, branch: blender-v3.6-release, commit date: 2023-06-27 08:08, hash:
c7fc78b81ecb
.Disconnecting the Hit Normal output from the Reflect node (leaving the default 0 0 0) changes the velocity in a way that makes the Raycast node do what I think the user wanted to, making the point teleport on each bounce. But of course this means it won't work with inclined surfaces. For collision detection, consider using the velocity length as a basis for the Ray Length input of the Raycast node.
Not a bug, but an error in the node tree. There are several of them:
It seems that what follows is no longer about bugs and can be considered expected behavior.
For more information on why this isn't considered a bug, visit: https://wiki.blender.org/wiki/Reference/Not_a_bug