bool GetHitPosition( Terrain terrain, Vector3& position )

book_4_sparkGenerated
code_blocksInput

Description

The GetHitPosition method is a virtual method of the BaseBrushTool class within the Editor.TerrainEditor namespace. This method is used to determine the hit position on a given terrain. It is primarily used in terrain editing tools to identify where a brush tool interacts with the terrain surface.

Usage

To use the GetHitPosition method, you need to provide a Terrain object and a reference to a Vector3 variable. The method will attempt to calculate the hit position on the terrain and store the result in the provided Vector3 reference. The method returns a Boolean indicating whether the hit position was successfully determined.

Example usage:

Vector3 hitPosition;
Terrain terrain = GetTerrain(); // Assume this method retrieves the current terrain
bool success = myBrushTool.GetHitPosition(terrain, out hitPosition);
if (success)
{
    // Use hitPosition for further processing
}

Example

Vector3 hitPosition;
Terrain terrain = GetTerrain(); // Assume this method retrieves the current terrain
bool success = myBrushTool.GetHitPosition(terrain, out hitPosition);
if (success)
{
    // Use hitPosition for further processing
}