private void UpdateCollisionData(MeshCollisionData data, float distance, CollisionResult result, MeshTriangle triangle) { if (!data.HasCollided || distance < data.CollisionDistance) { data.CollisionDistance = distance; data.CollisionResult = result; data.CollisionId = triangle.Id; data.Triangle = triangle; data.HasCollided = true; } }
public MeshCollisionResult(CollisionResult rayCollisionResult, byte triangleId = 0, MeshTriangle hit = null) { RayCollisionResult = rayCollisionResult; TriangleId = triangleId; Triangle = hit; }