Add cloth painting tools to Editor
This commit is contained in:
@@ -312,7 +312,7 @@ void Float3::FindBestAxisVectors(Float3& firstAxis, Float3& secondAxis) const
|
||||
template<>
|
||||
float Float3::TriangleArea(const Float3& v0, const Float3& v1, const Float3& v2)
|
||||
{
|
||||
return (v2 - v0 ^ v1 - v0).Length() * 0.5f;
|
||||
return ((v2 - v0) ^ (v1 - v0)).Length() * 0.5f;
|
||||
}
|
||||
|
||||
template<>
|
||||
@@ -626,7 +626,7 @@ void Double3::FindBestAxisVectors(Double3& firstAxis, Double3& secondAxis) const
|
||||
template<>
|
||||
double Double3::TriangleArea(const Double3& v0, const Double3& v1, const Double3& v2)
|
||||
{
|
||||
return (v2 - v0 ^ v1 - v0).Length() * 0.5;
|
||||
return ((v2 - v0) ^ (v1 - v0)).Length() * 0.5;
|
||||
}
|
||||
|
||||
template<>
|
||||
|
||||
@@ -115,6 +115,12 @@ inline Span<T> ToSpan(const T* ptr, int32 length)
|
||||
return Span<T>(ptr, length);
|
||||
}
|
||||
|
||||
template<typename T, typename U = T, typename AllocationType = HeapAllocation>
|
||||
inline Span<U> ToSpan(const Array<T, AllocationType>& data)
|
||||
{
|
||||
return Span<U>((U*)data.Get(), data.Count());
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
inline bool SpanContains(const Span<T> span, const T& value)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user