C++ Question On-Off SpotLight

marcogavazzeni

Addon Developer
Addon Developer
Joined
Jan 5, 2009
Messages
219
Reaction score
0
Points
16
Location
Near Verona
Website
orbiteritalia.forumotion.com
In this formula the spot light is on:

docking_light = (SpotLight*)AddSpotLight(_V(0.0,-1.022404,12.6), _V(0,0,1), 150, 1e-3, 0, 1e-3, RAD*25, RAD*60, col_white, col_white, col_a);
docking_light->Activate(true);

How can i turn off automatically when the door is closed?:idk:

:hail::hail:
 

PRicci1974

New member
Joined
Oct 20, 2010
Messages
3
Reaction score
0
Points
0
You could do it like this in the clbkPostStep. The docking light is now tied into the door status... This is from the HST code:


if (array_status >= DOOR_CLOSING) {
double da = simdt * ARRAY_OPERATING_SPEED;
if (array_status == DOOR_CLOSING) {
if (array_proc > 0.0) array_proc = max (0.0, array_proc-da);
else array_status = DOOR_CLOSED;
docking_light->Activate(false);
} else {
if (array_proc < 1.0) array_proc = min (1.0, array_proc+da);
else array_status = DOOR_OPEN;
docking_light->Activate(true);
}
SetAnimation (anim_array, array_proc);
}
 

PRicci1974

New member
Joined
Oct 20, 2010
Messages
3
Reaction score
0
Points
0
You're welcome... I look forward to seeing what addon it is going for!
 
Top