The Quantum map is a Quantum asset that contains information about the level and is used by the deterministic simulation to drive gameplay. Only one map can be loaded at a time. More...
Public Member Functions | |
override void | Disposed (IResourceManager resourceManager, Native.Allocator allocator) |
Called by the resource manager when the map asset was disposed to release memory. More... | |
void | EnsurePhysicsWorldSizeInValidRange () |
Post-process and clamp the physics world size. More... | |
NavMesh | GetNavMesh (String name) |
Get namvesh by name. More... | |
Int32 | GetStaticColliderTrianglesSerializedSize (bool isWriting) |
Get the serialized size of the static collider triangles data. More... | |
override void | Loaded (IResourceManager resourceManager, Native.Allocator allocator) |
Called by the resource manager when the map asset was loaded. Used to deserialize map data allocate memory and initialize map data structures. More... | |
void | SerializeStaticColliderTriangles (ByteStream stream, Native.Allocator allocator, Boolean write) |
Serialize or deserialize the static collider triangles data. More... | |
Public Attributes | |
UnmanagedTriangleArray | AllRuntimeTriangles = new UnmanagedTriangleArray() |
The unmanaged buffer containing all static triangles for this map. More... | |
PhysicsCommon.BucketAxis | BucketingAxis = PhysicsCommon.BucketAxis.X |
Physics entries are put into buckets according to their position in the bucketing axis. More... | |
Int32 | BucketsCount = 16 |
The amount of buckets used in the broad phase, which are resolved in parallel. Use a reasonable amount according to how many physics entries (colliders) you have. Too many buckets and the handling overhead increases without any performance gain because there are only few entries in each one; too few buckets and there will be an excessive amount of entries in each, slowing down the broad phase performance. More... | |
Int32 | BucketsSubdivisions = 8 |
Regular queries (overlaps and raycasts) use a stabbing approach for checking as few entries as possible in the buckets subdivisions. Tweak the number in accordance with the expected amount of entries and regular queries you perform. Too many subdivisions will add overhead without performance, while too few will result in queries taking longer to resolve, because they will have to check too many entries. More... | |
SortedDictionary< int, MeshTriangleVerticesCcw > | CollidersManagedTriangles = new SortedDictionary<Int32, MeshTriangleVerticesCcw>() |
The edit-time lookup for 3D static collider triangles. More... | |
SortedDictionary< int, MeshUnmanagedTrianglesRef > | CollidersRuntimeTriangles = new SortedDictionary<Int32, MeshUnmanagedTrianglesRef>() |
The runtime lookup for 3D static collider triangles. More... | |
Int32 | GridNodeSize = 4 |
The number of Unity units per navmesh grid cell. Must be multiple of 2. More... | |
Int32 | GridSizeX = 64 |
Number of navmesh grid cells in x-dimension. Toggle Navmesh Grid or Navmesh Area gizmos to preview. More... | |
Int32 | GridSizeY = 64 |
Number of navmesh grid cells in y-dimension. Toggle Navmesh Grid or Navmesh Area gizmos to preview. More... | |
ComponentPrototypeSet[] | MapEntities = Array.Empty<ComponentPrototypeSet>() |
The list of entities baked into this map. More... | |
Dictionary< String, NavMesh > | NavMeshes |
The lookup table for navmeshes. Use navmesh names to find the navmesh object. The mapping is created during the asset Loaded callback. More... | |
AssetRef< NavMesh >[] | NavMeshLinks = Array.Empty<AssetRef<NavMesh>>() |
The list not navmesh assets baked into this map. More... | |
Dictionary< String, Int32 > | RegionMap |
The region map lookup table. Use region names to find the region index. The mapping is created during the asset Loaded callback. More... | |
string[] | Regions = Array.Empty<string>() |
The list of navmesh region names baked into this map. More... | |
String | Scene |
The Unity scene name is baked into the map. It's loaded automatically if Simulation.AutoLoadSceneFromMap is enabled. More... | |
String | SceneGuid |
The Unity scene guid is baked into the map for convenience. More... | |
FP | SceneMeshCellSize = FP._4 |
Defines the size of the cells into which the 3D triangle soup is divided. This number should be adapted based on how dense the meshes' triangles density to get a reasonable amount of triangles per cell. For better visualization enable related fields in the QuantumEditorSettings asset's Collider gizmos section. This will affect the performance of both the broad phase and regular queries. Use the Task Profiler to analyse the performance and find the most suitable number for your game. More... | |
String | ScenePath |
The Unity scene path is baked into the map for convenience. More... | |
Int32 | SerializedTriangleDataUncompressedSize |
How big the serialized triangle data is in uncompressed form. More... | |
Boolean | SerializeTrianglesMetadata = false |
If triangles metadata should be serialized (true) or recomputed (false) More... | |
PhysicsCommon.SortAxis | SortingAxis = PhysicsCommon.SortAxis.Y |
The queries in a bucket are sorted according to their position in the sorting axis. More... | |
MapStaticCollider2D[] | StaticColliders2D = Array.Empty<MapStaticCollider2D>() |
All static 2D colliders baked into this map. More... | |
MapStaticCollider3D[] | StaticColliders3D = Array.Empty<MapStaticCollider3D>() |
All static 3D colliders baked into this map. More... | |
SortedDictionary< int, TriangleCCW[]> | StaticColliders3DTriangles => null |
Obsolete More... | |
AssetRef< BinaryData > | StaticColliders3DTrianglesData |
Binary 3D triangle data is saved on an addition Quantum asset. More... | |
List< PolygonColliderRuntimeData > | StaticPolygonColliderData = new List<PolygonColliderRuntimeData>() |
The list of static 2D polygon collider runtime data. More... | |
Int32 | TriangleMeshCellSize = -1 |
Obsolete. Use SceneMeshCellSize instead for representing the cell size with an FP value. More... | |
AssetRef | UserAsset |
An optional generic asset reference that the map can be associated with. More... | |
Int32 | WorldSize = 256 |
The physics scene size in the bucketing axis. The broad phase is clamped by a bounding box of all physics entries between -WorldSize/2 to WorldSize/2. It is therefore crucial to ensure the world is big enough to encompass all entities. If an entity is outside the world, it will cost you performance as it is added to either the first or last bucket. Everything outside the bounding box is considered to be at the world's edge, from the physics engine perspective, which will result in false collision candidates. In the non bucketing axis, the physics world is only limited by the value range of FP.UsableMin to FP.UsableMax. More... | |
Protected Member Functions | |
virtual void | InitializeStaticTriangles (IResourceManager resourceManager, Native.Allocator allocator) |
Initialize static 3D triangles. More... | |
virtual void | ReadTrianglesFromBakeData (ByteStream stream, Native.Allocator allocator) |
Deserialize the static collider triangles data. More... | |
virtual void | WriteTrianglesFromBakeData (ByteStream stream) |
Serialize the static collider triangles data. More... | |
Properties | |
Int32 | WorldExtentX [get] |
The world extent in X-dimension that is covered by the Map.GridSizeX. Used by the navmesh system. More... | |
Int32 | WorldExtentY [get] |
The world extent in Y-dimension that is covered by the Map.GridSizeY. Used by the navmesh system. More... | |
FPVector2 | WorldOffset [get] |
The world offset. Used by the navmesh system. More... | |
Int32 | WorldSizeX [get] |
The world size in X-dimension that is covered by the Map.GridSizeX. Used by the navmesh system. More... | |
Int32 | WorldSizeY [get] |
The world size in Y-dimension that is covered by the Map.GridSizeY. Used by the navmesh system. More... | |
The Quantum map is a Quantum asset that contains information about the level and is used by the deterministic simulation to drive gameplay. Only one map can be loaded at a time.
|
inline |
Serialize or deserialize the static collider triangles data.
stream | Input stream |
allocator | Allocator |
write | Write or read |
|
inlineprotectedvirtual |
Serialize the static collider triangles data.
stream | The stream to write to. |
|
inlineprotectedvirtual |
Deserialize the static collider triangles data.
stream | The stream to read from. |
allocator | The Photon.Deterministic.Native.Allocator for this asset. |
|
inline |
Get the serialized size of the static collider triangles data.
isWriting | If the stream is writing. |
|
inline |
Called by the resource manager when the map asset was disposed to release memory.
resourceManager | Resource manager |
allocator | Allocator |
|
inline |
Called by the resource manager when the map asset was loaded. Used to deserialize map data allocate memory and initialize map data structures.
resourceManager | Resource manager |
allocator | Allocator |
|
inlineprotectedvirtual |
Initialize static 3D triangles.
resourceManager | The resource manager for this asset. |
allocator | The Photon.Deterministic.Native.Allocator for this asset. |
Reimplemented in Quantum.DynamicMap.
|
inline |
Get namvesh by name.
name | Navmesh name |
null
.
|
inline |
Post-process and clamp the physics world size.
AssetRef Quantum.Map.UserAsset |
An optional generic asset reference that the map can be associated with.
String Quantum.Map.Scene |
The Unity scene name is baked into the map. It's loaded automatically if Simulation.AutoLoadSceneFromMap is enabled.
String Quantum.Map.ScenePath |
The Unity scene path is baked into the map for convenience.
String Quantum.Map.SceneGuid |
The Unity scene guid is baked into the map for convenience.
Int32 Quantum.Map.WorldSize = 256 |
The physics scene size in the bucketing axis. The broad phase is clamped by a bounding box of all physics entries between -WorldSize/2 to WorldSize/2. It is therefore crucial to ensure the world is big enough to encompass all entities. If an entity is outside the world, it will cost you performance as it is added to either the first or last bucket. Everything outside the bounding box is considered to be at the world's edge, from the physics engine perspective, which will result in false
collision candidates. In the non bucketing axis, the physics world is only limited by the value range of FP.UsableMin to FP.UsableMax.
Int32 Quantum.Map.BucketsCount = 16 |
The amount of buckets used in the broad phase, which are resolved in parallel. Use a reasonable amount according to how many physics entries (colliders) you have. Too many buckets and the handling overhead increases without any performance gain because there are only few entries in each one; too few buckets and there will be an excessive amount of entries in each, slowing down the broad phase performance.
Int32 Quantum.Map.BucketsSubdivisions = 8 |
Regular queries (overlaps and raycasts) use a stabbing approach for checking as few entries as possible in the buckets subdivisions. Tweak the number in accordance with the expected amount of entries and regular queries you perform. Too many subdivisions will add overhead without performance, while too few will result in queries taking longer to resolve, because they will have to check too many entries.
PhysicsCommon.BucketAxis Quantum.Map.BucketingAxis = PhysicsCommon.BucketAxis.X |
Physics entries are put into buckets according to their position in the bucketing axis.
PhysicsCommon.SortAxis Quantum.Map.SortingAxis = PhysicsCommon.SortAxis.Y |
The queries in a bucket are sorted according to their position in the sorting axis.
Defines the size of the cells into which the 3D triangle soup is divided. This number should be adapted based on how dense the meshes' triangles density to get a reasonable amount of triangles per cell. For better visualization enable related fields in the QuantumEditorSettings asset's Collider gizmos section. This will affect the performance of both the broad phase and regular queries. Use the Task Profiler to analyse the performance and find the most suitable number for your game.
Int32 Quantum.Map.TriangleMeshCellSize = -1 |
Obsolete. Use SceneMeshCellSize instead for representing the cell size with an FP value.
AssetRef<BinaryData> Quantum.Map.StaticColliders3DTrianglesData |
Binary 3D triangle data is saved on an addition Quantum asset.
Boolean Quantum.Map.SerializeTrianglesMetadata = false |
If triangles metadata should be serialized (true) or recomputed (false)
Int32 Quantum.Map.GridSizeX = 64 |
Number of navmesh grid cells in x-dimension. Toggle Navmesh Grid or Navmesh Area gizmos to preview.
Int32 Quantum.Map.GridSizeY = 64 |
Number of navmesh grid cells in y-dimension. Toggle Navmesh Grid or Navmesh Area gizmos to preview.
Int32 Quantum.Map.GridNodeSize = 4 |
The number of Unity units per navmesh grid cell. Must be multiple of 2.
The list not navmesh assets baked into this map.
string [] Quantum.Map.Regions = Array.Empty<string>() |
The list of navmesh region names baked into this map.
MapStaticCollider2D [] Quantum.Map.StaticColliders2D = Array.Empty<MapStaticCollider2D>() |
All static 2D colliders baked into this map.
MapStaticCollider3D [] Quantum.Map.StaticColliders3D = Array.Empty<MapStaticCollider3D>() |
All static 3D colliders baked into this map.
ComponentPrototypeSet [] Quantum.Map.MapEntities = Array.Empty<ComponentPrototypeSet>() |
The list of entities baked into this map.
Int32 Quantum.Map.SerializedTriangleDataUncompressedSize |
How big the serialized triangle data is in uncompressed form.
SortedDictionary<int, MeshTriangleVerticesCcw> Quantum.Map.CollidersManagedTriangles = new SortedDictionary<Int32, MeshTriangleVerticesCcw>() |
The edit-time lookup for 3D static collider triangles.
SortedDictionary<int, MeshUnmanagedTrianglesRef> Quantum.Map.CollidersRuntimeTriangles = new SortedDictionary<Int32, MeshUnmanagedTrianglesRef>() |
The runtime lookup for 3D static collider triangles.
UnmanagedTriangleArray Quantum.Map.AllRuntimeTriangles = new UnmanagedTriangleArray() |
The unmanaged buffer containing all static triangles for this map.
List<PolygonColliderRuntimeData> Quantum.Map.StaticPolygonColliderData = new List<PolygonColliderRuntimeData>() |
The list of static 2D polygon collider runtime data.
Dictionary<String, NavMesh> Quantum.Map.NavMeshes |
The lookup table for navmeshes. Use navmesh names to find the navmesh object. The mapping is created during the asset Loaded callback.
Dictionary<String, Int32> Quantum.Map.RegionMap |
The region map lookup table. Use region names to find the region index. The mapping is created during the asset Loaded callback.
SortedDictionary<int, TriangleCCW[]> Quantum.Map.StaticColliders3DTriangles => null |
Obsolete
|
get |
The world size in X-dimension that is covered by the Map.GridSizeX. Used by the navmesh system.
|
get |
The world size in Y-dimension that is covered by the Map.GridSizeY. Used by the navmesh system.
|
get |
The world extent in X-dimension that is covered by the Map.GridSizeX. Used by the navmesh system.
|
get |
The world extent in Y-dimension that is covered by the Map.GridSizeY. Used by the navmesh system.
|
get |
The world offset. Used by the navmesh system.