Jolt Physics
A multi core friendly Game Physics Engine
Loading...
Searching...
No Matches
CastSphereVsTriangles.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
8
10
13{
14public:
22 CastSphereVsTriangles(const ShapeCast &inShapeCast, const ShapeCastSettings &inShapeCastSettings, Vec3Arg inScale, Mat44Arg inCenterOfMassTransform2, const SubShapeIDCreator &inSubShapeIDCreator1, CastShapeCollector &ioCollector);
23
29 void Cast(Vec3Arg inV0, Vec3Arg inV1, Vec3Arg inV2, uint8 inActiveEdges, const SubShapeID &inSubShapeID2);
30
31protected:
34 float mRadius;
40
41private:
42 void AddHit(bool inBackFacing, const SubShapeID &inSubShapeID2, float inFraction, Vec3Arg inContactPointA, Vec3Arg inContactPointB, Vec3Arg inContactNormal);
43 void AddHitWithActiveEdgeDetection(Vec3Arg inV0, Vec3Arg inV1, Vec3Arg inV2, bool inBackFacing, Vec3Arg inTriangleNormal, uint8 inActiveEdges, const SubShapeID &inSubShapeID2, float inFraction, Vec3Arg inContactPointA, Vec3Arg inContactPointB, Vec3Arg inContactNormal);
44 float RayCylinder(Vec3Arg inRayDirection, Vec3Arg inCylinderA, Vec3Arg inCylinderB, float inRadius) const;
45
46 float mScaleSign;
47};
48
std::uint8_t uint8
Definition Core.h:482
#define JPH_EXPORT
Definition Core.h:271
#define JPH_NAMESPACE_END
Definition Core.h:414
#define JPH_NAMESPACE_BEGIN
Definition Core.h:408
JPH_NAMESPACE_BEGIN JPH_INLINE float RayCylinder(Vec3Arg inRayOrigin, Vec3Arg inRayDirection, float inCylinderRadius)
Definition RayCylinder.h:17
Collision detection helper that casts a sphere vs one or more triangles.
Definition CastSphereVsTriangles.h:13
const Mat44 & mCenterOfMassTransform2
Definition CastSphereVsTriangles.h:36
SubShapeIDCreator mSubShapeIDCreator1
Definition CastSphereVsTriangles.h:38
Vec3 mDirection
Direction and length of movement of sphere.
Definition CastSphereVsTriangles.h:33
CastShapeCollector & mCollector
Definition CastSphereVsTriangles.h:39
Vec3 mStart
Starting location of the sphere.
Definition CastSphereVsTriangles.h:32
Vec3 mScale
Definition CastSphereVsTriangles.h:37
float mRadius
Scaled radius of sphere.
Definition CastSphereVsTriangles.h:34
const ShapeCastSettings & mShapeCastSettings
Definition CastSphereVsTriangles.h:35
Virtual interface that allows collecting multiple collision results.
Definition CollisionCollector.h:45
Holds a 4x4 matrix of floats, but supports also operations on the 3x3 upper left part of the matrix.
Definition Mat44.h:13
Settings to be passed with a shape cast.
Definition ShapeCast.h:92
Definition SubShapeID.h:108
A sub shape id contains a path to an element (usually a triangle or other primitive type) of a compou...
Definition SubShapeID.h:23
Definition Vec3.h:17
Definition ShapeCast.h:69