fixed coords foorm
This commit is contained in:
parent
17ed2905c2
commit
0b3eefec2d
2 changed files with 16 additions and 15 deletions
|
@ -1,3 +1,4 @@
|
|||
import { Instance } from "../../../../core/model/scene_asset";
|
||||
import { FormState } from "../../../../core/store/base_store";
|
||||
import { CoreInput } from "../../../../core/ui/input/input";
|
||||
import { CoreText, CoreTextType } from "../../../../core/ui/text/text";
|
||||
|
@ -13,36 +14,36 @@ export const CoordsForm = ({ store, update }: { store: FormState<any, any>; upda
|
|||
<CoreText text="Позиция" type={CoreTextType.header} />
|
||||
|
||||
<CoreInput
|
||||
value={String(store.viewModel.vector3.x)}
|
||||
value={String(store.viewModel.position.x)}
|
||||
label="X"
|
||||
onChange={(text) => {
|
||||
store.updateForm({ vector3: store.viewModel.vector3.setX(Number(text)) });
|
||||
store.updateForm({ position: store.viewModel.position.setX(Number(text)) });
|
||||
update();
|
||||
}}
|
||||
/>
|
||||
<CoreInput
|
||||
value={String(store.viewModel.vector3.x)}
|
||||
value={String(store.viewModel.position.x)}
|
||||
label="Y"
|
||||
onChange={(text) => {
|
||||
store.updateForm({ vector3: store.viewModel.vector3.setY(Number(text)) });
|
||||
store.updateForm({ position: store.viewModel.position.setY(Number(text)) });
|
||||
update();
|
||||
}}
|
||||
/>
|
||||
<CoreInput
|
||||
value={String(store.viewModel.vector3.x)}
|
||||
value={String(store.viewModel.position.x)}
|
||||
label="Z"
|
||||
onChange={(text) => {
|
||||
store.updateForm({ vector3: store.viewModel.vector3.setZ(Number(text)) });
|
||||
store.updateForm({ position: store.viewModel.position.setZ(Number(text)) });
|
||||
update();
|
||||
}}
|
||||
/>
|
||||
<CoreText text="Кватернион" type={CoreTextType.header} />
|
||||
<CoreInput
|
||||
value={String(store.viewModel.quaternion[0])}
|
||||
value={String(store.viewModel.orientation[0])}
|
||||
label="X"
|
||||
onChange={(text) => {
|
||||
store.updateForm({
|
||||
quaternion: store.viewModel.quaternion.map((el: any, i: number) => {
|
||||
orientation: store.viewModel.orientation.map((el: any, i: number) => {
|
||||
if (i === 1) {
|
||||
return Number(text);
|
||||
}
|
||||
|
@ -53,11 +54,11 @@ export const CoordsForm = ({ store, update }: { store: FormState<any, any>; upda
|
|||
}}
|
||||
/>
|
||||
<CoreInput
|
||||
value={String(store.viewModel.quaternion[1])}
|
||||
value={String(store.viewModel.orientation[1])}
|
||||
label="Y"
|
||||
onChange={(text) => {
|
||||
store.updateForm({
|
||||
quaternion: store.viewModel.quaternion.map((el: any, i: number) => {
|
||||
orientation: store.viewModel.orientation.map((el: any, i: number) => {
|
||||
if (i === 2) {
|
||||
return Number(text);
|
||||
}
|
||||
|
@ -68,11 +69,11 @@ export const CoordsForm = ({ store, update }: { store: FormState<any, any>; upda
|
|||
}}
|
||||
/>
|
||||
<CoreInput
|
||||
value={String(store.viewModel.quaternion[2])}
|
||||
value={String(store.viewModel.orientation[2])}
|
||||
label="Z"
|
||||
onChange={(text) => {
|
||||
store.updateForm({
|
||||
quaternion: store.viewModel.quaternion.map((el: any, i: number) => {
|
||||
orientation: store.viewModel.orientation.map((el: any, i: number) => {
|
||||
if (i === 3) {
|
||||
return Number(text);
|
||||
}
|
||||
|
@ -83,11 +84,11 @@ export const CoordsForm = ({ store, update }: { store: FormState<any, any>; upda
|
|||
}}
|
||||
/>
|
||||
<CoreInput
|
||||
value={String(store.viewModel.quaternion[3])}
|
||||
value={String(store.viewModel.orientation[3])}
|
||||
label="W"
|
||||
onChange={(text) => {
|
||||
store.updateForm({
|
||||
quaternion: store.viewModel.quaternion.map((el: any, i: number) => {
|
||||
orientation: store.viewModel.orientation.map((el: any, i: number) => {
|
||||
if (i === 4) {
|
||||
return Number(text);
|
||||
}
|
||||
|
|
|
@ -16,7 +16,7 @@ export const SolidBodyForm = observer((props: IDefaultSceneManagerFormProps) =>
|
|||
}, []);
|
||||
|
||||
return (
|
||||
<div style={{ display: "flex", flexDirection: "column", alignItems: "center", overflowX: "auto", height: "100%" }}>
|
||||
<div style={{ display: "flex", flexDirection: "column", alignItems: "center", overflow: "auto", height: "100%" }}>
|
||||
<>
|
||||
{match(store.solidBodyStoreType)
|
||||
.with(SolidBodyStoreType.previewSolid, () => (
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue