// Copyright 2009-2020 Intel Corporation // SPDX-License-Identifier: Apache-2.0 #pragma once #include "../common/default.h" #include "bezier_curve.h" namespace embree { template struct HermiteCurveT : BezierCurveT { __forceinline HermiteCurveT() {} __forceinline HermiteCurveT(const BezierCurveT& curve) : BezierCurveT(curve) {} __forceinline HermiteCurveT(const Vertex& v0, const Vertex& t0, const Vertex& v1, const Vertex& t1) : BezierCurveT(v0,madd(1.0f/3.0f,t0,v0),nmadd(1.0f/3.0f,t1,v1),v1) {} __forceinline HermiteCurveT 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(q0,q1,q2,q3); } }; __forceinline HermiteCurveT enlargeRadiusToMinWidth(const IntersectContext* context, const CurveGeometry* geom, const Vec3fa& ray_org, const HermiteCurveT& curve) { return HermiteCurveT(enlargeRadiusToMinWidth(context,geom,ray_org,BezierCurveT(curve))); } typedef HermiteCurveT HermiteCurve3fa; }