Skip to content

Commit

Permalink
Merge branch 'develop' into housekeeping
Browse files Browse the repository at this point in the history
  • Loading branch information
RedImp1470 authored Nov 7, 2024
2 parents 8c97b6f + 61319f8 commit 2e925df
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 14 deletions.
2 changes: 1 addition & 1 deletion Examples/Complete/PickingRayCast/Core/PickingRayCast.cs
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ public override void Update()
if (!float2.PointInRectangle(new float2(camRect.Left, camRect.Top), new float2(camRect.Right, camRect.Bottom), Input.Mouse.Position))
continue;

if (pickCam == default || camRes.Camera.Layer > pickCam.Camera.Layer)
if (pickCam == default(CameraResult) || camRes.Camera.Layer > pickCam.Camera.Layer)
{
pickCam = camRes;
pickCamRect = camRect;
Expand Down
4 changes: 2 additions & 2 deletions Examples/Complete/PointCloudPotree2/Core/PointRenderParams.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ public ColorMode ColorMode
}
}

private int _size = 3;
public int Size
private float _size = 3;
public float Size
{
get { return _size; }
set
Expand Down
9 changes: 5 additions & 4 deletions src/Engine/Core/ScenePicker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using Fusee.Base.Core;
using Fusee.Engine.Common;
using Fusee.Engine.Core.Effects;
using Fusee.Engine.Core.Primitives;
using Fusee.Engine.Core.Scene;
using Fusee.Math.Core;
using Fusee.Xene;
Expand Down Expand Up @@ -279,7 +280,7 @@ protected override void InitState()
}

//Early out for the case that the scene is rendered with more than one canvas and the mouse isn't inside the correct one.
if (pickCam == null || pickCam == default)
if (pickCam == null || pickCam == default(CameraResult))
return null;

CurrentCameraResult = pickCam;
Expand Down Expand Up @@ -619,7 +620,7 @@ private void PickLineAdjacencyGeometry(Mesh mesh)
return;
}

if (CurrentCameraResult.Camera == default)
if (CurrentCameraResult.Camera == default(Camera))
return;

var size = CurrentCameraResult.Camera.GetViewportInPx(_canvasWidth, _canvasHeight);
Expand Down Expand Up @@ -719,7 +720,7 @@ private void PickLineGeometry(Mesh mesh)
return;
}

if (CurrentCameraResult.Camera == default)
if (CurrentCameraResult.Camera == default(Camera))
return;

var size = CurrentCameraResult.Camera.GetViewportInPx(_canvasWidth, _canvasHeight);
Expand Down Expand Up @@ -777,7 +778,7 @@ private void PickTriangleGeometry(Mesh mesh)
mesh.BoundingBox = new(mesh.Vertices.AsReadOnlySpan);
}

if (mesh is not Primitives.Plane && (mesh.BoundingBox.Size.x <= 0f || mesh.BoundingBox.Size.y <= 0f || mesh.BoundingBox.Size.z <= 0f))
if (mesh is not Plane && mesh is not NineSlicePlane && mesh is not Circle && mesh is not Line && (mesh.BoundingBox.Size.x <= 0f || mesh.BoundingBox.Size.y <= 0f || mesh.BoundingBox.Size.z <= 0f))
{
Diagnostics.Debug($"Size of current bounding box is 0 for one or more dimensions. Picking not possible.");
return;
Expand Down
5 changes: 3 additions & 2 deletions src/Engine/GUI/SceneInteractionHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,9 @@ private static SceneNode FindLeafNodeInPickRes(SceneNode firstPickRes, IList<Sce
/// <param name="canvasHeight">Canvas height - needed to determine the mouse position in clip space.</param>
public void CheckForInteractiveObjects(float2 mousePos, int canvasWidth, int canvasHeight)
{
var pickResults = _scenePicker.Pick(mousePos, canvasWidth, canvasHeight).ToList().OrderBy(pr => pr.ClipPos.z).ToList();
var pickResNodes = pickResults.ConvertAll(x => x.Node);
var pickResults = _scenePicker.Pick(mousePos, canvasWidth, canvasHeight);
if(pickResults == null) return;
var pickResNodes = pickResults.ToList().OrderBy(pr => pr.ClipPos.z).ToList().ConvertAll(x => x.Node);
var firstPickRes = pickResults.FirstOrDefault();

_pickRes = null;
Expand Down
2 changes: 1 addition & 1 deletion src/PointCloud/Common/MakePointCloudEffect.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public static ShaderEffect ForDepthPass(float size, PointSizeMode pointSizeMode,
/// <param name="pointSizeMode">The <see cref="PointSizeMode"/>.</param>
/// <param name="shape">The <see cref="PointShape"/>.</param>
/// <returns></returns>
public static ShaderEffect ForDepthPassInstanced(int size, PointSizeMode pointSizeMode, PointShape shape)
public static ShaderEffect ForDepthPassInstanced(float size, PointSizeMode pointSizeMode, PointShape shape)
{
return new ShaderEffect(

Expand Down
5 changes: 1 addition & 4 deletions src/PointCloud/Core/MeshMaker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -133,10 +133,7 @@ public static IEnumerable<TGpuData> CreateMeshes<TGpuData>(MemoryOwner<Visualiza
/// <returns></returns>
public static IEnumerable<TGpuData> CreateInstanceData<TGpuData>(MemoryOwner<VisualizationPoint> points, CreateGpuData<TGpuData> createGpuDataHandler)
{
return new List<TGpuData>
{
createGpuDataHandler(points)
};
return new List<TGpuData>() { createGpuDataHandler(points) };
}

public static MemoryOwner<VisualizationPoint> CreateVisualizationPoints(MemoryMappedFile mmf, int numberOfPoints, HandleReadExtraBytes? handleExtraBytes, CreateMeshMetaData metaData, EventHandler<ErrorEventArgs>? onPointCloudReadError)
Expand Down

0 comments on commit 2e925df

Please sign in to comment.