Divide Framework 0.1
A free and open-source 3D Framework under heavy development
Loading...
Searching...
No Matches
Divide::IntersectionRecord Class Reference

#include <IntersectionRecord.h>

Public Member Functions

 IntersectionRecord () noexcept
 
 IntersectionRecord (vec3< F32 > hitPos, vec3< F32 > hitNormal, Ray ray, D64 distance) noexcept
 
 IntersectionRecord (BoundsComponent *hitObject) noexcept
 Creates a new intersection record indicating whether there was a hit or not and the object which was hit.
 
void reset () noexcept
 Reset all information contained by this record.
 
bool operator== (const IntersectionRecord &otherRecord) const noexcept
 check the object identities between the two intersection records. If they match in either order, we have a duplicate.
 
bool isEmpty () const noexcept
 

Public Attributes

vec3< F32_position
 This is the exact point in 3D space which has an intersection.
 
vec3< F32_normal
 This is the normal of the surface at the point of intersection.
 
Ray _ray
 This is the ray which caused the intersection.
 
BoundsComponent_intersectedObject1
 This is the object which is being intersected.
 
BoundsComponent_intersectedObject2
 This is the other object being intersected (may be null, as in the case of a ray-object intersection)
 
D64 _distance = 0.
 
bool _hasHit = false
 

Detailed Description

Definition at line 42 of file IntersectionRecord.h.

Constructor & Destructor Documentation

◆ IntersectionRecord() [1/3]

Divide::IntersectionRecord::IntersectionRecord ( )
noexcept

Definition at line 9 of file IntersectionRecord.cpp.

◆ IntersectionRecord() [2/3]

Divide::IntersectionRecord::IntersectionRecord ( vec3< F32 hitPos,
vec3< F32 hitNormal,
Ray  ray,
D64  distance 
)
noexcept

Definition at line 17 of file IntersectionRecord.cpp.

◆ IntersectionRecord() [3/3]

Divide::IntersectionRecord::IntersectionRecord ( BoundsComponent hitObject)
noexcept

Creates a new intersection record indicating whether there was a hit or not and the object which was hit.

Definition at line 32 of file IntersectionRecord.cpp.

Member Function Documentation

◆ isEmpty()

bool Divide::IntersectionRecord::isEmpty ( ) const
inlinenoexcept

Definition at line 76 of file IntersectionRecord.h.

◆ operator==()

bool Divide::IntersectionRecord::operator== ( const IntersectionRecord otherRecord) const
noexcept

check the object identities between the two intersection records. If they match in either order, we have a duplicate.

Definition at line 49 of file IntersectionRecord.cpp.

◆ reset()

void Divide::IntersectionRecord::reset ( )
noexcept

Reset all information contained by this record.

Definition at line 40 of file IntersectionRecord.cpp.

Member Data Documentation

◆ _distance

D64 Divide::IntersectionRecord::_distance = 0.

This is the distance from the ray to the intersection point. You'll usually want to use the nearest collision point if you get multiple intersections.

Definition at line 69 of file IntersectionRecord.h.

◆ _hasHit

bool Divide::IntersectionRecord::_hasHit = false

Definition at line 71 of file IntersectionRecord.h.

◆ _intersectedObject1

BoundsComponent* Divide::IntersectionRecord::_intersectedObject1

This is the object which is being intersected.

Definition at line 63 of file IntersectionRecord.h.

◆ _intersectedObject2

BoundsComponent* Divide::IntersectionRecord::_intersectedObject2

This is the other object being intersected (may be null, as in the case of a ray-object intersection)

Definition at line 65 of file IntersectionRecord.h.

◆ _normal

vec3<F32> Divide::IntersectionRecord::_normal

This is the normal of the surface at the point of intersection.

Definition at line 59 of file IntersectionRecord.h.

◆ _position

vec3<F32> Divide::IntersectionRecord::_position

This is the exact point in 3D space which has an intersection.

Definition at line 57 of file IntersectionRecord.h.

◆ _ray

Ray Divide::IntersectionRecord::_ray

This is the ray which caused the intersection.

Definition at line 61 of file IntersectionRecord.h.


The documentation for this class was generated from the following files: