Skip to content

A fast 2D and 3D game engine — TypeScript SDK, C++/WebAssembly core, visual editor. Ship one project to web, desktop, WeChat MiniGames, playable ads, and native Android / iOS.

1.4 KB
Raw Blame
// Copyright (c) 2001-2004 NovodeX AG. All rights reserved.
// Copyright (c) 2004-2008 AGEIA Technologies, Inc. All rights reserved.
// SPDX-FileCopyrightText: Copyright (c) 2008-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
// SPDX-License-Identifier: Apache-2.0

#ifndef PX_CONVEX_MESH_EXT_H
#define PX_CONVEX_MESH_EXT_H

#include "PxPhysXConfig.h"
#include "common/PxPhysXCommonConfig.h"
#include "foundation/PxTransform.h"

#if !PX_DOXYGEN
namespace physx
{
#endif

	class PxConvexMeshGeometry;

	/**
	\brief Computes closest polygon of the convex hull geometry for a given impact point
	and impact direction. When doing sweeps against a scene, one might want to delay
	the rather expensive computation of the hit face index for convexes until it is clear
	the information is really needed and then use this method to get the corresponding
	face index.
	
	\param[in] convexGeom The convex mesh geometry.
	\param[in] geomPose Pose for the geometry object.
	\param[in] impactPos Impact position.
	\param[in] unitDir Normalized impact direction.

	\return Closest face index of the convex geometry.

	\see PxTransform PxConvexMeshGeometry
	*/
	PxU32 PxFindFaceIndex(const PxConvexMeshGeometry& convexGeom, 
								   const PxTransform& geomPose,
								   const PxVec3& impactPos, 
								   const PxVec3& unitDir);

#if !PX_DOXYGEN
} // namespace physx
#endif

#endif