CodeBase - Closest object check

Return to the CodeBase listing

Category: Math / Physics

Version: 1.0

0
0

Information

Uploaded: 20th Mar 2004 18:38

Modified: 1st Jan 1970 01:00

Author:  Xander

Summary

Use this code to find the object in the game that is closest to another object

Full Description

This is a subroutine that can be used in a 3D game to find the object in the game that is closest to another object, namely the player object.<br /> Before going to the subroutine, define the following variables:<br /> - player - this is the number of the object that you are trying to find the closest object to<br /> - firstobj - this is the number of object that the search will begin with<br /> - lastobj - this is the number of the object that the search will end with<br /> <br /> The code uses the following variables:<br /> - distance#<br /> - maxdist#<br /> <br /> The code returns the following variables:<br /> - closest - the number of the object that is closest to the &quot; player &quot; object<br /> <br /> Sorry this is not in function format, I always use subroutines instead.<br /> If you have any questions or suggestions, please email me.

Comments

No comments yet.