本文整理汇总了C++中IParamBlock类的典型用法代码示例。如果您正苦于以下问题:C++ IParamBlock类的具体用法?C++ IParamBlock怎么用?C++ IParamBlock使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了IParamBlock类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: HelperObject
BillboardObject::BillboardObject() : HelperObject()
{
pblock = NULL;
IParamBlock* pb = CreateParameterBlock(descVer0, PB_BB_LENGTH,
CURRENT_VERSION);
pb->SetValue(PB_BB_SCREEN_ALIGN, 0, FALSE);
ReplaceReference( 0, pb);
assert(pblock);
}
示例2: get_caps_aspect
// property accessor functions for a new property 'aspect'
Value*
get_caps_aspect(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)
{
// compute & return capsule aspect
IParamBlock *pb = ((Object*)obj)->GetParamBlock()->GetParamBlock();
float h, r;
pb->GetValue(CAPS_HEIGHT, t, h, valid);
pb->GetValue(CAPS_RADIUS, t, r, valid);
return Float::intern(r * 2.0f / h);
}
示例3: DeleteReference
void M3Mat::Reset()
{
// char s[25];
DeleteReference(101);
for(int i=0;i<100;i++)
{
DeleteReference(i);
mTex[i] = NULL;
// ReplaceReference(i,NewDefaultStdMat());
// sprintf(s,GetString(IDS_MTL_CNAME),i+1);
// mTex[i]->SetName(s);
}
ReplaceReference(100,NewDefaultStdMat());
mTex[100]->SetName(GetString(IDS_MTL_BASE));
ParamBlockDescID *descVer = new ParamBlockDescID[101];
for(int x=0;x<100;x++){
ParamBlockDescID add;
add.type=TYPE_FLOAT;
add.user=NULL;
add.animatable=TRUE;
add.id=x;
descVer[x] = add;
}
ParamBlockDescID add;
add.type=TYPE_INT;
add.user=NULL;
add.animatable=FALSE;
add.id=x;
descVer[x] = add; // x == 100 we guess?
IParamBlock *pblockMat = (IParamBlock*)CreateParameterBlock(descVer,101,1);
ReplaceReference(101,pblockMat);
//ReplaceReference(102,NULL);
delete [] descVer;
pblockMat->SetValue(100,0,0); // set param [100], the mystery param
}
示例4: HelperObject
FogObject::FogObject() : HelperObject()
{
pblock = NULL;
IParamBlock* pb = CreateParameterBlock(descVer0, PB_FOG_LENGTH,
CURRENT_VERSION);
pb->SetValue(PB_TYPE, 0, 0);
pb->SetValue(PB_COLOR, 0, Point3(1,1,1));
pb->SetValue(PB_VIS_RANGE, 0, 0.0f);
pb->SetValue(PB_FOG_SIZE, 1, 1.0f);
ReplaceReference( 0, pb);
assert(pblock);
}
示例5: HelperObject
TouchSensorObject::TouchSensorObject() : HelperObject()
{
IParamBlock* pb = CreateParameterBlock(descVer0, PB_TS_LENGTH,
CURRENT_VERSION);
pb->SetValue(PB_TS_SIZE, 0, 0.0f);
pb->SetValue(PB_TS_ENABLED, 0, TRUE);
pb->SetValue(PB_TS_NUMOBJS, 0, 0);
MakeRefByID(FOREVER, 0, pb);
assert(pblock);
previousMode = NULL;
triggerObject = NULL;
objects.SetCount(0);
BuildObjectList(this);
}
示例6: UpdateUI
void BombObject::UpdateUI(TimeValue t)
{
if (hParam && !waitPostLoad) {
if (this == DLGetWindowLongPtr<BombObject *>(hParam)) {
strengthSpin->SetValue(GetStrength(t),FALSE);
gravSpin->SetValue(GetGravity(t),FALSE);
chaosSpin->SetValue(GetChaos(t),FALSE);
falloffSpin->SetValue(GetFalloff(t),FALSE);
spinSpin->SetValue(GetSpin(t),FALSE);
if (pblock->KeyFrameAtTime(PB_STRENGTH,t))
strengthSpin->SetKeyBrackets(TRUE);
else strengthSpin->SetKeyBrackets(FALSE);
if (pblock->KeyFrameAtTime(PB_GRAVITY,t))
gravSpin->SetKeyBrackets(TRUE);
else gravSpin->SetKeyBrackets(FALSE);
if (pblock->KeyFrameAtTime(PB_CHAOS,t))
chaosSpin->SetKeyBrackets(TRUE);
else chaosSpin->SetKeyBrackets(FALSE);
if (pblock->KeyFrameAtTime(PB_SPIN,t))
spinSpin->SetKeyBrackets(TRUE);
else spinSpin->SetKeyBrackets(FALSE);
if (pblock->KeyFrameAtTime(PB_FALLOFF,t))
falloffSpin->SetKeyBrackets(TRUE);
else falloffSpin->SetKeyBrackets(FALSE);
}
}
}
示例7: EndEditParams
void ExtrudeMod::EndEditParams( IObjParam *ip, ULONG flags,Animatable *next)
{
this->ip = NULL;
editMod = NULL;
TimeValue t = ip->GetTime();
ClearAFlag(A_MOD_BEING_EDITED);
NotifyDependents(Interval(t,t), PART_ALL, REFMSG_END_EDIT);
NotifyDependents(Interval(t,t), PART_ALL, REFMSG_MOD_DISPLAY_OFF);
DestroyCPParamMap(pmapParam);
// Save these values in class variables so the next object created will inherit them.
pblock->GetValue(PB_AMOUNT,ip->GetTime(),dlgAmount,FOREVER);
pblock->GetValue(PB_SEGS,ip->GetTime(),dlgSegs,FOREVER);
if (dlgSegs<1) dlgSegs = 1;
pblock->GetValue(PB_CAPSTART,ip->GetTime(),dlgCapStart,FOREVER);
pblock->GetValue(PB_CAPEND,ip->GetTime(),dlgCapEnd,FOREVER);
pblock->GetValue(PB_CAPTYPE,ip->GetTime(),dlgCapType,FOREVER);
pblock->GetValue(PB_OUTPUT,ip->GetTime(),dlgOutput,FOREVER);
pblock->GetValue(PB_MAPPING,ip->GetTime(),dlgMapping,FOREVER);
pblock->GetValue(PB_GEN_MATIDS,ip->GetTime(),dlgGenMatIDs,FOREVER);
pblock->GetValue(PB_USE_SHAPEIDS,ip->GetTime(),dlgUseShapeIDs,FOREVER);
pblock->GetValue(PB_SMOOTH,ip->GetTime(),dlgSmooth,FOREVER);
}
示例8: GetValidity
Interval RelaxMod::GetValidity(TimeValue t) {
int i;
float f;
// Only have to worry about animated parameters.
Interval valid = FOREVER;
pblock->GetValue (PB_RELAX, t, f, valid);
pblock->GetValue (PB_ITER, t, i, valid);
return valid;
}
示例9: RescaleWorldUnits
void BombObject::RescaleWorldUnits(float f)
{
if (TestAFlag(A_WORK1))
return;
SetAFlag(A_WORK1);
WSMObject::RescaleWorldUnits(f);
pblock->RescaleParam(PB_STRENGTH,f*f);
pblock->RescaleParam(PB_GRAVITY,f);
}
示例10: GetValidity
Interval ExtrudeMod::GetValidity(TimeValue t)
{
float f;
int i;
Interval valid = FOREVER;
pblock->GetValue(PB_AMOUNT,t,f,valid);
pblock->GetValue(PB_SEGS,t,i,valid);
pblock->GetValue(PB_CAPSTART,t,i,valid);
pblock->GetValue(PB_CAPEND,t,i,valid);
pblock->GetValue(PB_CAPTYPE,t,i,valid);
return valid;
}
示例11: RenderEnd
int OptMod::RenderEnd(TimeValue t)
{
int views, render;
pblock->GetValue(PB_VIEWS,0,views,FOREVER);
#ifndef NO_OUTPUTRENDERER
pblock->GetValue(PB_RENDER,0,render,FOREVER);
#else
render = views;
#endif
ClearAFlag(A_RENDER);
if (views!=render) {
NotifyDependents(FOREVER,PART_ALL,REFMSG_CHANGE);
}
return 0;
}
示例12: LocalValidity
Interval FExtrudeMod::LocalValidity(TimeValue t)
{
// aszabo|feb.05.02 If we are being edited, return NEVER
// to forces a cache to be built after previous modifier.
if (TestAFlag(A_MOD_BEING_EDITED))
return NEVER;
Interval iv = FOREVER;
float v;
Point3 pt;
pblock->GetValue(PB_AMOUNT,t,v,iv);
pblock->GetValue(PB_SCALE,t,v,iv);
base->GetValue(t,&pt,iv,CTRL_ABSOLUTE);
return iv;
}
示例13: ModifyObject
void AFRMod::ModifyObject (TimeValue t, ModContext &mc, ObjectState *os, INode *node) {
Interval iv = FOREVER;
float f, p, b;
int backface;
Point3 pt1, pt2;
pblock->GetValue(PB_FALLOFF,t,f,iv);
pblock->GetValue(PB_PINCH,t,p,iv);
pblock->GetValue(PB_BUBBLE,t,b,iv);
pblock->GetValue(PB_BACKFACE,t,backface,iv);
p1->GetValue(t,&pt1,iv,CTRL_ABSOLUTE);
p2->GetValue(t,&pt2,iv,CTRL_ABSOLUTE);
if (f==0.0) {
os->obj->UpdateValidity(GEOM_CHAN_NUM,iv);
return;
}
Tab<Point3> normals;
if (backface) {
// Need to get vertex normals.
if (os->obj->IsSubClassOf(triObjectClassID)) {
TriObject *tobj = (TriObject*)os->obj;
AverageVertexNormals (tobj->GetMesh(), normals);
} else if (os->obj->IsSubClassOf (polyObjectClassID)) {
PolyObject *pobj = (PolyObject *) os->obj;
MNMesh &mesh = pobj->GetMesh();
normals.SetCount (mesh.numv);
Point3 *vn = normals.Addr(0);
for (int i=0; i<mesh.numv; i++) {
if (mesh.v[i].GetFlag (MN_DEAD)) vn[i]=Point3(0,0,0);
else vn[i] = mesh.GetVertexNormal (i);
}
#ifndef NO_PATCHES
} else if (os->obj->IsSubClassOf (patchObjectClassID)) {
PatchObject *pobj = (PatchObject *) os->obj;
normals.SetCount (pobj->NumPoints ());
Point3 *vn = normals.Addr(0);
for (int i=0; i<pobj->NumPoints(); i++) vn[i] = pobj->VertexNormal (i);
#endif
}
}
if (normals.Count()) {
AFRDeformer deformer(mc,f,p,b,pt1,pt2,&normals);
os->obj->Deform(&deformer, TRUE);
} else {
AFRDeformer deformer(mc,f,p,b,pt1,pt2);
os->obj->Deform(&deformer, TRUE);
}
os->obj->UpdateValidity(GEOM_CHAN_NUM,iv);
}
示例14: LocalValidity
Interval MatMod::LocalValidity(TimeValue t)
{
int i;
Interval valid = FOREVER;
pblock->GetValue(PB_MATID,t,i,valid);
return valid;
}
示例15: ModifyObject
void MatMod::ModifyObject(TimeValue t, ModContext &mc, ObjectState *os, INode *node)
{
Interval valid = FOREVER;
int id;
pblock->GetValue(PB_MATID,t,id,valid);
id--;
if (id<0) id = 0;
if (id>0xffff) id = 0xffff;
// For version 4 and later, we process patch meshes as they are and pass them on. Earlier
// versions converted to TriMeshes (done below). For adding other new types of objects, add
// them here!
#ifndef NO_PATCHES
if(version >= MATMOD_VER4 && os->obj->IsSubClassOf(patchObjectClassID)) {
PatchObject *patchOb = (PatchObject *)os->obj;
PatchMesh &pmesh = patchOb->GetPatchMesh(t);
BOOL useSel = pmesh.selLevel >= PO_PATCH;
for (int i=0; i<pmesh.getNumPatches(); i++) {
if (!useSel || pmesh.patchSel[i]) {
pmesh.setPatchMtlIndex(i,(MtlID)id);
}
}
pmesh.InvalidateGeomCache(); // Do this because there isn't a topo cache in PatchMesh
patchOb->UpdateValidity(TOPO_CHAN_NUM,valid);
}
else
#endif // NO_PATCHES
// Process PolyObjects
if(os->obj->IsSubClassOf(polyObjectClassID)) {
PolyObject *polyOb = (PolyObject *)os->obj;
MNMesh &mesh = polyOb->GetMesh();
BOOL useSel = mesh.selLevel == MNM_SL_FACE;
for (int i=0; i<mesh.numf; i++) {
if (!useSel || mesh.f[i].GetFlag(MN_SEL)) {
mesh.f[i].material = (MtlID)id;
}
}
polyOb->UpdateValidity(TOPO_CHAN_NUM,valid);
}
else // If it's a TriObject, process it
if(os->obj->IsSubClassOf(triObjectClassID)) {
TriObject *triOb = (TriObject *)os->obj;
DoMaterialSet(triOb, id);
triOb->UpdateValidity(TOPO_CHAN_NUM,valid);
}
else // Fallback position: If it can convert to a TriObject, do it!
if(os->obj->CanConvertToType(triObjectClassID)) {
TriObject *triOb = (TriObject *)os->obj->ConvertToType(t, triObjectClassID);
// Now stuff this into the pipeline!
os->obj = triOb;
DoMaterialSet(triOb, id);
triOb->UpdateValidity(TOPO_CHAN_NUM,valid);
}
else
return; // Do nothing if it can't convert to triObject
}