initial commit, 4.5 stable
Some checks failed
🔗 GHA / 📊 Static checks (push) Has been cancelled
🔗 GHA / 🤖 Android (push) Has been cancelled
🔗 GHA / 🍏 iOS (push) Has been cancelled
🔗 GHA / 🐧 Linux (push) Has been cancelled
🔗 GHA / 🍎 macOS (push) Has been cancelled
🔗 GHA / 🏁 Windows (push) Has been cancelled
🔗 GHA / 🌐 Web (push) Has been cancelled
Some checks failed
🔗 GHA / 📊 Static checks (push) Has been cancelled
🔗 GHA / 🤖 Android (push) Has been cancelled
🔗 GHA / 🍏 iOS (push) Has been cancelled
🔗 GHA / 🐧 Linux (push) Has been cancelled
🔗 GHA / 🍎 macOS (push) Has been cancelled
🔗 GHA / 🏁 Windows (push) Has been cancelled
🔗 GHA / 🌐 Web (push) Has been cancelled
This commit is contained in:
45
thirdparty/embree/kernels/subdiv/hermite_curve.h
vendored
Normal file
45
thirdparty/embree/kernels/subdiv/hermite_curve.h
vendored
Normal file
@@ -0,0 +1,45 @@
|
||||
// Copyright 2009-2021 Intel Corporation
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "../common/default.h"
|
||||
#include "bezier_curve.h"
|
||||
|
||||
namespace embree
|
||||
{
|
||||
template<typename Vertex>
|
||||
struct HermiteCurveT : BezierCurveT<Vertex>
|
||||
{
|
||||
__forceinline HermiteCurveT() {}
|
||||
|
||||
__forceinline HermiteCurveT(const BezierCurveT<Vertex>& curve)
|
||||
: BezierCurveT<Vertex>(curve) {}
|
||||
|
||||
__forceinline HermiteCurveT(const Vertex& v0, const Vertex& t0, const Vertex& v1, const Vertex& t1)
|
||||
: BezierCurveT<Vertex>(v0,madd(1.0f/3.0f,t0,v0),nmadd(1.0f/3.0f,t1,v1),v1) {}
|
||||
|
||||
__forceinline HermiteCurveT<Vec3ff> xfm_pr(const LinearSpace3fa& space, const Vec3fa& p) const
|
||||
{
|
||||
const Vec3ff q0(xfmVector(space,this->v0-p), this->v0.w);
|
||||
const Vec3ff q1(xfmVector(space,this->v1-p), this->v1.w);
|
||||
const Vec3ff q2(xfmVector(space,this->v2-p), this->v2.w);
|
||||
const Vec3ff q3(xfmVector(space,this->v3-p), this->v3.w);
|
||||
return BezierCurveT<Vec3ff>(q0,q1,q2,q3);
|
||||
}
|
||||
};
|
||||
|
||||
template<typename Vertex>
|
||||
__forceinline void convert(const HermiteCurveT<Vertex>& icurve, BezierCurveT<Vertex>& ocurve)
|
||||
{
|
||||
ocurve = BezierCurveT<Vertex>(icurve.v0,icurve.v1,icurve.v2,icurve.v3);
|
||||
}
|
||||
|
||||
template<typename CurveGeometry>
|
||||
__forceinline HermiteCurveT<Vec3ff> enlargeRadiusToMinWidth(const RayQueryContext* context, const CurveGeometry* geom, const Vec3fa& ray_org, const HermiteCurveT<Vec3ff>& curve) {
|
||||
return HermiteCurveT<Vec3ff>(enlargeRadiusToMinWidth(context,geom,ray_org,BezierCurveT<Vec3ff>(curve)));
|
||||
}
|
||||
|
||||
typedef HermiteCurveT<Vec3fa> HermiteCurve3fa;
|
||||
}
|
||||
|
Reference in New Issue
Block a user