Advertisement Jump to content
Sign in to follow this  
Medo Mex

Spotlight Collision

This topic is 1994 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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!