added screenSpace size to reference point
This commit is contained in:
@@ -1,10 +1,11 @@
|
||||
import * as THREE from "three";
|
||||
import { Box, ScreenSizer } from "@react-three/drei";
|
||||
import * as Constants from "../../../../types/world/worldConstants";
|
||||
|
||||
import BoxMaterial from "../../wrappers/materials/boxMaterial";
|
||||
|
||||
function ReferencePoint({ point }: { readonly point: Point }) {
|
||||
const boxScale: [number, number, number] = Constants.pointConfig.boxScale;
|
||||
const boxScale: [number, number, number] = Constants.pointConfig.screenSpaceBoxScale;
|
||||
const colors = {
|
||||
defaultInnerColor: Constants.pointConfig.defaultInnerColor,
|
||||
defaultOuterColor: Constants.pointConfig.helperColor,
|
||||
@@ -29,10 +30,11 @@ function ReferencePoint({ point }: { readonly point: Point }) {
|
||||
if (!point) return null;
|
||||
|
||||
return (
|
||||
<mesh position={new THREE.Vector3(...point.position)} name={pointName} uuid={point.pointUuid} userData={point}>
|
||||
<boxGeometry args={boxScale} />
|
||||
<BoxMaterial variant="box1" uOuterColor={colors.defaultOuterColor} uInnerColor={colors.defaultInnerColor} />
|
||||
</mesh>
|
||||
<ScreenSizer scale={1} position={new THREE.Vector3(...point.position)} name={pointName} uuid={point.pointUuid} userData={point}>
|
||||
<Box args={boxScale}>
|
||||
<BoxMaterial variant="box1" uOuterColor={colors.defaultOuterColor} uInnerColor={colors.defaultInnerColor} />
|
||||
</Box>
|
||||
</ScreenSizer>
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user