Game Development Community

Mounted headlights disappears

by arda · in Torque Game Engine · 10/13/2005 (12:39 am) · 1 replies

I mounted volumetic lights to vehicles, but volumetric lights, the white ones facing up, disappears randomly?
Do you have any idea?

Pics are taken at ~0.5 sec intervals. At 2nd and 3th pics, lights disappeared.

EDIT: It looks like the the position of attached light object is not updated, and remains as defined in the script.
If position is set to far away position ie position = "-0 0 0"; nothing is rendered.

It may be about cleint side copy vs. server side copy issue?

Thanks.

// volumetric headlights
	//-------------------------------------------
	%volLight = new volumeLight() {	
	  datablock = "volLightGDB";
	  position = "-527 903 4";
	  //rotation = "0 0 1 25.2024";
	  rotation = "0 0 1 0";
	  scale = "1 1 1";
	  Enable = "1";
	  Texture = "~/data/textures/hikari.png";
	  lpDistance = "5";
	  ShootDistance = "20";
	  Xextent = "8";
	  Yextent = "8";
	  SubdivideU = "32";
	  SubdivideV = "32";
	  FootColour = "1.000000 1.000000 1.000000 1.00000";
	  TailColour = "0.950000 0.950000 1.000000 0.000000";
	};
	%volLight.attachToObject(%player);
	MissionCleanup.add(%volLight);

img300.imageshack.us/img300/7786/otosim20051013093350260ij.jpgimg300.imageshack.us/img300/3426/otosim20051013093351419fb.jpgimg300.imageshack.us/img300/8981/otosim20051013093352658vv.jpg

#1
10/14/2005 (2:08 am)
Yep I solved the problem,
Updated object box to the attached object's position, then it worked like a charm

void volumeLight::processTick(const Move* m)
{
	// Process Parent.
	Parent::processTick(m);

	if(mAttached)
	{
		setTransform(mpAttachedObject->getTransform());

		mObjBox.min.set(-mXextent/2.0f, -mYextent/2.0f, 0.0f);
		mObjBox.max.set(mXextent/2.0f, mYextent/2.0f, mShootDistance);

		// Reset the World Box.
		resetWorldBox();
	}
...
}