17 lines
No EOL
540 B
HLSL
17 lines
No EOL
540 B
HLSL
#include "triangle.hlsl"
|
|
|
|
/*
|
|
contributors: Patricio Gonzalez Vivo
|
|
description: Returns the centroid of a triangle
|
|
use: <float3> centroid(<Triangle> tri)
|
|
license:
|
|
- Copyright (c) 2021 Patricio Gonzalez Vivo under Prosperity License - https://prosperitylicense.com/versions/3.0.0
|
|
- Copyright (c) 2021 Patricio Gonzalez Vivo under Patron License - https://lygia.xyz/license
|
|
*/
|
|
|
|
#ifndef FNC_TRIANGLE_CENTROID
|
|
#define FNC_TRIANGLE_CENTROID
|
|
|
|
float3 centroid(Triangle _tri) { return (_tri.a + _tri.b + _tri.c) * 0.3333333333333f; }
|
|
|
|
#endif |