public sealed class ScenePlacementTurns a pointer in a viewport into somewhere to put a new object.
No guide page documents this yet — the page shows what the code says about itself.
Remarks
Three answers, in order of how much the scene knows. On geometry, it lands on the surface. With nothing under the pointer, it lands on the ground plane, which is what makes dropping something into an empty scene work at all. With the camera looking at the sky and the ground plane behind it, it lands a fixed distance in front of the camera — because the alternative is a position at infinity or a silent refusal to drop.
⚠ The fallback plane is at the grid's height, not at zero. They are the same until somebody moves the working plane, and a drop that ignored it would put things at a different height from everything they had been placing.
Aligning to the surface is opt-in twice over. A crate dropped on a slope usually should be level and a decal usually should not, so which one is a setting rather than a guess — and it is the same SnapContext a gizmo drag consults, so the two cannot disagree. Face is what makes a drop land on the surface at all; AlignToTarget is what turns it once it has, and the second is on by default because standing a dropped object up is what this has always done.
Fields and properties (3)
public float GroundHeightWhere the ground plane is, in world units up.
public float FallbackDistanceHow far in front of the camera to drop when nothing else answers.
public SnapContext SnapWhat a drop rounds to.
Methods (2)
public Placement Resolve(Ray ray, ISurfaceProbe? probe = null)Where a pointer would put something.
public static Quaternion Upright(Vector3 normal)The rotation that stands an object up on a surface.
Used by (5)
- EditorApplicationVixen.Editor.App
- SceneTestsVixen.Editor.SceneView.Tests
- SceneViewportVixen.Editor.SceneView
- SnapCommandTestsVixen.Editor.App.Tests
- SnapContextTestsVixen.Editor.SceneView.Tests