| 1896 | } |
| 1897 | |
| 1898 | Vector2 ExtractVector2( const uint8_t* vertex, const std::pair<const granny_data_type_definition*, int32_t>& element ) |
| 1899 | { |
| 1900 | vertex += element.second; |
| 1901 | if( element.first->Type == GrannyReal16Member ) |
| 1902 | { |
| 1903 | return *reinterpret_cast<const Vector2_16*>( vertex ); |
| 1904 | } |
| 1905 | else |
| 1906 | { |
| 1907 | return *reinterpret_cast<const Vector2*>( vertex ); |
| 1908 | } |
| 1909 | } |
| 1910 | |
| 1911 | bool RayTriangleIntersection( float& dist, float& u, float& v, const Vector3& pos, const Vector3& dir, const uint8_t** vertices, const std::pair<const granny_data_type_definition*, int32_t>& position ) |
| 1912 | { |