Update model instance creation logic to use anchor position
This commit is contained in:
@@ -1149,9 +1149,17 @@ export function App({ store, initialStatusMessage }: AppProps) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
const anchorPosition =
|
||||||
|
selectedBrush !== null
|
||||||
|
? {
|
||||||
|
x: selectedBrush.center.x,
|
||||||
|
y: selectedBrush.center.y + selectedBrush.size.y * 0.5,
|
||||||
|
z: selectedBrush.center.z
|
||||||
|
}
|
||||||
|
: selectedModelInstance?.position ?? null;
|
||||||
const nextModelInstance = createModelInstance({
|
const nextModelInstance = createModelInstance({
|
||||||
assetId: asset.id,
|
assetId: asset.id,
|
||||||
position: createModelInstancePlacementPosition(asset, selectedBrush?.center ?? null),
|
position: createModelInstancePlacementPosition(asset, anchorPosition),
|
||||||
rotationDegrees: DEFAULT_MODEL_INSTANCE_ROTATION_DEGREES,
|
rotationDegrees: DEFAULT_MODEL_INSTANCE_ROTATION_DEGREES,
|
||||||
scale: DEFAULT_MODEL_INSTANCE_SCALE
|
scale: DEFAULT_MODEL_INSTANCE_SCALE
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user