本文整理匯總了C++中Interval::InInterval方法的典型用法代碼示例。如果您正苦於以下問題:C++ Interval::InInterval方法的具體用法?C++ Interval::InInterval怎麽用?C++ Interval::InInterval使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Interval
的用法示例。
在下文中一共展示了Interval::InInterval方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。
示例1: Update
void Mask::Update(TimeValue t, Interval& valid) {
if (Param1)
{
pblock->SetValue( mask_map1_on, 0, mapOn[0]);
pblock->SetValue( mask_map2_on, 0, mapOn[1]);
pblock->SetValue( mask_invert, 0, invertMask);
Param1 = FALSE;
}
if (!ivalid.InInterval(t)) {
ivalid.SetInfinite();
pblock->GetValue( mask_map1_on, t, mapOn[0], ivalid);
pblock->GetValue( mask_map2_on, t, mapOn[1], ivalid);
pblock->GetValue( mask_invert, t, invertMask, ivalid);
NotifyDependents(FOREVER, PART_TEXMAP, REFMSG_DISPLAY_MATERIAL_CHANGE);
}
if (!mapValid.InInterval(t))
{
mapValid.SetInfinite();
for (int i=0; i<NSUBTEX; i++) {
if (subTex[i])
subTex[i]->Update(t,mapValid);
}
}
valid &= mapValid;
valid &= ivalid;
}
示例2: Update
// This method is called before rendering begins to allow the plug-in
// to evaluate anything prior to the render so it can store this information.
void Speckle::Update(TimeValue t, Interval& ivalid) {
if (!texValidity.InInterval(t)) {
texValidity.SetInfinite();
xyzGen->Update(t, texValidity);
// pblock->GetValue(PB_COL1, t, col[0], texValidity);
pblock->GetValue(speckle_color1, t, col[0], texValidity);
col[0].ClampMinMax();
// pblock->GetValue(PB_COL2, t, col[1], texValidity);
pblock->GetValue(speckle_color2, t, col[1], texValidity);
col[1].ClampMinMax();
// pblock->GetValue(PB_SIZE, t, size, texValidity);
pblock->GetValue(speckle_size, t, size, texValidity);
pblock->GetValue(speckle_mapon1, t, mapOn[0], texValidity);
pblock->GetValue(speckle_mapon2, t, mapOn[1], texValidity);
ClampFloat(size, MIN_SIZE, MAX_SIZE);
NotifyDependents(FOREVER, PART_TEXMAP, REFMSG_DISPLAY_MATERIAL_CHANGE);
}
if (!mapValid.InInterval(t))
{
mapValid.SetInfinite();
for (int i = 0; i < NUM_SUB_TEXMAPS; i++) {
if (subTex[i])
subTex[i]->Update(t, mapValid);
}
}
ivalid &= texValidity;
ivalid &= mapValid;
}
示例3: UpdateCache
void Noise::UpdateCache(TimeValue t)
{
//Intel's fix is to check the validity before entering the critical section, if it's valid, no need to update
if (cacheValid.InInterval(t))
return;
EnterCriticalSection(&csect);
if (!cacheValid.InInterval(t)) {
ComputeAvgValue();
cacheValid = ivalid;
}
LeaveCriticalSection(&csect);
}
示例4: Force
Point3 PBombField::Force(TimeValue t,const Point3 &pos, const Point3 &vel,int index)
{ float d,chaos,dv;
Point3 dlta,xb,yb,zb,center,expv;
int decaytype,symm;
Point3 zero=Zero;
fValid = FOREVER;
if (!tmValid.InInterval(t))
{ tmValid = FOREVER;
tm = node->GetObjectTM(t,&tmValid);
invtm = Inverse(tm);
}
xb=tm.GetRow(0);
yb=tm.GetRow(1);
zb=tm.GetRow(2);
center=tm.GetTrans();
fValid &= tmValid;
TimeValue t0,t2,lastsfor;
obj->pblock->GetValue(PB_STARTTIME,t,t0,fValid);
obj->pblock->GetValue(PB_LASTSFOR,t,lastsfor,fValid);
t2=t0+lastsfor;
dlta=Zero;
if ((t>=t0)&&(t<=t2))
{ float L=Length(dlta=pos-center);
obj->pblock->GetValue(PB_DECAY,t,d,fValid);
obj->pblock->GetValue(PB_DECAYTYPE,t,decaytype,fValid);
if ((decaytype==0)||(L<=d))
{ obj->pblock->GetValue(PB_DELTA_V,t,dv,fValid);
obj->pblock->GetValue(PB_CHAOS,t,chaos,fValid);
obj->pblock->GetValue(PB_SYMMETRY,t,symm,fValid);
Point3 r;
if (symm==SPHERE)
expv=(r=dlta/L);
else if (symm==PLANAR)
{ L=DotProd(dlta,zb);
expv=(L<0.0f?L=-L,-zb:zb);
}
else
{ Point3 E;
E=DotProd(dlta,xb)*xb+DotProd(dlta,yb)*yb;
L=Length(E);
expv=E/L;
}
dlta=(dv*expv)/(float)dtsq;
if (decaytype==1)
dlta*=(d-L)/d;
else if (decaytype==2)
dlta*=(1/(float)exp(L/d));
if ((!FloatEQ0(chaos))&&(lastsfor==0.0f))
{ float theta;
theta=HalfPI*chaos*RND01();
// Martell 4/14/01: Fix for order of ops bug.
float ztmp=RND11(); float ytmp=RND11(); float xtmp=RND11();
Point3 d=Point3(xtmp,ytmp,ztmp);
Point3 c=Normalize(dlta^d);
RotateOnePoint(&dlta.x,&zero.x,&c.x,theta);
}
} else dlta=Zero;
}
return dlta;
}
示例5: Update
// This method is called before rendering begins to allow the plug-in
// to evaluate anything prior to the render so it can store this information.
void Stucco::Update(TimeValue t, Interval& ivalid) {
if (!texValidity.InInterval(t)) {
texValidity.SetInfinite();
xyzGen->Update(t, texValidity);
// pblock->GetValue(PB_COL1, t, col[0], texValidity);
pblock->GetValue(stucco_color1, t, col[0], texValidity);
col[0].ClampMinMax();
// pblock->GetValue(PB_COL2, t, col[1], texValidity);
pblock->GetValue(stucco_color2, t, col[1], texValidity);
col[1].ClampMinMax();
// pblock->GetValue(PB_SIZE, t, size, texValidity);
pblock->GetValue(stucco_size, t, size, texValidity);
ClampFloat(size, MIN_SIZE, MAX_SIZE);
// pblock->GetValue(PB_THRESH, t, thresh, texValidity);
pblock->GetValue(stucco_threshold, t, thresh, texValidity);
ClampFloat(thresh, MIN_THRESH, MAX_THRESH);
// pblock->GetValue(PB_THICK, t, thick, texValidity);
pblock->GetValue(stucco_thickness, t, thick, texValidity);
pblock->GetValue(stucco_mapon1, t, mapOn[0], texValidity);
pblock->GetValue(stucco_mapon2, t, mapOn[1], texValidity);
ClampFloat(thick, MIN_THICK, MAX_THICK);
for (int i = 0; i < NUM_SUB_TEXMAPS; i++) {
if (subTex[i])
subTex[i]->Update(t, texValidity);
}
}
ivalid &= texValidity;
}
示例6: Update
// This method is called before rendering begins to allow the plug-in
// to evaluate anything prior to the render so it can store this information.
void Planet::Update(TimeValue t, Interval& ivalid) {
if (!texValidity.InInterval(t)) {
texValidity.SetInfinite();
xyzGen->Update(t, texValidity);
for (int i = 0; i < NUM_COLORS; i++) {
// pblock->GetValue(i+PB_COL1, t, col[i], texValidity);
pblock->GetValue(i+planet_color1, t, col[i], texValidity);
col[i].ClampMinMax();
}
// pblock->GetValue(PB_SIZE, t, size, texValidity);
pblock->GetValue(planet_size, t, size, texValidity);
ClampFloat(size, MIN_SIZE, MAX_SIZE);
// pblock->GetValue(PB_ISLAND, t, island, texValidity);
pblock->GetValue(planet_island, t, island, texValidity);
ClampFloat(island, MIN_ISLAND, MAX_ISLAND);
// pblock->GetValue(PB_PERCENT, t, percent, texValidity);
pblock->GetValue(planet_percent, t, percent, texValidity);
ClampFloat(percent, MIN_PERCENT, MAX_PERCENT);
land = percent/100.0f;
// pblock->GetValue(PB_SEED, t, seed, texValidity);
pblock->GetValue(planet_seed, t, seed, texValidity);
ClampInt(seed, (int) MIN_SEED, (int) MAX_SEED);
pblock->GetValue(planet_blend, t, blend, texValidity);
}
ivalid &= texValidity;
}
示例7: Update
// This method is called before rendering begins to allow the plug-in
// to evaluate anything prior to the render so it can store this information.
void Splat::Update(TimeValue t, Interval& ivalid) {
if (!texValidity.InInterval(t)) {
texValidity.SetInfinite();
xyzGen->Update(t, texValidity);
// pblock->GetValue(PB_COL1, t, col[0], texValidity);
pblock->GetValue(splat_color1, t, col[0], texValidity);
col[0].ClampMinMax();
// pblock->GetValue(PB_COL2, t, col[1], texValidity);
pblock->GetValue(splat_color2, t, col[1], texValidity);
col[1].ClampMinMax();
// pblock->GetValue(PB_SIZE, t, size, texValidity);
pblock->GetValue(splat_size, t, size, texValidity);
ClampFloat(size, MIN_SIZE, MAX_SIZE);
// pblock->GetValue(PB_THRESH, t, thresh, texValidity);
pblock->GetValue(splat_threshold, t, thresh, texValidity);
ClampFloat(thresh, MIN_THRESH, MAX_THRESH);
// pblock->GetValue(PB_ITER, t, iter, texValidity);
pblock->GetValue(splat_iteration, t, iter, texValidity);
pblock->GetValue(splat_mapon1, t, mapOn[0], texValidity);
pblock->GetValue(splat_mapon2, t, mapOn[1], texValidity);
ClampInt(iter, (int) MIN_ITER, (int) MAX_ITER);
for (int i = 0; i < NUM_SUB_TEXMAPS; i++) {
if (subTex[i])
subTex[i]->Update(t, texValidity);
}
}
ivalid &= texValidity;
}
示例8: Update
void OrenNayarBlinnShader::Update(TimeValue t, Interval &valid) {
Point3 p, p2;
if( inUpdate )
return;
inUpdate = TRUE;
if (!ivalid.InInterval(t)) {
ivalid.SetInfinite();
// pblock->GetValue( onb_ambient, t, p, ivalid );
// ambient = LimitColor(Color(p.x,p.y,p.z));
pblock->GetValue( onb_diffuse, t, p, ivalid );
diffuse= LimitColor(Color(p.x,p.y,p.z));
pblock->GetValue( onb_ambient, t, p2, ivalid );
if( lockAD && (p!=p2)){
pblock->SetValue( onb_ambient, t, diffuse);
ambient = diffuse;
} else {
pblock->GetValue( onb_ambient, t, p, ivalid );
ambient = Bound(Color(p.x,p.y,p.z));
}
pblock->GetValue( onb_specular, t, p2, ivalid );
if( lockDS && (p!=p2)){
pblock->SetValue( onb_specular, t, diffuse);
specular = diffuse;
} else {
pblock->GetValue( onb_specular, t, p, ivalid );
specular = Bound(Color(p.x,p.y,p.z));
}
// pblock->GetValue( onb_specular, t, p, ivalid );
// specular = LimitColor(Color(p.x,p.y,p.z));
pblock->GetValue( onb_glossiness, t, glossiness, ivalid );
LIMIT0_1(glossiness);
pblock->GetValue( onb_specular_level, t, specularLevel, ivalid );
LIMITMINMAX(specularLevel,0.0f,9.99f);
pblock->GetValue( onb_soften, t, softThresh, ivalid);
LIMIT0_1(softThresh);
pblock->GetValue( onb_self_illum_amnt, t, selfIllum, ivalid );
LIMIT0_1(selfIllum);
pblock->GetValue( onb_self_illum_color, t, p, ivalid );
selfIllumClr = LimitColor(Color(p.x,p.y,p.z));
pblock->GetValue( onb_diffuse_level, t, diffLevel, ivalid );
LIMITMINMAX(diffLevel,0.0f, 4.00f);
pblock->GetValue( onb_roughness, t, diffRough, ivalid );
LIMIT0_1(diffRough);
// also get the non-animatables in case changed from scripter or other pblock accessors
pblock->GetValue(onb_ds_lock, t, lockDS, ivalid);
pblock->GetValue(onb_ad_lock, t, lockAD, ivalid);
pblock->GetValue(onb_ad_texlock, t, lockADTex, ivalid);
pblock->GetValue(onb_use_self_illum_color, t, selfIllumClrOn, ivalid);
curTime = t;
}
valid &= ivalid;
inUpdate = FALSE;
}
示例9: GetValue
void OrientConstRotation::GetValue(TimeValue t, void *val, Interval &valid, GetSetMethod method)
{
if (firstTimeFlag) {
Point3 trans, scaleP;
Quat quat;
Matrix3 tempMat(1);
// CAL-9/26/2002: in absolute mode the value could be un-initialized (random value).
if (method == CTRL_RELATIVE) tempMat = *(Matrix3*)val;
DecomposeMatrix(tempMat, trans, quat, scaleP);
baseRotQuatWorld = baseRotQuatLocal * quat;
baseRotQuatWorld.Normalize();
firstTimeFlag = 0;
}
if (!ivalid.InInterval(t)) {
DbgAssert(val != NULL);
Update(t);
}
valid &= ivalid;
if (method==CTRL_RELATIVE) {
Interval iv;
if (IsLocal()){ // From Update, I'm getting target_local_TM in curRot
Matrix3 *mat = (Matrix3*)val; // this is source_Parent_TM
Quat q = curRot; // this is target_local_TM
PreRotateMatrix(*mat, q); // source_world_TM = source_Parent_TM * target_local_TM
}
else { // i.e., WorldToWorld: from Update, I'm getting target_world_TM in curRot
int ct = pblock->Count(orientation_target_list);;
if (ct < 1){
Matrix3 *mat = (Matrix3*)val;
Quat q = curRot;
PreRotateMatrix(*mat, q);
}
else{
Matrix3 *mat = (Matrix3*)val; // this is source_Parent_TM
// CAL-06/24/02: preserve all components and replace with the new orientation.
AffineParts ap;
decomp_affine( *mat, &ap );
ap.q = curRot; // target world rotation
comp_affine( ap, *mat );
// CAL-06/24/02: this only preserve the translation component
// Point3 tr;
// tr = mat->GetTrans();
// mat->IdentityMatrix();
// Quat q = curRot; // this is target_world_TM
// q.MakeMatrix(*mat);
// mat->SetTrans(tr);
}
}
}
else {
*((Quat*)val) = curRot;
}
// RedrawListbox(GetCOREInterface()->GetTime());
}
示例10: GetActiveTexHandle
DWORD_PTR Speckle::GetActiveTexHandle(TimeValue t, TexHandleMaker& thmaker) {
if (texHandle) {
if (texHandleValid.InInterval(t))
return texHandle->GetHandle();
else DiscardTexHandle();
}
texHandle = thmaker.MakeHandle(GetVPDisplayDIB(t,thmaker,texHandleValid));
return texHandle->GetHandle();
}
示例11: Update
void StraussShader::Update(TimeValue t, Interval &valid) {
Point3 p;
if (!ivalid.InInterval(t)) {
ivalid.SetInfinite();
pblock->GetValue( st_diffuse, t, p, ivalid );
diffuse= Bound(Color(p.x,p.y,p.z));
pblock->GetValue( st_glossiness, t, glossiness, ivalid );
glossiness = Bound(glossiness );
pblock->GetValue( st_metalness, t, metalness, ivalid );
metalness = Bound(metalness );
}
valid &= ivalid;
}
示例12: Update
// This method is called before rendering begins to allow the plug-in
// to evaluate anything prior to the render so it can store this information.
void Smoke::Update(TimeValue t, Interval& ivalid) {
if (!texValidity.InInterval(t)) {
texValidity.SetInfinite();
xyzGen->Update(t, texValidity);
// pblock->GetValue(PB_COL1, t, col[0], texValidity);
pblock->GetValue(smoke_color1, t, col[0], texValidity);
col[0].ClampMinMax();
// pblock->GetValue(PB_COL2, t, col[1], texValidity);
pblock->GetValue(smoke_color2, t, col[1], texValidity);
col[1].ClampMinMax();
// pblock->GetValue(PB_SIZE, t, size, texValidity);
pblock->GetValue(smoke_size, t, size, texValidity);
ClampFloat(size, MIN_SIZE, MAX_SIZE);
// pblock->GetValue(PB_EXP, t, power, texValidity);
pblock->GetValue(smoke_exponent, t, power, texValidity);
ClampFloat(power, MIN_EXP, MAX_EXP);
// pblock->GetValue(PB_PHASE, t, phase, texValidity);
// pblock->GetValue(PB_ITER, t, iter, texValidity);
pblock->GetValue(smoke_phase, t, phase, texValidity);
pblock->GetValue(smoke_iteration, t, iter, texValidity);
ClampInt(iter, (int) MIN_ITER, (int) MAX_ITER);
pblock->GetValue(smoke_mapon1, t, mapOn[0], texValidity);
pblock->GetValue(smoke_mapon2, t, mapOn[1], texValidity);
NotifyDependents(FOREVER, PART_TEXMAP, REFMSG_DISPLAY_MATERIAL_CHANGE);
}
if (!mapValid.InInterval(t))
{
mapValid.SetInfinite();
for (int i = 0; i < NUM_SUB_TEXMAPS; i++) {
if (subTex[i])
subTex[i]->Update(t, mapValid);
}
}
ivalid &= texValidity;
ivalid &= mapValid;
}
示例13: Update
void Composite::Update(TimeValue t, Interval& valid)
{
if (!ivalid.InInterval(t)) {
ivalid.SetInfinite();
int n = pblock->Count(comptex_ons);
if (n!=mapOn.Count()) mapOn.SetCount(n);
for (int i=0; i<subTex.Count(); i++) {
pblock->GetValue(comptex_ons,0,mapOn[i],valid,i);
if (subTex[i])
subTex[i]->Update(t,ivalid);
}
}
valid &= ivalid;
}
示例14: Update
void WardShader::Update(TimeValue t, Interval &valid) {
Point3 p, p2;
if( inUpdate )
return;
inUpdate = TRUE;
if (!ivalid.InInterval(t)) {
ivalid.SetInfinite();
// pblock->GetValue( PB_AMBIENT_CLR, t, p, ivalid );
// ambient = LimitColor(Color(p.x,p.y,p.z));
pblock->GetValue( PB_DIFFUSE_CLR, t, p, ivalid );
diffuse= LimitColor(Color(p.x,p.y,p.z));
pblock->GetValue( PB_AMBIENT_CLR, t, p2, ivalid );
if( lockAD && (p!=p2)){
pblock->SetValue( PB_AMBIENT_CLR, t, diffuse);
ambient = diffuse;
} else {
pblock->GetValue( PB_AMBIENT_CLR, t, p, ivalid );
ambient = Bound(Color(p.x,p.y,p.z));
}
pblock->GetValue( PB_SPECULAR_CLR, t, p2, ivalid );
if( lockDS && (p!=p2)){
pblock->SetValue( PB_SPECULAR_CLR, t, diffuse);
specular = diffuse;
} else {
pblock->GetValue( PB_SPECULAR_CLR, t, p, ivalid );
specular = Bound(Color(p.x,p.y,p.z));
}
// pblock->GetValue( PB_SPECULAR_CLR, t, p, ivalid );
// specular = LimitColor(Color(p.x,p.y,p.z));
pblock->GetValue( PB_GLOSSINESS_X, t, glossinessX, ivalid );
LIMITMINMAX(glossinessX, 0.0001f, 1.0f );
pblock->GetValue( PB_GLOSSINESS_Y, t, glossinessY, ivalid );
LIMITMINMAX(glossinessY, 0.0001f, 1.0f );
pblock->GetValue( PB_SPECULAR_LEV, t, specLevel, ivalid );
LIMITMINMAX(specLevel,0.0f,4.00f);
pblock->GetValue( PB_DIFFUSE_LEV, t, diffLevel, ivalid );
LIMITMINMAX(diffLevel,0.0f,2.0f);
curTime = t;
}
valid &= ivalid;
inUpdate = FALSE;
}
示例15: Force
Point3 PinField::Force(TimeValue t,const Point3 &pos, const Point3 &vel,int index) //ok
{ fValid= FOREVER;
if (!tmValid.InInterval(t))
{ tmValid=FOREVER;
tm=node->GetObjectTM(t,&tmValid);
invtm=Inverse(tm);
}
fValid&=tmValid;
TimeValue t1,t2;
obj->pblock->GetValue(PB_ONTIME,t,t1,fValid);
obj->pblock->GetValue(PB_OFFTIME,t,t2,fValid);
Point3 OutPin;
if ((t>=t1)&&(t<=t2))
OutPin = Zero;
else
OutPin = Zero;
return OutPin*6.25e-03f;
}