Skip to content

Commit

Permalink
Merge branch 'behavior-graphs-spike-rebased2' of https://github.com/m…
Browse files Browse the repository at this point in the history
…ozilla/hubs into behavior-graphs-spike-rebased2
  • Loading branch information
keianhzo committed Jan 12, 2024
2 parents 8459f01 + 1c8ea08 commit b909c33
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 2 deletions.
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,5 +72,4 @@ Mozilla and Hubs believe that privacy is fundamental to a healthy internet. Read

## License

Hubs is licensed with the [Mozilla Public License 2.0](./LICENSE)

Hubs is licensed with the [Mozilla Public License 2.0](./LICENSE)
22 changes: 22 additions & 0 deletions src/bit-systems/behavior-graph/entity-nodes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ import { definitionListToMap } from "./utils";
import { getComponentBindings } from "./bindings/bindings";
import { camelCase } from "../../inflators/model";
import { takeOwnership } from "../../utils/take-ownership";
import { hubIdFromUrl } from "../../utils/media-url-utils";
import { changeHub } from "../../change-hub";

type SocketTypeName =
| "string"
Expand Down Expand Up @@ -318,6 +320,26 @@ export const EntityNodes = definitionListToMap([
commit("flow");
}
}),
makeFlowNodeDefinition({
typeName: "hubs/misc/changehub",
category: "Components" as any,
label: "Change Hub",
in: {
flow: "flow",
url: "string"
},
out: { flow: "flow" },
initialState: undefined,
triggered: ({ read, commit, graph }) => {
const src: string = read("url");
const url = new URL(src);

const waypoint = url.hash && url.hash.substring(1);
const hubId = hubIdFromUrl(src);
changeHub(hubId, true, waypoint);
commit("flow");
}
}),
makeInNOutFunctionDesc({
name: "hubs/entity/localToWorld/vec3",
label: "Local to World",
Expand Down

0 comments on commit b909c33

Please sign in to comment.