| 291 | } |
| 292 | |
| 293 | void Terrain::SetPhysicalMaterials(const Array<JsonAssetReference<PhysicalMaterial>, FixedAllocation<8>>& value) |
| 294 | { |
| 295 | PROFILE_MEM(LevelTerrain); |
| 296 | _physicalMaterials = value; |
| 297 | _physicalMaterials.Resize(8); |
| 298 | JsonAsset* materials[8]; |
| 299 | for (int32 i = 0; i < 8; i++) |
| 300 | materials[i] = _physicalMaterials[i]; |
| 301 | for (int32 pathIndex = 0; pathIndex < _patches.Count(); pathIndex++) |
| 302 | { |
| 303 | const auto patch = _patches.Get()[pathIndex]; |
| 304 | if (patch->HasCollision()) |
| 305 | PhysicsBackend::SetShapeMaterials(patch->_physicsShape, ToSpan(materials, 8)); |
| 306 | } |
| 307 | } |
| 308 | |
| 309 | int32 Terrain::GetHeightmapSize() const |
| 310 | { |