Space Engineers
|
This class is responsible for calculating damage from explosions It works by recursively raycasting from the point it needs to calculate to the explosion center. It does two types of raycast, 3D DDA raycasts for traversing grids (ships, stations) and Havok raycasts for traversing space between grids. For each block, it builds a stack of blocks that are between it and the explosion center and then calculates the damage for all blocks in this stack. It early exits if it encounters a block that was already calculated. More...
Classes | |
struct | MyRaycastDamageInfo |
Public Member Functions | |
MyGridExplosion () | |
void | Init (BoundingSphereD explosion, float explosionDamage) |
void | ComputeDamagedBlocks () |
Computes damage for all blocks assigned in constructor More... | |
MyRaycastDamageInfo | ComputeDamageForEntity (Vector3D worldPosition) |
Used to calculate damage for entities that are not grids Can be called even if ComputeDamagedBlocks was not called before, but it doesn't do any caching More... | |
Public Attributes | |
bool | GridWasHit |
readonly HashSet< MyCubeGrid > | AffectedCubeGrids = new HashSet<MyCubeGrid>() |
readonly HashSet< MySlimBlock > | AffectedCubeBlocks = new HashSet<MySlimBlock>() |
Properties | |
Dictionary< MySlimBlock, float > | DamagedBlocks [get] |
Dictionary< MySlimBlock, MyRaycastDamageInfo > | DamageRemaining [get] |
float | Damage [get] |
BoundingSphereD | Sphere [get] |
This class is responsible for calculating damage from explosions It works by recursively raycasting from the point it needs to calculate to the explosion center. It does two types of raycast, 3D DDA raycasts for traversing grids (ships, stations) and Havok raycasts for traversing space between grids. For each block, it builds a stack of blocks that are between it and the explosion center and then calculates the damage for all blocks in this stack. It early exits if it encounters a block that was already calculated.
Definition at line 24 of file MyGridExplosion.cs.
|
inline |
Definition at line 80 of file MyGridExplosion.cs.
|
inline |
Computes damage for all blocks assigned in constructor
Definition at line 100 of file MyGridExplosion.cs.
|
inline |
Used to calculate damage for entities that are not grids Can be called even if ComputeDamagedBlocks was not called before, but it doesn't do any caching
worldPosition | World position from where the cast starts (usually the entity position) |
Definition at line 145 of file MyGridExplosion.cs.
|
inline |
Definition at line 85 of file MyGridExplosion.cs.
readonly HashSet<MySlimBlock> Sandbox.Game.MyGridExplosion.AffectedCubeBlocks = new HashSet<MySlimBlock>() |
Definition at line 41 of file MyGridExplosion.cs.
readonly HashSet<MyCubeGrid> Sandbox.Game.MyGridExplosion.AffectedCubeGrids = new HashSet<MyCubeGrid>() |
Definition at line 40 of file MyGridExplosion.cs.
bool Sandbox.Game.MyGridExplosion.GridWasHit |
Definition at line 39 of file MyGridExplosion.cs.
|
get |
Definition at line 65 of file MyGridExplosion.cs.
|
get |
Definition at line 45 of file MyGridExplosion.cs.
|
get |
Definition at line 53 of file MyGridExplosion.cs.
|
get |
Definition at line 73 of file MyGridExplosion.cs.