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 float mFraction = 1.0f + FLT_EPSILON;
23};
24
27{
28public:
30
32};
33
#define JPH_NAMESPACE_END
Definition: Core.h:354
#define JPH_NAMESPACE_BEGIN
Definition: Core.h:348
#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:22
BodyID mBodyID
Body that was hit.
Definition: CastResult.h:21
Specialization of cast result against a shape.
Definition: CastResult.h:27
JPH_OVERRIDE_NEW_DELETE SubShapeID mSubShapeID2
Sub shape ID of shape that we collided against.
Definition: CastResult.h:31
A sub shape id contains a path to an element (usually a triangle or other primitive type) of a compou...
Definition: SubShapeID.h:23