Jump to content
  • Advertisement
Sign in to follow this  
Medo Mex

Spotlight Collision

This topic is 1900 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Before I add lights to my pixel shader, I first check for collision between the mesh bounding sphere and the light radius, I have done that with point lights.

 

However, I'm not sure how to do the same with spot light, I want to check if the spot light is affecting the mesh.

 

So basically, I want to get 2 values from the spot light (position and radius) so I can check for collision, here are the values that I already have:

spotLight.position

spotLight.direction

spotLight.range

mesh->CollisionTest(???, ???); // Need to specify the light sphere position and radius
Edited by Medo3337

Share this post


Link to post
Share on other sites
Advertisement

You could build a bounding frustum, look it up on the net. If you are using directX there should be a helper class for creating one and checking for collisions with it.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!