dao::world::Hit
struct
One shape that a ray hit, laid out exactly as the game stores it.
Declared in dao/World.h.
Enumerations
Kind
enum class Kind : std::int32_t
What kind of shape the ray hit.
| Value | |
|---|---|
Nothing = 0 |
a shape in neither kind of group, such as a creature’s body |
Ground = 1 |
the area’s ground, walkmesh or terrain |
Object = 2 |
a creature, placeable or other object; object is its id |
Functions
IsGround()
bool IsGround() const
Returns true if the ray hit the area’s ground.
Object()
std::optional<ObjectId> Object() const
Returns the object the shape belongs to.
This also works for a creature’s body, which the game classes as Nothing but still tags with the creature’s id.
Returns nullopt if the shape belongs to no object
Fields
| Field | Type | |
|---|---|---|
groups |
std::uint32_t = 0 |
the shape’s collision groups |
kind |
Kind = Kind::Nothing |
|
object |
ObjectId = kInvalidObject |
the shape’s object, or kInvalidObject |
padding0 |
std::uint32_t = 0 |
|
padding2c |
std::uint32_t = 0 |
|
position |
Vector |
where the ray hit the shape |
unknown1c |
std::uint32_t = 0 |
|
unknown20 |
float = 0 |
|
unknown28 |
std::uint32_t = 0 |
|
walkable |
bool = false |
True if the shape is not in groups::kNotWalkable. In explore mode, a click moves the party only to walkable ground. |