Class: ObbGrid
This represents the grid you get by repeating the oriented bounding box of a surface. This can handle surfaces of all shapes. They may get approximated crudely, though, as this grid does not guarantee a predictable alignment of the obb (except that it aligns with an edge of the surface).
Hierarchy
↳ ObbGrid
Index
Constructors
Properties
Methods
Constructors
constructor
+ new ObbGrid(surface: MeshSurface): ObbGrid
Overrides Grid.constructor
Defined in src/modules/kyub.core.boxel/src/GridInferring/grids/ObbGrid.ts:26
Parameters:
| Name | Type |
|---|---|
surface |
MeshSurface |
Returns: ObbGrid
Properties
Protected obbBasisRotation
• obbBasisRotation: Quaternion‹› = new Quaternion()
Defined in src/modules/kyub.core.boxel/src/GridInferring/grids/ObbGrid.ts:26
Protected obbBasisRotationInverse
• obbBasisRotationInverse: Quaternion
Defined in src/modules/kyub.core.boxel/src/GridInferring/grids/ObbGrid.ts:23
Protected obbDimensions
• obbDimensions: Vector3
Defined in src/modules/kyub.core.boxel/src/GridInferring/grids/ObbGrid.ts:25
Protected obbPosition
• obbPosition: Vector3‹› = new Vector3()
Defined in src/modules/kyub.core.boxel/src/GridInferring/grids/ObbGrid.ts:24
Protected surface
• surface: MeshSurface
Defined in src/modules/kyub.core.boxel/src/GridInferring/grids/Grid.ts:13
Methods
Protected _getObb
▸ _getObb(): OBB‹›
Defined in src/modules/kyub.core.boxel/src/GridInferring/grids/ObbGrid.ts:77
Returns: OBB‹›
Private _mapToObbSpace
▸ _mapToObbSpace(meshPoint: Vector3, translation: Vector3, rotation: Quaternion): Vector3‹›
Defined in src/modules/kyub.core.boxel/src/GridInferring/grids/ObbGrid.ts:64
Maps the meshPoint to the local OBB space of this surface and stores the result in _tempMeshPointObbSpace, assuming, that the mesh of this.surface were rotated with rotation and translated by translation.
Parameters:
| Name | Type | Description |
|---|---|---|
meshPoint |
Vector3 | - |
translation |
Vector3 | - |
rotation |
Quaternion | - |
Returns: Vector3‹›
getGridCellOffset
▸ getGridCellOffset(meshPoint: Vector3, translation: Vector3, rotation: Quaternion, targetOffset: Vector3, targetRotation: Quaternion): void
Overrides Grid.getGridCellOffset
Defined in src/modules/kyub.core.boxel/src/GridInferring/grids/ObbGrid.ts:37
Parameters:
| Name | Type |
|---|---|
meshPoint |
Vector3 |
translation |
Vector3 |
rotation |
Quaternion |
targetOffset |
Vector3 |
targetRotation |
Quaternion |
Returns: void
Static isGridCell
▸ isGridCell(surface: MeshSurface): boolean
Overrides Grid.isGridCell
Defined in src/modules/kyub.core.boxel/src/GridInferring/grids/ObbGrid.ts:19
This grid can handle surfaces of all shapes, because it approximates them with their bounding box.
Parameters:
| Name | Type | Description |
|---|---|---|
surface |
MeshSurface | - |
Returns: boolean