|
124 | 124 | "name": "assets\\Heightmap.png", |
125 | 125 | "smoothed": true, |
126 | 126 | "userAdded": false |
| 127 | + }, |
| 128 | + { |
| 129 | + "file": "assets/New image.png", |
| 130 | + "kind": "image", |
| 131 | + "metadata": "{\"extension\":\".png\",\"pskl\":{}}", |
| 132 | + "name": "New image", |
| 133 | + "smoothed": true, |
| 134 | + "userAdded": false |
127 | 135 | } |
128 | 136 | ], |
129 | 137 | "resourceFolders": [] |
|
2237 | 2245 | "windowMask": false |
2238 | 2246 | }, |
2239 | 2247 | "objectsGroups": [], |
2240 | | - "variables": [], |
| 2248 | + "variables": [ |
| 2249 | + { |
| 2250 | + "name": "CameraElevationAngle", |
| 2251 | + "type": "number", |
| 2252 | + "value": 90 |
| 2253 | + }, |
| 2254 | + { |
| 2255 | + "name": "CameraRotationAngle", |
| 2256 | + "type": "number", |
| 2257 | + "value": 0 |
| 2258 | + } |
| 2259 | + ], |
2241 | 2260 | "instances": [ |
2242 | 2261 | { |
2243 | 2262 | "angle": 0, |
2244 | 2263 | "customSize": true, |
2245 | 2264 | "depth": 64, |
2246 | | - "height": 500, |
| 2265 | + "height": 800, |
2247 | 2266 | "layer": "", |
2248 | 2267 | "name": "NewHeightMap3D", |
2249 | 2268 | "persistentUuid": "644853ac-2a9d-414d-86aa-a9967cf996bd", |
2250 | | - "width": 500, |
2251 | | - "x": 401, |
2252 | | - "y": 105, |
| 2269 | + "width": 800, |
| 2270 | + "x": 251, |
| 2271 | + "y": -35, |
2253 | 2272 | "zOrder": 1, |
2254 | 2273 | "numberProperties": [], |
2255 | 2274 | "stringProperties": [], |
|
2269 | 2288 | "HeightMapImage": "assets\\Heightmap.png", |
2270 | 2289 | "FieldDimensionX": 257, |
2271 | 2290 | "FieldDimensionY": 257, |
2272 | | - "WhiteValue": 100 |
| 2291 | + "WhiteValue": 100, |
| 2292 | + "ImageOffsetX": 0, |
| 2293 | + "ImageOffsetY": 0 |
2273 | 2294 | } |
2274 | 2295 | } |
2275 | 2296 | ], |
|
2281 | 2302 | } |
2282 | 2303 | ] |
2283 | 2304 | }, |
2284 | | - "events": [], |
| 2305 | + "events": [ |
| 2306 | + { |
| 2307 | + "colorB": 228, |
| 2308 | + "colorG": 176, |
| 2309 | + "colorR": 74, |
| 2310 | + "creationTime": 0, |
| 2311 | + "name": "Camera rotation", |
| 2312 | + "source": "", |
| 2313 | + "type": "BuiltinCommonInstructions::Group", |
| 2314 | + "events": [ |
| 2315 | + { |
| 2316 | + "type": "BuiltinCommonInstructions::Standard", |
| 2317 | + "conditions": [ |
| 2318 | + { |
| 2319 | + "type": { |
| 2320 | + "value": "DepartScene" |
| 2321 | + }, |
| 2322 | + "parameters": [ |
| 2323 | + "" |
| 2324 | + ] |
| 2325 | + } |
| 2326 | + ], |
| 2327 | + "actions": [ |
| 2328 | + { |
| 2329 | + "type": { |
| 2330 | + "value": "ThirdPersonCamera::LookFromDistanceAtPosition" |
| 2331 | + }, |
| 2332 | + "parameters": [ |
| 2333 | + "", |
| 2334 | + "SceneWindowWidth() / 2", |
| 2335 | + "SceneWindowHeight() / 2", |
| 2336 | + "1200", |
| 2337 | + "0", |
| 2338 | + "90", |
| 2339 | + "", |
| 2340 | + "" |
| 2341 | + ] |
| 2342 | + } |
| 2343 | + ] |
| 2344 | + }, |
| 2345 | + { |
| 2346 | + "type": "BuiltinCommonInstructions::Standard", |
| 2347 | + "conditions": [], |
| 2348 | + "actions": [], |
| 2349 | + "events": [ |
| 2350 | + { |
| 2351 | + "type": "BuiltinCommonInstructions::Standard", |
| 2352 | + "conditions": [ |
| 2353 | + { |
| 2354 | + "type": { |
| 2355 | + "value": "MouseButtonPressed" |
| 2356 | + }, |
| 2357 | + "parameters": [ |
| 2358 | + "", |
| 2359 | + "Left" |
| 2360 | + ] |
| 2361 | + }, |
| 2362 | + { |
| 2363 | + "type": { |
| 2364 | + "value": "BuiltinCommonInstructions::Once" |
| 2365 | + }, |
| 2366 | + "parameters": [] |
| 2367 | + } |
| 2368 | + ], |
| 2369 | + "actions": [ |
| 2370 | + { |
| 2371 | + "type": { |
| 2372 | + "value": "MousePointerLock::RequestPointerLock" |
| 2373 | + }, |
| 2374 | + "parameters": [ |
| 2375 | + "", |
| 2376 | + "" |
| 2377 | + ] |
| 2378 | + } |
| 2379 | + ] |
| 2380 | + }, |
| 2381 | + { |
| 2382 | + "type": "BuiltinCommonInstructions::Standard", |
| 2383 | + "conditions": [ |
| 2384 | + { |
| 2385 | + "type": { |
| 2386 | + "value": "MouseButtonReleased" |
| 2387 | + }, |
| 2388 | + "parameters": [ |
| 2389 | + "", |
| 2390 | + "Left" |
| 2391 | + ] |
| 2392 | + } |
| 2393 | + ], |
| 2394 | + "actions": [ |
| 2395 | + { |
| 2396 | + "type": { |
| 2397 | + "value": "MousePointerLock::ExitPointerLock" |
| 2398 | + }, |
| 2399 | + "parameters": [ |
| 2400 | + "", |
| 2401 | + "" |
| 2402 | + ] |
| 2403 | + } |
| 2404 | + ] |
| 2405 | + }, |
| 2406 | + { |
| 2407 | + "type": "BuiltinCommonInstructions::Standard", |
| 2408 | + "conditions": [ |
| 2409 | + { |
| 2410 | + "type": { |
| 2411 | + "value": "MouseButtonPressed" |
| 2412 | + }, |
| 2413 | + "parameters": [ |
| 2414 | + "", |
| 2415 | + "Left" |
| 2416 | + ] |
| 2417 | + } |
| 2418 | + ], |
| 2419 | + "actions": [ |
| 2420 | + { |
| 2421 | + "type": { |
| 2422 | + "value": "SetNumberVariable" |
| 2423 | + }, |
| 2424 | + "parameters": [ |
| 2425 | + "CameraElevationAngle", |
| 2426 | + "=", |
| 2427 | + "clamp(CameraElevationAngle + MousePointerLock::MovementY() / 5, 15, 89)" |
| 2428 | + ] |
| 2429 | + }, |
| 2430 | + { |
| 2431 | + "type": { |
| 2432 | + "value": "SetNumberVariable" |
| 2433 | + }, |
| 2434 | + "parameters": [ |
| 2435 | + "CameraRotationAngle", |
| 2436 | + "+", |
| 2437 | + "MousePointerLock::MovementX() / 5" |
| 2438 | + ] |
| 2439 | + }, |
| 2440 | + { |
| 2441 | + "type": { |
| 2442 | + "value": "ThirdPersonCamera::LookFromDistanceAtPosition" |
| 2443 | + }, |
| 2444 | + "parameters": [ |
| 2445 | + "", |
| 2446 | + "SceneWindowWidth() / 2", |
| 2447 | + "SceneWindowHeight() / 2", |
| 2448 | + "1200", |
| 2449 | + "CameraRotationAngle", |
| 2450 | + "CameraElevationAngle", |
| 2451 | + "", |
| 2452 | + "" |
| 2453 | + ] |
| 2454 | + } |
| 2455 | + ] |
| 2456 | + } |
| 2457 | + ] |
| 2458 | + } |
| 2459 | + ], |
| 2460 | + "parameters": [] |
| 2461 | + } |
| 2462 | + ], |
2285 | 2463 | "layers": [ |
2286 | 2464 | { |
2287 | 2465 | "ambientLightColorB": 200, |
|
2429 | 2607 | " this.mesh.rotation.order = 'ZYX';", |
2430 | 2608 | " this.mesh.position.x = 32;", |
2431 | 2609 | " this.mesh.position.y = 32;", |
2432 | | - " //this.mesh.scale.y = -1;", |
| 2610 | + " this.mesh.scale.y = -1;", |
2433 | 2611 | " object.get3DRendererObject().add(this.mesh);", |
2434 | 2612 | " // // Ensure a forward compatibility when vertexColors will be set to true", |
2435 | 2613 | " // // in the engine to allow to tint 3D custom objects.", |
|
2488 | 2666 | " * @returns {integer}", |
2489 | 2667 | " */", |
2490 | 2668 | " getVerticeZIndex(indexX, indexY) {", |
2491 | | - " return 2 + 3 * (indexX + (this.dimY - 1 - indexY) * this.dimX);", |
| 2669 | + " return 2 + 3 * (indexX + indexY * this.dimX);", |
2492 | 2670 | " }", |
2493 | 2671 | "", |
2494 | 2672 | " /**", |
|
2586 | 2764 | " // Jolt.HeightFieldShapeConstantValues.prototype.cNoCollisionValue;", |
2587 | 2765 | " }", |
2588 | 2766 | " const shape = shapeSettings.Create().Get();", |
| 2767 | + " Jolt.destroy(shapeSettings);", |
| 2768 | + " const scaledShape = shape.ScaleShape(_sharedData.getVec3(1, 1, -1)).Get();", |
| 2769 | + " ", |
2589 | 2770 | "", |
2590 | 2771 | " // console.log(", |
2591 | 2772 | " // \"Shape local AABB\",", |
|
2602 | 2783 | " const rotation = this._getPhysicsRotation(_sharedData.getQuat(0, 0, 0, 1));", |
2603 | 2784 | "", |
2604 | 2785 | " // console.log(\"position\", position.GetX(), position.GetY(), position.GetZ());", |
2605 | | - " const creationSettings = new Jolt.BodyCreationSettings(shape, position, rotation, Jolt.EMotionType_Static, physics.getBodyLayer());", |
| 2786 | + " const creationSettings = new Jolt.BodyCreationSettings(scaledShape, position, rotation, Jolt.EMotionType_Static, physics.getBodyLayer());", |
2606 | 2787 | " const body = _sharedData.bodyInterface.CreateBody(creationSettings);", |
2607 | 2788 | " Jolt.destroy(creationSettings);", |
2608 | 2789 | " _sharedData.bodyInterface.AddBody(", |
|
0 commit comments