- Emil Persson @Humus
- Matt Pettineo @mynameismjp
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System; | |
| using Unity.Mathematics; | |
| using static Unity.Mathematics.math; | |
| // Christer_Ericson-Real-Time_Collision_Detection | |
| // p.164 | |
| public static bool ConeOnPlanePositiveSide(float3 planeNormal, float3 planePosition, float3 lightPos, float lightRange, float3 lightDir, float radius) | |
| { | |
| float vertexDistance = dot(lightPos - planePosition, planeNormal); | |
| float negatePlaneNormal = vertexDistance < 0.0f?-1.0f:1.0f; |