Jump to content

light level on player


Recommended Posts

Back in 1.5.2 when opengl was used I added this

In sceneObject.cc at the end I added

ColorF SceneObject::getLastColor(void)


return mLightingInfo.smAmbientLight.mColor;


In player.cc

ConsoleMethod( Player, getColor, const char*, 2, 2, "Return the current color level.")


char *buff = Con::getReturnBuffer(128);

ColorF color = object->getLastColor();

dSprintf(buff,128, "%f %f %f %f",color.red, color.green, color.blue, color.alpha);

return buff;


I could use this to get the intensity of light on my character so I could code if the bots could see me lurking in the night shadows.

Now using 3.8 things have changed and I would like to find where I could get the player current light intensity. Can anyone point me to where I could get this info now? I understand it has to do with rendering the color of a texture on the player but after much searching I am lost...

Any help ? This should be part of the engine if it is not already....

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...