Page 1 of 1

CActorManager: Lighting functions

Posted: Sat May 23, 2009 5:42 pm
by Jay
In CActorManager i found those three lighting functions:
// Actor lighting control, Oh Joy.
// changed QD 07/21/04
int SetActorDynamicLighting(const geActor *theActor, const GE_RGBA &FillColor,
const GE_RGBA &AmbientColor, geBoolean AmbientLightFromFloor);
// end change
// changed QD 12/15/05
int GetActorDynamicLighting(const geActor *theActor, GE_RGBA *FillColor,
GE_RGBA *AmbientColor, geBoolean *AmbientLightFromFloor);
// end change
int ResetActorDynamicLighting(const geActor *theActor);
Now my question is about number 2 (GetActorDynamicLighting). I understand that the actual values are written to the pointers i give to the function, but when the AmbientLightFromFloor value is set to true, does it return the Actors own ambient lighting as AmbientColor or the floor lighting value?

If it returns the actors own ambient color, how can i get the floors lighting for a specific actor? This would help greatly for stealth games in which the player can hide in the shadows.

Re: CActorManager: Lighting functions

Posted: Tue May 26, 2009 3:06 pm
by paradoxnj
It's using the function geActor_GetLightingOptions() from the engine. It returns the actor's lighting. The floor's lighting would come from geWorld/GBsp. My suggestion would be to use geWorld_GetLights() and enumerate through the lights until you find the closest one. Make sure the range is close to your location.