本文整理汇总了C++中Interpolate函数的典型用法代码示例。如果您正苦于以下问题:C++ Interpolate函数的具体用法?C++ Interpolate怎么用?C++ Interpolate使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了Interpolate函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: PI4D_SetFraction
static void PI4D_SetFraction(GF_Node *node, GF_Route *route)
{
u32 i;
Fixed frac;
M_PositionInterpolator4D *_this = (M_PositionInterpolator4D *)node;
if (! _this->key.count) return;
if (_this->keyValue.count != _this->key.count) return;
// The given fraction is less than the specified range
if (_this->set_fraction < _this->key.vals[0]) {
_this->value_changed = _this->keyValue.vals[0];
} else if (_this->set_fraction >= _this->key.vals[_this->key.count-1]) {
_this->value_changed = _this->keyValue.vals[_this->keyValue.count-1];
} else {
for (i=1; i<_this->key.count; i++) {
// Find the key values the fraction lies between
if (_this->set_fraction < _this->key.vals[i-1]) continue;
if (_this->set_fraction >= _this->key.vals[i]) continue;
frac = GetInterpolateFraction(_this->key.vals[i-1], _this->key.vals[i], _this->set_fraction);
_this->value_changed.x = Interpolate(_this->keyValue.vals[i-1].x, _this->keyValue.vals[i].x, frac);
_this->value_changed.y = Interpolate(_this->keyValue.vals[i-1].y, _this->keyValue.vals[i].y, frac);
_this->value_changed.z = Interpolate(_this->keyValue.vals[i-1].z, _this->keyValue.vals[i].z, frac);
_this->value_changed.q = Interpolate(_this->keyValue.vals[i-1].q, _this->keyValue.vals[i].q, frac);
break;
}
}
gf_node_event_out(node, 3);//"value_changed"
}
示例2: Interpolate
///==========================================================================================================================================
/// Friend Functions
///==========================================================================================================================================
inline const AABB3D Interpolate(const AABB3D& start, const AABB3D& end, float fractionFromStartToEnd){
const Vec3 interpolatedMins = Interpolate(start.mins, end.mins, fractionFromStartToEnd);
const Vec3 interpolatedMaxs = Interpolate(start.maxs, end.maxs, fractionFromStartToEnd);
AABB3D interpolation(interpolatedMins, interpolatedMaxs);
return interpolation;
}
示例3: max
void CBulletTime::Update()
{
if (!(g_pGameCVars->bt_speed || g_pGameCVars->bt_ironsight) || gEnv->bMultiplayer)
return;
// normalized frametime
float frameTime = gEnv->pTimer->GetFrameTime();
float normFrameTime = frameTime;
float timeScale = gEnv->pTimer->GetTimeScale();
if (timeScale < 1.0f)
{
timeScale = max(0.0001f, timeScale);
normFrameTime = frameTime/timeScale;
}
if (m_active)
{
Interpolate(m_energy, 0.0f, g_pGameCVars->bt_energy_decay, normFrameTime);
// deactivate when we run out of energy
if (m_energy < 0.001f)
{
Activate(false);
}
}
else
{
Interpolate(m_energy, g_pGameCVars->bt_energy_max, g_pGameCVars->bt_energy_regen, normFrameTime);
}
Interpolate(m_timeScaleCurrent, m_timeScaleTarget, 2.0f, normFrameTime);
gEnv->pTimer->SetTimeScale(m_timeScaleCurrent);
}
示例4: PosInt_SetFraction
void PosInt_SetFraction(SFNode *node)
{
u32 i;
Float frac;
M_PositionInterpolator *_this = (M_PositionInterpolator *)node;
if (! _this->key.count) return;
if (_this->keyValue.count != _this->key.count) return;
// The given fraction is less than the specified range
if (_this->set_fraction < _this->key.vals[0]) {
_this->value_changed = _this->keyValue.vals[0];
} else if (_this->set_fraction >= _this->key.vals[_this->key.count-1]) {
_this->value_changed = _this->keyValue.vals[_this->keyValue.count-1];
} else {
for (i=1; i<_this->key.count; i++) {
// Find the key values the fraction lies between
if (_this->set_fraction < _this->key.vals[i-1]) continue;
if (_this->set_fraction >= _this->key.vals[i]) continue;
frac = GetInterpolateFraction(_this->key.vals[i-1], _this->key.vals[i], _this->set_fraction);
_this->value_changed.x = Interpolate(_this->keyValue.vals[i-1].x, _this->keyValue.vals[i].x, frac);
_this->value_changed.y = Interpolate(_this->keyValue.vals[i-1].y, _this->keyValue.vals[i].y, frac);
_this->value_changed.z = Interpolate(_this->keyValue.vals[i-1].z, _this->keyValue.vals[i].z, frac);
break;
}
}
Node_OnEventOutSTR(node, "value_changed");
}
示例5: sample_interpolation_main
/**
This function allows to get the prediction of an non IDR picture.
//8.4.2.2
@param DpbLuma Table of the reference decoded picture buffer.
@param DpbCb Table of the reference decoded picture buffer.
@param DpbCr Table of the reference decoded picture buffer.
@param Luma_l0 Table of current frame.
@param Luma_l1 Table of current frame.
@param Chroma_Cb_l0 Table of current frame.
@param Chroma_Cb_l1 Table of current frame.
@param Chroma_Cr_l0 Table of current frame.
@param Chroma_Cr_l1 Table of current frame.
@param mvL0 The motion vector are stocked for each 4x4 block of each macroblock.
@param mvL1 The motion vector are stocked for each 4x4 block of each macroblock.
@param ref_cache_l0 A cache table where the reference is stocked for each 4x4 block of each macroblock.
@param ref_cache_l1 A cache table where the reference is stocked for each 4x4 block of each macroblock.
@param x X-coordinate.
@param y Y-coordinate.
@param PicWidthInPix Width in pixel of the current frame.
@param PicHeightInPix Height in pixel of the current frame.
@prama RefPicListL0 List l0 of reference image.
@prama RefPicListL1 List l1 of reference image.
@param interpol Function pointer of 4x4 interpoaltion.
*/
void sample_interpolation_main(unsigned char *DpbLuma, unsigned char *DpbCb,unsigned char *DpbCr,
unsigned char *Luma_l0, unsigned char *Luma_l1 , unsigned char *Chroma_Cb_l0,
unsigned char *Chroma_Cb_l1, unsigned char *Chroma_Cr_l0 , unsigned char *Chroma_Cr_l1,
short mvL0[][2], short mvL1[][2], short *ref_cache_l0, short *ref_cache_l1, short x, short y,
const short PicWidthInPix, const short PicHeightInPix , const LIST_MMO *RefPicListL0,
const LIST_MMO * RefPicListL1, const interpol_4x4 *interpol)
{
int i;
for( i = 0; i < 16; i++){
short index8 = SCAN8(i);
const short Currentx = x + LOCX(i);
const short Currenty = y + LOCY(i);
if ( ref_cache_l0[index8] >= 0){
Interpolate(ref_cache_l0[index8], Currentx, Currenty, &mvL0[index8][0], 4, PicWidthInPix, PicHeightInPix, RefPicListL0,
&Luma_l0[i << 4], &Chroma_Cb_l0[i << 2], &Chroma_Cr_l0[i << 2], DpbLuma, DpbCb, DpbCr, interpol);
}
if ( ref_cache_l1[index8] >= 0){
Interpolate(ref_cache_l1[index8], Currentx, Currenty, &mvL1[index8][0], 4, PicWidthInPix, PicHeightInPix, RefPicListL1,
&Luma_l1[i << 4], &Chroma_Cb_l1[i << 2], &Chroma_Cr_l1[i << 2], DpbLuma, DpbCb, DpbCr, interpol);
}
}
}
示例6: Interpolate
inline const Vector4< primitiveType > Interpolate( const Vector4< primitiveType >& start, const Vector4< primitiveType >& end, primitiveType fractionFromStartToEnd )
{
primitiveType xInterpolated = Interpolate( start.x, end.x, fractionFromStartToEnd );
primitiveType yInterpolated = Interpolate( start.y, end.y, fractionFromStartToEnd );
primitiveType zInterpolated = Interpolate( start.z, end.z, fractionFromStartToEnd );
primitiveType wInterpolated = Interpolate( start.w, end.w, fractionFromStartToEnd );
return Vector4< primitiveType >( xInterpolated, yInterpolated, zInterpolated, wInterpolated );
}
示例7: Interpolate
inline Color Interpolate(Color val1, Color val2, double dDelta)
{
return Color(
Interpolate(val1.m_color[Color::red], val2.m_color[Color::red], dDelta),
Interpolate(val1.m_color[Color::green], val2.m_color[Color::green], dDelta),
Interpolate(val1.m_color[Color::blue], val2.m_color[Color::blue], dDelta),
Interpolate(val1.m_color[Color::alpha], val2.m_color[Color::alpha], dDelta));
}
示例8: Interpolate
inline RGBA Interpolate(const RGBA& start, const RGBA& end, float fractionComplete) {
RGBA interpRGBA;
interpRGBA.r() = Interpolate(start.r(), end.r(), fractionComplete);
interpRGBA.g() = Interpolate(start.g(), end.g(), fractionComplete);
interpRGBA.b() = Interpolate(start.b(), end.b(), fractionComplete);
interpRGBA.a() = Interpolate(start.a(), end.a(), fractionComplete);
return interpRGBA;
}
示例9: Interpolate
Vector3 Interpolate(const Vector3 &v1, const Vector3 &v2, float f)
{
Vector3 _v = v1 ;
_v.x = Interpolate(_v.x, v2.x, f) ;
_v.y = Interpolate(_v.y, v2.y, f) ;
_v.z = Interpolate(_v.z, v2.z, f) ;
return _v ;
}
示例10: Interpolate
void FFMODListener::UpdateCurrentInteriorSettings()
{
// Store the interpolation value, not the actual value
InteriorVolumeInterp = Interpolate( InteriorEndTime );
ExteriorVolumeInterp = Interpolate( ExteriorEndTime );
InteriorLPFInterp = Interpolate( InteriorLPFEndTime );
ExteriorLPFInterp = Interpolate( ExteriorLPFEndTime );
}
示例11: InterpolateRGBa
global func InterpolateRGBa(RGBa_1,RGBa_2,x1,x2,x3)
{
var r = Interpolate(GetRGBaValue(RGBa_1,1),GetRGBaValue (RGBa_2,1),x1,x2,x3);
var g = Interpolate(GetRGBaValue(RGBa_1,2),GetRGBaValue (RGBa_2,2),x1,x2,x3);
var b = Interpolate(GetRGBaValue(RGBa_1,3),GetRGBaValue (RGBa_2,3),x1,x2,x3);
var a = Interpolate(GetRGBaValue(RGBa_1,0),GetRGBaValue (RGBa_2,0),x1,x2,x3);
return(RGBa(r,g,b,a));
}
示例12: main
int main(void) {
int i = 24332;
float x = 432.321;
std::string str1("foo");
//Works
std::cout << Interpolate(R"(goo % goo % goo)", i, x) << std::endl;
// Does not work, even though I'm not actually doing anything with the string argument
std::cout << Interpolate(R"(goo %)", str1) << std::endl;
}
示例13: Interpolate
//----------------------------------------------------------------//
float USInterpolate::Interpolate ( u32 mode, float x0, float x1, float t, float w ) {
float v0 = Interpolate ( mode, x0, x1, t );
if ( w == 1.0f ) {
return v0;
}
float v1 = Interpolate ( kLinear, x0, x1, t );
return Interpolate ( kLinear, v1, v0, w );
}
示例14: InterpolatePoint
void PressureTable::LookupSelectedCoeff(double &RoM, double &T0, double &E0,
double &Gam0, double &a_Gam, double P,
double Zm, double Zvar, double C) {
InterpolatePoint(P, Zm, Zvar, C);
RoM = Interpolate(0);
T0 = Interpolate(1);
E0 = Interpolate(2);
Gam0 = Interpolate(3);
a_Gam = Interpolate(4);
}
示例15: FindNoise
double Noise::Generate(double x, double y)
{
double s, t, u, v;
s = FindNoise(floor(x), floor(y));
t = FindNoise(ceil(x), floor(y));
u = FindNoise(floor(x), ceil(y));//Get the surrounding pixels to calculate the transition.
v = FindNoise(ceil(x), ceil(y));
double y1 = Interpolate(s, t, x - floorf(x));//Interpolate between the values.
double y2 = Interpolate(u, v, x - floorf(x));//Here we use x-floorx, to get 1st dimension. Don't mind the x-floorx thingie, it's part of the cosine formula.
return Interpolate(y1, y2, y - floorf(y));//Here we use y-floory, to get the 2nd dimension.
}