2025-12-07 22:01:26 +00:00
|
|
|
import { useMemo } from "react";
|
2025-11-30 19:44:47 +00:00
|
|
|
import type { TorqueObject } from "../torqueScript";
|
|
|
|
|
import { getPosition, getProperty, getRotation, getScale } from "../mission";
|
2025-12-07 22:01:26 +00:00
|
|
|
import { ShapeRenderer } from "./GenericShape";
|
2025-11-24 05:47:49 +00:00
|
|
|
import { ShapeInfoProvider } from "./ShapeInfoProvider";
|
2025-11-15 03:05:24 +00:00
|
|
|
|
2025-11-30 19:44:47 +00:00
|
|
|
export function TSStatic({ object }: { object: TorqueObject }) {
|
|
|
|
|
const shapeName = getProperty(object, "shapeName");
|
2025-11-15 03:05:24 +00:00
|
|
|
|
2025-11-26 00:56:54 +00:00
|
|
|
const position = useMemo(() => getPosition(object), [object]);
|
|
|
|
|
const q = useMemo(() => getRotation(object), [object]);
|
|
|
|
|
const scale = useMemo(() => getScale(object), [object]);
|
2025-11-15 03:05:24 +00:00
|
|
|
|
2025-11-24 05:47:49 +00:00
|
|
|
if (!shapeName) {
|
|
|
|
|
console.error("<TSStatic> missing shapeName for object", object);
|
|
|
|
|
}
|
|
|
|
|
|
2025-11-15 03:05:24 +00:00
|
|
|
return (
|
2025-12-14 19:06:57 +00:00
|
|
|
<ShapeInfoProvider type="TSStatic" object={object} shapeName={shapeName}>
|
2025-11-26 00:56:54 +00:00
|
|
|
<group position={position} quaternion={q} scale={scale}>
|
2025-12-14 19:06:57 +00:00
|
|
|
<ShapeRenderer />
|
2025-11-24 05:47:49 +00:00
|
|
|
</group>
|
|
|
|
|
</ShapeInfoProvider>
|
2025-11-15 03:05:24 +00:00
|
|
|
);
|
|
|
|
|
}
|