Jolt Physics
A multi core friendly Game Physics Engine
Loading...
Searching...
No Matches
CastResult.h
Go to the documentation of this file.
1// Jolt Physics Library (https://github.com/jrouwe/JoltPhysics)
2// SPDX-FileCopyrightText: 2021 Jorrit Rouwe
3// SPDX-License-Identifier: MIT
4
5#pragma once
6
9
11
14{
15public:
17
19 inline float GetEarlyOutFraction() const { return mFraction; }
20
22 inline void Reset() { mBodyID = BodyID(); mFraction = 1.0f + FLT_EPSILON; }
23
25 float mFraction = 1.0f + FLT_EPSILON;
26};
27
30{
31public:
33
35};
36
#define JPH_NAMESPACE_END
Definition: Core.h:367
#define JPH_NAMESPACE_BEGIN
Definition: Core.h:361
#define JPH_OVERRIDE_NEW_DELETE
Macro to override the new and delete functions.
Definition: Memory.h:29
ID of a body. This is a way of reasoning about bodies in a multithreaded simulation while avoiding ra...
Definition: BodyID.h:13
Structure that holds a ray cast or other object cast hit.
Definition: CastResult.h:14
JPH_OVERRIDE_NEW_DELETE float GetEarlyOutFraction() const
Function required by the CollisionCollector. A smaller fraction is considered to be a 'better hit'....
Definition: CastResult.h:19
float mFraction
Hit fraction of the ray/object [0, 1], HitPoint = Start + mFraction * (End - Start)
Definition: CastResult.h:25
void Reset()
Reset this result so it can be reused for a new cast.
Definition: CastResult.h:22
BodyID mBodyID
Body that was hit.
Definition: CastResult.h:24
Specialization of cast result against a shape.
Definition: CastResult.h:30
JPH_OVERRIDE_NEW_DELETE SubShapeID mSubShapeID2
Sub shape ID of shape that we collided against.
Definition: CastResult.h:34
A sub shape id contains a path to an element (usually a triangle or other primitive type) of a compou...
Definition: SubShapeID.h:23