Skip to content

Commit

Permalink
Minor update
Browse files Browse the repository at this point in the history
  • Loading branch information
Nebukam committed Dec 10, 2021
1 parent 6af20a8 commit 3764234
Show file tree
Hide file tree
Showing 11 changed files with 62 additions and 125 deletions.
2 changes: 1 addition & 1 deletion Runtime/Jobs/AgentKDTree.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public class AgentKDTree : Processor<AgentKDTreeJob>, IAgentKDTreeProvider
{


protected NativeArray<AgentTreeNode> m_outputTree = new NativeArray<AgentTreeNode>(0, Allocator.Persistent);
protected NativeArray<AgentTreeNode> m_outputTree = default;
public NativeArray<AgentTreeNode> outputTree { get { return m_outputTree; } }

#region Inputs
Expand Down
2 changes: 1 addition & 1 deletion Runtime/Jobs/AgentProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public IAgentGroup<IAgent> agents
internal List<Agent> m_lockedAgents = new List<Agent>();
public List<Agent> lockedAgents { get { return m_lockedAgents; } }

protected NativeArray<AgentData> m_outputAgents = new NativeArray<AgentData>(0, Allocator.Persistent);
protected NativeArray<AgentData> m_outputAgents = default;
public NativeArray<AgentData> outputAgents { get { return m_outputAgents; } }

protected float m_maxRadius = 0f;
Expand Down
65 changes: 50 additions & 15 deletions Runtime/Jobs/ORCA.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,33 +33,68 @@ public class ORCA : ProcessorChain, IPlanar
public AxisPair plane
{
get { return m_plane; }
set { m_plane = m_orcaPreparation.plane = m_orcaLines.plane = m_orcaApply.plane = m_raycasts.plane = value; }
set {
m_plane =
m_staticObstacles.plane =
m_dynamicObstacles.plane =
m_agents.plane =
m_raycasts.plane =
m_orcaLines.plane =
m_orcaApply.plane =
m_raycasts.plane = value;
}
}

#endregion

///
/// Fields
///
#region Preparation

// Preparation
protected ObstacleKDTreeBuilder<IDynObstacleProvider, DynObstacleProvider, DynObstacleKDTreeProcessor> m_dynamicObstacles;
protected ObstacleKDTreeBuilder<IStaticObstacleProvider, StaticObstacleProvider, StaticObstacleKDTreeProcessor> m_staticObstacles;
protected AgentKDTreeBuilder m_agents;
protected RaycastProvider m_raycastsProvider;

public IObstacleGroup staticObstacles
{
get { return m_staticObstacles.obstacles; }
set { m_staticObstacles.obstacles = value; }
}

public IObstacleGroup dynamicObstacles
{
get { return m_dynamicObstacles.obstacles; }
set { m_dynamicObstacles.obstacles = value; }
}

public IAgentGroup<IAgent> agents
{
get { return m_agents.agents; }
set { m_agents.agents = value; }
}

public IRaycastGroup raycasts
{
get { return m_raycastsProvider.raycasts; }
set { m_raycastsProvider.raycasts = value; }
}

#endregion

protected ORCAPreparation m_orcaPreparation;
protected ORCALines m_orcaLines;
protected ORCAApply m_orcaApply;
protected RaycastsPass m_raycasts;

///
/// Properties
///

public IObstacleGroup staticObstacles { get { return m_orcaPreparation.staticObstacles; } set { m_orcaPreparation.staticObstacles = value; } }
public IObstacleGroup dynamicObstacles { get { return m_orcaPreparation.dynamicObstacles; } set { m_orcaPreparation.dynamicObstacles = value; } }
public IAgentGroup<IAgent> agents { get { return m_orcaPreparation.agents; } set { m_orcaPreparation.agents = value; } }
public IRaycastGroup raycasts { get { return m_orcaPreparation.raycasts; } set { m_orcaPreparation.raycasts = value; } }

public ORCA()
{

Add(ref m_orcaPreparation);
// Preparation
Add(ref m_dynamicObstacles);
Add(ref m_staticObstacles);
Add(ref m_agents);
Add(ref m_raycastsProvider);

// Execution
Add(ref m_orcaLines);
m_orcaLines.chunkSize = 5; //Linear programs are hefty >.<

Expand Down
2 changes: 1 addition & 1 deletion Runtime/Jobs/ORCALines.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public class ORCALines : ParallelProcessor<ORCALinesJob>, IORCALinesProvider

public AxisPair plane { get; set; } = AxisPair.XY;

protected NativeArray<AgentDataResult> m_results = new NativeArray<AgentDataResult>(0, Allocator.Persistent);
protected NativeArray<AgentDataResult> m_results = default;
public NativeArray<AgentDataResult> results { get { return m_results; } }


Expand Down
87 changes: 0 additions & 87 deletions Runtime/Jobs/ORCAPreparation.cs

This file was deleted.

11 changes: 0 additions & 11 deletions Runtime/Jobs/ORCAPreparation.cs.meta

This file was deleted.

2 changes: 1 addition & 1 deletion Runtime/Jobs/ObstacleKDTree.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public class ObstacleKDTree<T> : Processor<ObstacleKDTreeJob>, IObstacleKDTreePr
where T : class, IProcessor, IObstacleProvider
{

protected NativeArray<ObstacleTreeNode> m_outputTree = new NativeArray<ObstacleTreeNode>(0, Allocator.Persistent);
protected NativeArray<ObstacleTreeNode> m_outputTree = default;
public NativeArray<ObstacleTreeNode> outputTree { get { return m_outputTree; } }

#region Inputs
Expand Down
6 changes: 3 additions & 3 deletions Runtime/Jobs/ObstacleProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@ public class ObstacleProvider : Processor<Unemployed>, IObstacleProvider

protected bool m_recompute = true;
protected IObstacleGroup m_obstacles = null;
protected NativeArray<ObstacleInfos> m_outputObstacleInfos = new NativeArray<ObstacleInfos>(0, Allocator.Persistent);
protected NativeArray<ObstacleVertexData> m_referenceObstacles = new NativeArray<ObstacleVertexData>(0, Allocator.Persistent);
protected NativeArray<ObstacleVertexData> m_outputObstacles = new NativeArray<ObstacleVertexData>(0, Allocator.Persistent);
protected NativeArray<ObstacleInfos> m_outputObstacleInfos = default;
protected NativeArray<ObstacleVertexData> m_referenceObstacles = default;
protected NativeArray<ObstacleVertexData> m_outputObstacles = default;


///
Expand Down
2 changes: 1 addition & 1 deletion Runtime/Jobs/RaycastProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public class RaycastProvider : Processor<Unemployed>, IRaycastProvider

protected IRaycastGroup m_raycasts = null;
protected List<Raycast> m_lockedRaycasts = new List<Raycast>();
protected NativeArray<RaycastData> m_outputRaycast = new NativeArray<RaycastData>(0, Allocator.Persistent);
protected NativeArray<RaycastData> m_outputRaycast = default;

///
/// Properties
Expand Down
2 changes: 1 addition & 1 deletion Runtime/Jobs/RaycastsPass.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public class RaycastsPass : ParallelProcessor<RaycastsJob>

public AxisPair plane { get; set; } = AxisPair.XY;

protected NativeArray<RaycastResult> m_results = new NativeArray<RaycastResult>(0, Allocator.Persistent);
protected NativeArray<RaycastResult> m_results = default;
public NativeArray<RaycastResult> results { get { return m_results; } }

#region Inputs
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "com.nebukam.orca",
"version": "1.1.0",
"version": "1.1.1",
"displayName": "N:ORCA",
"description": "Optimal Reciprocal Collision Avoidance",
"unity": "2019.4",
Expand All @@ -27,8 +27,8 @@
"com.unity.mathematics": "1.2.1"
},
"gitDependencies": {
"com.nebukam.common": "https://github.com/Nebukam/com.nebukam.common.git#0.1.0",
"com.nebukam.job-assist": "https://github.com/Nebukam/com.nebukam.job-assist.git#1.1.0"
"com.nebukam.common": "https://github.com/Nebukam/com.nebukam.common.git#0.1.1",
"com.nebukam.job-assist": "https://github.com/Nebukam/com.nebukam.job-assist.git#1.1.1"
},
"samples": [
{
Expand Down

0 comments on commit 3764234

Please sign in to comment.