Attached lights
by Howard Dortch · in · 02/20/2005 (8:41 am) · 5 replies
Is the fxLight no longer working? I tried to make one but no datablock showed up in the dialog selection.
I want to attach a light to my player, probably a dynamic spot light like a flashlight is there an attach to object function of some sort that would maintain orientation in the world like you would have with a weapon mount?
I want to attach a light to my player, probably a dynamic spot light like a flashlight is there an attach to object function of some sort that would maintain orientation in the world like you would have with a weapon mount?
#2
02/20/2005 (9:22 pm)
I looked at the lighting code in the engine and it looks like I could make a hardware light in there will that mess up anything in the light pack?
#3
I'm not following you, do you mean register your own LightInfo object for the player, manually attach a Lighting Pack light object to the player, or create your own light object?
You might want to just consider updating attachObject to only retrieve the object's ghost index and send it to the client (see 'sgParticleEmitterGhostIndex' in 'sgUniversalStaticLight.cc' for an example of how to do this), then the light's transform can be set with:
You still won't have a dynamic spotlight, but you could use volume light objects to create the flash light's beam.
Let me know if this helps!
-John
02/21/2005 (6:55 am)
Hi Howard,I'm not following you, do you mean register your own LightInfo object for the player, manually attach a Lighting Pack light object to the player, or create your own light object?
You might want to just consider updating attachObject to only retrieve the object's ghost index and send it to the client (see 'sgParticleEmitterGhostIndex' in 'sgUniversalStaticLight.cc' for an example of how to do this), then the light's transform can be set with:
attachedobject->getImageTransform(<mount point>, <matrix to store the transform>);
You still won't have a dynamic spotlight, but you could use volume light objects to create the flash light's beam.
Let me know if this helps!
-John
#4
I've tried mounting a small flashlight to the player's Mount1 node and then attaching a light (via attachToObject) to the flashlight. No luck as of yet.
Any ideas? I'm at my wits end with this. All I'm trying to do is mount a simple spotlight to the player to create a rudimentary flashlight. Quick and dirty but functional.
thanks in advance,
k
03/28/2005 (10:02 am)
How about attaching a sgUniversalStaticLight spotlight directly to a player?I've tried mounting a small flashlight to the player's Mount1 node and then attaching a light (via attachToObject) to the flashlight. No luck as of yet.
Any ideas? I'm at my wits end with this. All I'm trying to do is mount a simple spotlight to the player to create a rudimentary flashlight. Quick and dirty but functional.
thanks in advance,
k
#5
Did you try altering attachObject (see my previous post) to operate on the client side? In its current state attachObject (which is inherited from fxLight in stock TGE) does not work.
-John
03/28/2005 (8:58 pm)
Hi Katrina,Did you try altering attachObject (see my previous post) to operate on the client side? In its current state attachObject (which is inherited from fxLight in stock TGE) does not work.
-John
Torque Owner John Kabus (BobTheCBuilder)
You need to create a datablock in script for the light (derived from fxLightData). If you want to use the Lighting Pack's Light Editor create a Lighting Pack light and set it to dynamic - this produces the same results.
Right now all spotlights are static and won't produce a flashlight like result, but you can add a light to a weapon's image by adding this code to the image's datablock:
-John