text: ﻿#pragma once
  
  #include "Vector3.h"
  #include "Vector2.h"
  #include "../Core/Entity.h"
  
  /*
  The MIT License (MIT)
  Copyright 2021 Adam Reilly, Call to Action Software LLC
  
  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
  
  The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
  
  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  */
  
  namespace Cta
  {
  	/// <summary>
  	/// Data structure that contains information about an entity that a ray hit
  	/// </summary>
  //C# TO C++ CONVERTER NOTE: The following .NET attribute has no direct equivalent in C++:
  //ORIGINAL LINE: [System.Serializable] public struct RaycastHit
  	class RaycastHit
  	{
  	private:
  		Vector3 point;
  		Vector3 normal;
  		Vector3 barycentricCoordinate;
  		float distance = 0;
  		int triangleIndex = 0;
  		Vector2 textureCoord;
  
  		/// <summary>
  		/// true if something was hit
  		/// </summary>
  	public:
  		bool isHit = false;
  
  		/// <summary>
  		/// The entity that was hit. Entity.Null if not hit
  		/// </summary>
  		Entity hitObject;
  
  		/// <summary>
  		/// The impact point in world space 
  		/// </summary>
  		Vector3 getPoint() const;
  		void setPoint(Vector3 value);
  
  		/// <summary>
  		/// the normal of the surface that the ray hit
  		/// </summary>
  		Vector3 getNormal() const;
  		void setNormal(Vector3 value);
  
  		/// <summary>
  		/// The barycentric coordinate of the triangle the ray hit.
  		/// </summary>
  		Vector3 getBarycentricCoordinate() const;
  		void setBarycentricCoordinate(Vector3 value);
  
  		/// <summary>
  		/// The distance from the ray's origin to the impact point.
  		/// </summary>
  		float getDistance() const;
  		void setDistance(float value);
  
  		/// <summary>
  		/// The index of the triangle that was hit.
  		/// </summary>
  		int getTriangleIndex() const;
  
  		/// <summary>
  		/// The uv texture coordinate at the collision location.
  		/// </summary>
  		Vector2 getTextureCoord() const;
  	};
  }
  