Esempio n. 1
0
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);
    
}
Esempio n. 2
0
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);
}
Esempio n. 3
0
ProxSensorObject::ProxSensorObject() : HelperObject() 
{
	pblock = NULL;
    IParamBlock* pb = CreateParameterBlock(descVer0, PB_PS_PB_LENGTH,
                                           CURRENT_VERSION);
    pb->SetValue(PB_PS_LENGTH, 0, 0.0f);
    pb->SetValue(PB_PS_WIDTH, 0, 0.0f);
    pb->SetValue(PB_PS_HEIGHT, 0, 0.0f);
    pb->SetValue(PB_PS_ENABLED, 0, TRUE);
    pb->SetValue(PB_PS_NUMOBJS, 0, 0);
    ReplaceReference( 0, pb);
    assert(pblock);
    previousMode = NULL;
    objects.SetCount(0);
    BuildObjectList(this);
}
Esempio n. 4
0
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;
}
Esempio n. 5
0
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);
    
}
Esempio n. 6
0
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

	}
Esempio n. 7
0
Cal3DObject::Cal3DObject()
    : HelperObject()
{
    scale = 1.0f;
    coreHelper = NULL;
    cal3d_cfg = _T("");
    if (cores == NULL)
        cores = new Cal3DCoreHelpers();
    pblock = NULL;
    IParamBlock *pb = CreateParameterBlock(descVer0, PB_CAL_LENGTH,
                                           CURRENT_VERSION);
    pb->SetValue(PB_CAL_SIZE, 0, 1.0f);
    pb->SetValue(PB_CAL_ANIM, 0, 0);
    pb->SetValue(PB_CAL_ACTION, 0, 1);
#if MAX_PRODUCT_VERSION_MAJOR > 8
    ReplaceReference(0, pb);
#else
    MakeRefByID(FOREVER, 0, pb);
#endif
    assert(pblock);
    previousMode = NULL;
}
Esempio n. 8
0
SwitchObject::SwitchObject()
    : HelperObject()
{
    pblock = NULL;
    IParamBlock *pb = CreateParameterBlock(descVer0, PB_S_LENGTH,
                                           CURRENT_VERSION);
    pb->SetValue(PB_S_SIZE, 0, 0.0f);
    pb->SetValue(PB_S_NUMOBJS, 0, 0);
    pb->SetValue(PB_S_DEFAULT, 0, -1);
    pb->SetValue(PB_S_ALLOW_NONE, 0, TRUE);
#if MAX_PRODUCT_VERSION_MAJOR > 8
    ReplaceReference(0, pb);
#else
    MakeRefByID(FOREVER, 0, pb);
#endif
    assert(pblock);
    previousMode = NULL;
    // triggerObject = NULL;
    objects.SetCount(0);
    BuildObjectList(this);

    needsScript = true;
}
Esempio n. 9
0
BackgroundObject::BackgroundObject() : HelperObject() 
{
    IParamBlock* pb = CreateParameterBlock(descVer0, PB_BG_LENGTH,
                                           CURRENT_VERSION);
    pb->SetValue(PB_SKY_NUM_COLORS, 0, 0);
    pb->SetValue(PB_SKY_COLOR1 , 0, Point3(0.0f, 0.0f, 1.0f));
    pb->SetValue(PB_SKY_COLOR2 , 0, Point3(1.0f, 0.0f, 0.0f));
    pb->SetValue(PB_SKY_COLOR3 , 0, Point3(0.0f, 1.0f, 0.0f));
    pb->SetValue(PB_SKY_COLOR2_ANGLE, 0, float(PI/4.0));
    pb->SetValue(PB_SKY_COLOR3_ANGLE, 0, float(PI/2.0));
    pb->SetValue(PB_GROUND_NUM_COLORS, 0, 0);
    pb->SetValue(PB_GROUND_COLOR1 , 0, Point3(0.7f, 0.4f, 0.3f));
    pb->SetValue(PB_GROUND_COLOR2 , 0, Point3(1.0f, 0.0f, 0.0f));
    pb->SetValue(PB_GROUND_COLOR3 , 0, Point3(0.0f, 1.0f, 0.0f));
    pb->SetValue(PB_GROUND_COLOR2_ANGLE, 0, float(PI/4.0));
    pb->SetValue(PB_GROUND_COLOR3_ANGLE, 0, float(PI/2.0));
    MakeRefByID(FOREVER, 0, pb);
    assert(pblock);
}
Esempio n. 10
0
NavInfoObject::NavInfoObject() : HelperObject() 
{
	pblock = NULL;
    IParamBlock* pb = CreateParameterBlock(descVer1, PB_NA_LENGTH,
                                           CURRENT_VERSION);
    pb->SetValue(PB_TYPE, 0, 0);
    pb->SetValue(PB_HEADLIGHT, 0, FALSE);
    pb->SetValue(PB_VIS_LIMIT, 0, 0.0f);
    pb->SetValue(PB_SPEED, 0, 1.0f);
    pb->SetValue(PB_COLLISION, 0, 0.25f);
    pb->SetValue(PB_TERRAIN, 0, 1.6f);
    pb->SetValue(PB_STEP, 0, 0.75f);
    ReplaceReference( 0, pb);
    assert(pblock);
    
}
Esempio n. 11
0
void BombObject::SetChaos(TimeValue t, float f)
	{
	pblock->SetValue(PB_CHAOS, t, f);		
	NotifyDependents(FOREVER, PART_OBJ, REFMSG_CHANGE);
	}
