Game Development Community

ShapeBaseImageData : wrong light position

by Canon · in Torque Game Engine · 11/25/2003 (3:15 am) · 10 replies

Hi all,

I have to make headlights for vehicles.




I make a simple ShapeBaseImage with a light :

datablock ShapeBaseImageData(pharelight)
{
   shapeFile = "~/data/shapes/voitures/phare.dts";
   mountPoint = 3;
   emap = true;
   
   lightType = ConstantLight;
   lightColor = "0.3 0.3 0.0 0.3";
   lightRadius = 25.0;
   
};

and i mount these ShapeBaseImage in my "onadd" function

...
%obj.mountImage(pharelight,3);
...

My problem is that the 3D model (phare.dts) correctly mount on the 'mount3' mounpoint (front of the vehicle), but the light always center the vehicle. That makes me crasy :/

Help !

Christophe
www.frogames.com

#1
12/06/2003 (7:11 am)
No suggestion ?
#2
12/06/2003 (7:26 am)
Canon,

Your Mount Points could be pointing the wrong way, or could be located in the wrong position, etc. (On either shape)

What exactly do you mean by "the light always center the vehicle." ?
If your meaning the light goes to the center of the vehicle, then it sounds like you have your mount points on the vehicle named incorrectly (So it will default to the center)
#3
12/06/2003 (7:48 am)
James,

Yes, i meaning the light goes to the center of the vehicle. The probleme is that the ShapeBaseImage mount correctly, not the light :/
#4
12/06/2003 (7:55 am)
Canon,

Ah right i see :)

I have not really played about with mounting light's on a vehicle....

Sorry i cannot help :(
#5
12/06/2003 (8:00 am)
I hope someone has information about that problem. I want to know if a make a mistake or if it is a bug.

Thx James ;p
#6
12/06/2003 (9:30 am)
You'll have to dig through the code. I bet it might be a combination of both factors... :)
#7
12/08/2003 (8:20 am)
I'm not a Torque owner, so i asked Mathieu, the lead developer of MiniOne Racing, our current project, to take a look at the problem.
It was a little bug in the registerLights function in shapeimage.cc. The function return the position of the ShapeBase but not the position of the ShapeBaseImage.

If anybody is interested, i can tell Mathieu to post the code modification.

Christophe
#8
12/08/2003 (8:48 am)
Yes, please do!
#10
12/08/2003 (10:26 am)
Please don't post C++ source from the engine in public forums.