About Store Forum Documentation Contact



Post Reply 
ConeLight visual bug
Author Message
Tottel Offline
Member

Post: #1
ConeLight visual bug
Hi there!

I have encountered a visual bug with a ConeLight that matches a socket position + orientation. See video.

Bug Video

The code is pretty simple. The player holds a flashlight object (inherited from Game.Animatable) in his hand. This object draws the LightCone. The update looks like this:

Code:
bool FlashLight::update()
{
   C OrientP* handSlot  = Players[0].skel.getSlot("HandR");
   Matrix lightMat = Matrix().setPosDir(handSlot.pos, handSlot.perp, handSlot.dir, handSlot.cross());

   skel.clear().updateMatrix(lightMat).updateVelocities();
  
   return true;
}

And the draw:

Code:
uint FlashLight::drawPrepare()
{
   if(m_Enabled)
   {
      C OrientP* lightSlot = skel.getSlot("LightSlot");
      
      LightCone light(0, 0, 0, Vec(1, 1, 1), 0.015f, 0.1f);
      light.pyramid = PyramidM(0.45f, 12, lightSlot.pos, lightSlot.dir);
      light.falloff = 1.0f;
      light.add();    
   }
      
   return super.drawPrepare();
}

The hand is moved in the player class.

Any idea why this is happening?
07-22-2019 09:41 AM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #2
RE: ConeLight visual bug
Thanks for reporting! I'll take a look at this in the next few days. And will try to fix it quick

This could be related to LightCone.toScreenRect however codes look alright at a first glance. So I'll have to test it manually.
07-23-2019 01:34 AM
Find all posts by this user Quote this message in a reply
Tottel Offline
Member

Post: #3
RE: ConeLight visual bug
Thanks Esenthel!
07-23-2019 09:33 AM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #4
RE: ConeLight visual bug
Hi,

I can't repro this problem, it works fine for me.
Would you mind submitting some sample EsenthelProject with the issue? (can be your original project or another small one)
You could send a link to me via email or private message.
07-26-2019 04:03 AM
Find all posts by this user Quote this message in a reply
Tottel Offline
Member

Post: #5
RE: ConeLight visual bug
Sure! I'll prepare something when I am home. Thank you!
07-26-2019 07:38 AM
Find all posts by this user Quote this message in a reply
Post Reply