SceneMan:CastNotMaterialRay

From Data Realms Wiki

Jump to: navigation, search

//////////////////////////////////////////////////////////////////////////////////////////

// Method: CastNotMaterialRay

//////////////////////////////////////////////////////////////////////////////////////////

// Description: Traces along a vector and gets the location of the first encountered

// pixel that is NOT of a specific material in the scene's terrain.

// Arguments: The starting position.

// The vector to trace along.

// The material ID to find something OTHER than.

// A reference to the vector screen will be filled out with the absolute

// location of the found terrain pixel of the above material.

// For every pixel checked along the line, how many to skip between them

// for optimization reasons. 0 = every pixel is checked.

// Whether to check for MO layer collisions as well, not just terrain.

// Return value: Whether the a pixel other than the material was found along the ray.

// If not, the fourth parameter will not have been altered (and may still not be 0!)


   bool CastNotMaterialRay(const Vector &start, const Vector &ray, unsigned char material, Vector &result, int skip = 0, bool checkMOs = false);


//////////////////////////////////////////////////////////////////////////////////////////

// Method: CastNotMaterialRay

//////////////////////////////////////////////////////////////////////////////////////////

// Description: Traces along a vector and returns how far along that ray there is an

// encounter with a pixel of OTHER than a specific material in the terrain.

// Arguments: The starting position.

// The vector to trace along.

// The material ID to find something OTHER than.

// For every pixel checked along the line, how many to skip between them

// for optimization reasons. 0 = every pixel is checked.

// Whether to check for MO layer collisions as well, not just terrain.

// Return value: How far along, in pixel units, the ray the pixel of any other material

// was encountered. If no pixel of the right material was found, < 0 is returned.


   float CastNotMaterialRay(const Vector &start, const Vector &ray, unsigned char material, int skip = 0, bool checkMOs = false);
Personal tools