CActorManager: Lighting functions

Programming Reality Factory and Genesis3D.
Post Reply
Jay
RF Dev Team
Posts: 1232
Joined: Fri Jul 08, 2005 1:56 pm
Location: Germany

CActorManager: Lighting functions

Post by Jay » Sat May 23, 2009 5:42 pm

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.
Everyone can see the difficult, but only the wise can see the simple.
-----

User avatar
paradoxnj
RF2 Dev Team
Posts: 1328
Joined: Wed Mar 01, 2006 7:37 pm
Location: Brick, NJ
Contact:

Re: CActorManager: Lighting functions

Post by paradoxnj » Tue May 26, 2009 3:06 pm

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.
Many Bothans died to bring you this signature....

Post Reply