Skip to content

Commit

Permalink
remove redundant function
Browse files Browse the repository at this point in the history
  • Loading branch information
meganrm committed Dec 4, 2023
1 parent 5227103 commit fb9c7f5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
7 changes: 1 addition & 6 deletions src/visGeometry/ColorHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -191,14 +191,9 @@ class ColorHandler {
};
}

public getColorForAgentType(agentType: number): Color {
const index = this.getColorIdForAgentType(agentType);
return this.getColorById(index);
}

public getColorInfoForAgentType(agentType: number): AgentColorInfo {
const color = this.getColorForAgentType(agentType);
const colorId = this.getColorIdForAgentType(agentType);
const color = this.getColorById(colorId);
return { color, colorId };
}
}
Expand Down
6 changes: 3 additions & 3 deletions src/visGeometry/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1408,7 +1408,7 @@ class VisGeometry {
this.legacyRenderer.addPdb(
pdbEntry,
visAgent,
this.colorHandler.getColorForAgentType(typeId),
this.colorHandler.getColorInfoForAgentType(typeId).color,
this.lodDistanceStops
);
} else {
Expand Down Expand Up @@ -1441,7 +1441,7 @@ class VisGeometry {
(meshGeom as Mesh).geometry,
visAgent,
radius * scale,
this.colorHandler.getColorForAgentType(typeId)
this.colorHandler.getColorInfoForAgentType(typeId).color
);
} else {
if (meshEntry && meshEntry.instances) {
Expand Down Expand Up @@ -1474,7 +1474,7 @@ class VisGeometry {
this.legacyRenderer.addFiber(
visAgent,
agentData.cr * scale,
this.colorHandler.getColorForAgentType(typeId)
this.colorHandler.getColorInfoForAgentType(typeId).color
);
} else {
// update/add to render list
Expand Down

0 comments on commit fb9c7f5

Please sign in to comment.