singe/thirdparty/JoltPhysics/Jolt/Shaders/ShaderPlane.h
2026-09-05 19:52:04 -05:00

18 lines
459 B
C

// Jolt Physics Library (https://github.com/jrouwe/JoltPhysics)
// SPDX-FileCopyrightText: 2025 Jorrit Rouwe
// SPDX-License-Identifier: MIT
JPH_Plane JPH_PlaneFromPointAndNormal(float3 inPoint, float3 inNormal)
{
return JPH_Plane(inNormal, -dot(inNormal, inPoint));
}
float3 JPH_PlaneGetNormal(JPH_Plane inPlane)
{
return inPlane.xyz;
}
float JPH_PlaneSignedDistance(JPH_Plane inPlane, float3 inPoint)
{
return dot(inPoint, inPlane.xyz) + inPlane.w;
}