How is it possible for rotating lights attached to objects?
by Anton Bursch · in · 05/03/2006 (11:59 am) · 1 replies

How can I set this light which is attached to this player shape to face forward instead of up? I used attachtoobject to attach the light to the player shape. Any ideas?
I tried to change the rotation but it didn't seem to do anything.
%light = new volumeLight() {
dataBlock = "sgMountLight";
//rotation = "-0.357694 0.933839 9.9834e-009 180";
rotation = "0 0 1 0";
scale = "1 1 1";
dataBlock = "sgMountLight";
Enable = "1";
IconSize = "1";
ParticleColorAttenuation = "1";
Texture = "common/lighting/lightFalloffMono.png";
lpDistance = "0.35";
ShootDistance = "5";
Xextent = "0.6";
Yextent = "0.6";
SubdivideU = "4";
SubdivideV = "4";
FootColour = "1.000000 1.000000 1.000000 0.182000";
TailColour = "0.000000 0.000000 0.000000 0.000000";
};
%light.attachtoobject(%obj);This is simply code copied from the swinging light in the TLK demo. Of course that rotation of "0 0 1 0" isn't going to do what I want. That's just there to show where I tried to set rotation at.
The light will rotate with the hand during animations, but it always points up the arm. Any idea how to point it forward like if this was going to be for a flashlight ?
About the author
I design and direct games for Somatic Vision. We primarily make games for use with biofeedback, but our latest game, Tropical Heat, a jet ski racing game, is for regular gamers and is available on PC/Mac and will be available on ipad and iphone soon.
Torque Owner John Kabus (BobTheCBuilder)
There are two members of the light datablock that control the mount positioning and rotation.
From the Modeler's Guide:
You can use the MountPosition to offset the light in mount space and then the MountRotation is applied (the rotation uses the same scheme as object rotations in the mission editor (xamount, yamount, zamount, rotationangle)).
-John