Support Forum       G3D Web Page     
Public Member Functions | Public Attributes | Static Public Attributes | List of all members
G3D::Model::HitInfo Class Reference

Public Member Functions

 HitInfo ()
 
void clear ()
 
void set (const shared_ptr< Model > &model, const shared_ptr< Entity > &entity=nullptr, const shared_ptr< Material > &material=nullptr, const Vector3 &normal=Vector3::nan(), const Point3 &point=Point3::nan(), const String &partName="", const String &meshName="", int meshID=0, int primIndex=0, float u=0.0f, float v=0.0f)
 

Public Attributes

const shared_ptr< Entityentity
 May be null. More...
 
const shared_ptr< Materialmaterial
 May be null. More...
 
const int meshID
 For debugging. More...
 
const String meshName
 If the model contains multiple meshes (e.g., ArticulatedModel), this is an identifier for the underlying mesh or other surface in which primitiveIndex should be referenced. More...
 
const shared_ptr< Modelmodel
 
const Vector3 normal
 In world space. More...
 
const String partName
 
const Point3 point
 In world space. More...
 
const int primitiveIndex
 If the model has multiple primitives, this is the index of the one hit. More...
 
const float u
 Barycentric coords within the primitive hit if it is a triangle. More...
 
const float v
 Barycentric coords within the primitive hit if it is a triangle. More...
 

Static Public Attributes

static HitInfo ignore
 

Detailed Description

See also
Scene::intersect, Entity::intersect, ArticulatedModel::intersect, Tri::Intersector. All fields are const so as to require the use of the set method to set the value of the field while still keeping all fields public.

Constructor & Destructor Documentation

◆ HitInfo()

G3D::Model::HitInfo::HitInfo ( )

Member Function Documentation

◆ clear()

void G3D::Model::HitInfo::clear ( )

◆ set()

void G3D::Model::HitInfo::set ( const shared_ptr< Model > &  model,
const shared_ptr< Entity > &  entity = nullptr,
const shared_ptr< Material > &  material = nullptr,
const Vector3 normal = Vector3::nan(),
const Point3 point = Point3::nan(),
const String partName = "",
const String meshName = "",
int  meshID = 0,
int  primIndex = 0,
float  u = 0.0f,
float  v = 0.0f 
)

Member Data Documentation

◆ entity

const shared_ptr<Entity> G3D::Model::HitInfo::entity

May be null.

◆ ignore

HitInfo G3D::Model::HitInfo::ignore
static

◆ material

const shared_ptr<Material> G3D::Model::HitInfo::material

May be null.

◆ meshID

const int G3D::Model::HitInfo::meshID

For debugging.

◆ meshName

const String G3D::Model::HitInfo::meshName

If the model contains multiple meshes (e.g., ArticulatedModel), this is an identifier for the underlying mesh or other surface in which primitiveIndex should be referenced.

◆ model

const shared_ptr<Model> G3D::Model::HitInfo::model

◆ normal

const Vector3 G3D::Model::HitInfo::normal

In world space.

◆ partName

const String G3D::Model::HitInfo::partName

◆ point

const Point3 G3D::Model::HitInfo::point

In world space.

Point3::nan() if no object was hit.

◆ primitiveIndex

const int G3D::Model::HitInfo::primitiveIndex

If the model has multiple primitives, this is the index of the one hit.

◆ u

const float G3D::Model::HitInfo::u

Barycentric coords within the primitive hit if it is a triangle.

◆ v

const float G3D::Model::HitInfo::v

Barycentric coords within the primitive hit if it is a triangle.


documentation generated on Wed Nov 24 2021 08:01:58 using doxygen 1.8.15