Open 3D Engine AzFramework API Reference  24.09
O3DE is an open-source, fully-featured, high-fidelity, modular 3D engine for building games and simulations, available to every industry.
AzPhysics::SceneQueryHit Struct Reference

Structure that contains information of an individual hit related to a SceneQuery. More...

#include <PhysicsSceneQueries.h>

Public Member Functions

 AZ_TYPE_INFO (SceneQueryHit, "{7A7201B9-67B5-438B-B4EB-F3EEBB78C617}")
 
 operator bool () const
 
bool IsValid () const
 

Static Public Member Functions

static void Reflect (AZ::ReflectContext *context)
 

Public Attributes

 AZ_CLASS_ALLOCATOR_DECL
 
SceneQuery::ResultFlags m_resultFlags = SceneQuery::ResultFlags::Invalid
 
float m_distance = 0.0f
 
AzPhysics::SimulatedBodyHandle m_bodyHandle = AzPhysics::InvalidSimulatedBodyHandle
 
AZ::EntityId m_entityId
 
Physics::Shapem_shape = nullptr
 
Physics::MaterialId m_physicsMaterialId
 
AZ::Vector3 m_position = AZ::Vector3::CreateZero()
 
AZ::Vector3 m_normal = AZ::Vector3::CreateZero()
 

Detailed Description

Structure that contains information of an individual hit related to a SceneQuery.

Member Data Documentation

◆ m_bodyHandle

AzPhysics::SimulatedBodyHandle AzPhysics::SceneQueryHit::m_bodyHandle = AzPhysics::InvalidSimulatedBodyHandle

Handler to the simulated body that was hit. Valid if SceneQuery::ResultFlags::BodyHandle is set.

◆ m_distance

float AzPhysics::SceneQueryHit::m_distance = 0.0f

The distance along the cast at which the hit occurred as given by Dot(m_normal, startPoint) - Dot(m_normal, m_position). Valid if SceneQuery::ResultFlags::Distance is set.

◆ m_entityId

AZ::EntityId AzPhysics::SceneQueryHit::m_entityId

The Entity Id of the body that was hit. Valid if SceneQuery::ResultFlags::EntityId is set.

◆ m_normal

AZ::Vector3 AzPhysics::SceneQueryHit::m_normal = AZ::Vector3::CreateZero()

The normal of the surface hit. Valid if SceneQuery::ResultFlags::Normal is set.

◆ m_physicsMaterialId

Physics::MaterialId AzPhysics::SceneQueryHit::m_physicsMaterialId

The physics material id on the shape (or face) that was hit. Valid if SceneQuery::ResultFlags::Material is set.

◆ m_position

AZ::Vector3 AzPhysics::SceneQueryHit::m_position = AZ::Vector3::CreateZero()

The position of the hit in world space. Valid if SceneQuery::ResultFlags::Position is set.

◆ m_resultFlags

SceneQuery::ResultFlags AzPhysics::SceneQueryHit::m_resultFlags = SceneQuery::ResultFlags::Invalid

Flags used to determine what members are valid. If the flag is true, the member will have a valid value.

◆ m_shape

Physics::Shape* AzPhysics::SceneQueryHit::m_shape = nullptr

The shape on the body that was hit. Valid if SceneQuery::ResultFlags::Shape is set.


The documentation for this struct was generated from the following file: