feat: Integrate upsertProductOrEventApi in Simulations and Products components; adjust loadInitialFloorItems to accept renderDistance parameter; update material handling in addAssetModel and Vehicles components
This commit is contained in:
@@ -14,6 +14,7 @@ async function loadInitialFloorItems(
|
||||
itemsGroup: Types.RefGroup,
|
||||
setFloorItems: Types.setFloorItemSetState,
|
||||
addEvent: (event: EventsSchema) => void,
|
||||
renderDistance: number
|
||||
): Promise<void> {
|
||||
if (!itemsGroup.current) return;
|
||||
let url_Backend_dwinzo = `http://${process.env.REACT_APP_SERVER_MARKETPLACE_URL}`;
|
||||
@@ -65,7 +66,7 @@ async function loadInitialFloorItems(
|
||||
|
||||
const cameraPosition = new THREE.Vector3(storedPosition.x, storedPosition.y, storedPosition.z);
|
||||
|
||||
if (cameraPosition.distanceTo(itemPosition) < 50) {
|
||||
if (cameraPosition.distanceTo(itemPosition) < renderDistance) {
|
||||
await new Promise<void>(async (resolve) => {
|
||||
|
||||
// Check Three.js Cache
|
||||
@@ -210,7 +211,6 @@ function processLoadedModel(
|
||||
actionUuid: THREE.MathUtils.generateUUID(),
|
||||
actionName: "Vehicle Action",
|
||||
actionType: "travel",
|
||||
material: null,
|
||||
unLoadDuration: 5,
|
||||
loadCapacity: 10,
|
||||
pickUpPoint: null,
|
||||
|
||||
Reference in New Issue
Block a user