Esempio n. 12
0
	void SetAmbientClr(Color c, TimeValue t)		
		{ ambient = c; pblock->SetValue( PB_AMBIENT_CLR, t, c); }
Esempio n. 13
0
	void SetGlossinessY(float v, TimeValue t)		
		{ if( v<=ALPHA_MIN) v = ALPHA_MIN; glossinessY= v; pblock->SetValue( PB_GLOSSINESS_Y, t, v); }
Esempio n. 14
0
	void SetDiffuseClr(Color c, TimeValue t)		
		{ diffuse = c; pblock->SetValue( PB_DIFFUSE_CLR, t, c); }
Esempio n. 15
0
void ExtrudeMod::SetGenUVW(BOOL sw) {  
	if (sw==HasUVW()) return;
	pblock->SetValue(PB_MAPPING,0, sw);				
	UpdateUI();
	}
Esempio n. 16
0
void BombObject::SetSeed(TimeValue t,int m)
	{
	pblock->SetValue(PB_SEED, t, m);
	}
Esempio n. 17
0
	void SetSpecularClr(Color c, TimeValue t)
		{ specular = c; pblock->SetValue( PB_SPECULAR_CLR, t, c); }
Esempio n. 18
0
void BombObject::SetFalloffOn(TimeValue t,int onOff)
	{
	pblock->SetValue(PB_FALLOFFON, t, onOff);
	}
Esempio n. 19
0
void BombObject::SetMaxFrag(TimeValue t,int m)
	{
	pblock->SetValue(PB_MAXFRAG, t, m);
	}
Esempio n. 20
0
void BombObject::SetSpin(TimeValue t, float f)
	{
	pblock->SetValue(PB_SPIN, t, f);	
	}
Esempio n. 21
0
void BombObject::SetFalloff(TimeValue t, float f)
	{
	pblock->SetValue(PB_FALLOFF, t, f);
	}
Esempio n. 22
0
	void SetDiffuseLevel(float v, TimeValue t)		
			{ diffLevel = v; pblock->SetValue( PB_DIFFUSE_LEV, t, v); }
Esempio n. 23
0
void TriPatchObject::SetGenUVW(BOOL sw) {  
	if (sw==HasUVW()) return;
	pblock->SetValue(PB_TEXTURE,0, sw);				
	InvalidateUI();
	}
Esempio n. 24
0
void BombObject::SetGravity(TimeValue t, float f)
	{
	pblock->SetValue(PB_GRAVITY, t, f);		
	NotifyDependents(FOREVER, PART_OBJ, REFMSG_CHANGE);
	}
Esempio n. 25
0
void BombObject::SetStrength(TimeValue t,float f)
	{
	pblock->SetValue(PB_STRENGTH, t, f);		
	NotifyDependents(FOREVER, PART_OBJ, REFMSG_CHANGE);
	}
Esempio n. 26
0
	void SetSpecularLevel(float v, TimeValue t)		
		{ specLevel = v; pblock->SetValue( PB_SPECULAR_LEV, t, v); }
Esempio n. 27
0
void BombObject::SetDetonation(TimeValue t,TimeValue det)
	{
	pblock->SetValue(PB_DETONATION, t, det);		
	NotifyDependents(FOREVER, PART_OBJ, REFMSG_CHANGE);
	}
Esempio n. 28
0
		// This is the one default parameter
		// Quality is nominal, 0...1, 
		// 0 is one sample, high about .75, 1.0 shd be awesome
		void SetQuality( float q )
			{ pParamBlk->SetValue( PB_QUALITY, 0, q ); }