diff --git a/fission/src/Synthesis.tsx b/fission/src/Synthesis.tsx index d0791238e1..87e12bf37c 100644 --- a/fission/src/Synthesis.tsx +++ b/fission/src/Synthesis.tsx @@ -54,7 +54,7 @@ import World from "@/systems/World.ts" import { AddRobotsModal, AddFieldsModal, SpawningModal } from "@/modals/spawning/SpawningModals.tsx" import ImportMirabufModal from "@/modals/mirabuf/ImportMirabufModal.tsx" import ImportLocalMirabufModal from "@/modals/mirabuf/ImportLocalMirabufModal.tsx" -import APS, { ENDPOINT_SYNTHESIS_CHALLENGE } from "./aps/APS.ts" +import APS from "./aps/APS.ts" import ResetAllInputsModal from "./ui/modals/configuring/ResetAllInputsModal.tsx" import Skybox from './ui/components/Skybox.tsx'; diff --git a/fission/src/mirabuf/MirabufSceneObject.ts b/fission/src/mirabuf/MirabufSceneObject.ts index 22a579147f..eba3f7ad07 100644 --- a/fission/src/mirabuf/MirabufSceneObject.ts +++ b/fission/src/mirabuf/MirabufSceneObject.ts @@ -155,6 +155,10 @@ class MirabufSceneObject extends SceneObject { return mesh } + + public GetRootNodeId(): Jolt.BodyID | undefined { + return this._mechanism.GetBodyByNodeId(this._mechanism.rootBody) + } } export async function CreateMirabuf(assembly: mirabuf.Assembly): Promise { diff --git a/fission/src/systems/scene/SceneRenderer.ts b/fission/src/systems/scene/SceneRenderer.ts index c37f9bccbd..1eb135ce2d 100644 --- a/fission/src/systems/scene/SceneRenderer.ts +++ b/fission/src/systems/scene/SceneRenderer.ts @@ -3,7 +3,6 @@ import { TransformControls } from "three/examples/jsm/controls/TransformControls import SceneObject from "./SceneObject" import WorldSystem from "../WorldSystem" import { OrbitControls } from "three/examples/jsm/controls/OrbitControls.js" -import MirabufSceneObject from "@/mirabuf/MirabufSceneObject" import vertexShader from '@/shaders/vertex.glsl'; import fragmentShader from '@/shaders/fragment.glsl'; @@ -155,7 +154,7 @@ class SceneRenderer extends WorldSystem { this.RemoveAllSceneObjects() } - public RegisterSceneObject(obj: T): number { + public RegisterSceneObject(obj: T): number { const id = nextSceneObjectId++ obj.id = id this._sceneObjects.set(id, obj) diff --git a/fission/src/ui/components/Dropdown.tsx b/fission/src/ui/components/Dropdown.tsx index 96592caca2..bc70b33fe9 100644 --- a/fission/src/ui/components/Dropdown.tsx +++ b/fission/src/ui/components/Dropdown.tsx @@ -32,37 +32,11 @@ type DropdownProps = { const Dropdown: React.FC = ({ label, - className, options, onSelect, }) => { - const [expanded, setExpanded] = useState(false) - const [optionList, setOptionList] = useState(options) - type DropdownOptionProps = { - value: string - children?: ReactNode - className?: string - } - - const DropdownOption: React.FC = ({ - children, - value, - className, - }) => ( - { - const newOptions = options.filter(item => item !== value) - newOptions.unshift(value) - setOptionList(newOptions) - if (onSelect) onSelect(value) - }} - className={`block relative duration-100 hover:backdrop-brightness-90 w-full h-full px-2 py-2 ${className}`} - style={{ maxWidth: '249px', whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis', paddingRight: '25px'}} - > - {children} - - ) + const [optionList, _setOptionList] = useState(options) return ( <> @@ -151,25 +125,4 @@ const Popup = styled("div")` width: 100%; ` -//
setExpanded(!expanded)} -// className={`relative flex flex-col gap-2 select-none cursor-pointer bg-gradient-to-r from-interactive-element-left to-interactive-element-right w-full rounded-md ${className}`} -// > -// -// {optionList[0]} -// {optionList.length > 1 && ( -//
-// -// -//
-// )} -//
-// {expanded && -// optionList.slice(1).map(o => ( -// -// {o} -// -// ))} -//
- export default Dropdown diff --git a/fission/src/ui/components/MainHUD.tsx b/fission/src/ui/components/MainHUD.tsx index 7ab4f1182b..48f2c95927 100644 --- a/fission/src/ui/components/MainHUD.tsx +++ b/fission/src/ui/components/MainHUD.tsx @@ -12,7 +12,7 @@ import { motion } from "framer-motion" import logo from "@/assets/autodesk_logo.png" import { ToastType, useToastContext } from "@/ui/ToastContext" import { Random } from "@/util/Random" -import APS, { APS_USER_INFO_UPDATE_EVENT, ENDPOINT_SYNTHESIS_CHALLENGE } from "@/aps/APS" +import APS, { APS_USER_INFO_UPDATE_EVENT } from "@/aps/APS" import { UserIcon } from "./UserIcon" import World from "@/systems/World" import JOLT from "@/util/loading/JoltSyncLoader" diff --git a/fission/src/ui/components/TransformGizmo.tsx b/fission/src/ui/components/TransformGizmo.tsx index f56e6a1ada..674fe2fbeb 100644 --- a/fission/src/ui/components/TransformGizmo.tsx +++ b/fission/src/ui/components/TransformGizmo.tsx @@ -1,4 +1,3 @@ -import MirabufInstance from "@/mirabuf/MirabufInstance" import World from "@/systems/World" import * as THREE from "three" @@ -15,7 +14,7 @@ class TransformGizmo { World.SceneRenderer.UpdateTransformGizmoMode(value, this.mesh) } - constructor(TransformMode: "translate" | "rotate" | "scale", object?: MirabufInstance) { + constructor(TransformMode: "translate" | "rotate" | "scale") { this.mode = TransformMode ;(this.mesh = new THREE.Mesh(new THREE.SphereGeometry(5))), new THREE.MeshBasicMaterial({ color: 0xff0000 }) // add implementation in JIRA issue #1733 to wrap Mirabuf in Mesh which translates changes