• Manual
  • Scripting API
  • Asset Store
  • TycoonTerrain.Core
  • TycoonTileRaycastHit
Search Results for

    Show / Hide Table of Contents
    • TycoonTerrain.Components
      • TycoonTileRendererBase
    • TycoonTerrain.Core
      • BoundsContainer
      • BoundsReservationRegister
      • CallbackHandle
      • CallbacksRegister
      • CardinalDirection
      • ChunkSet
      • ConstructableDefinition
      • CornerIndex
      • Extensions
      • IChunkListener
      • IntBound
      • LandTile
      • OnBoundsChangeCallback
      • PlacementValidResult
      • SurfaceOverlayMesh
      • TerrainGrid
      • TerrainModifiedEvent
      • TerrainSelection
      • TerrainTypeCollectionAsset
      • TerrainTypeDefinition
      • TerrainTypeTable
      • TileCorner
      • TileHandle
      • TilePosition
      • TileType
      • TycoonTileMap
      • TycoonTileRaycastHit
    • TycoonTerrain.Core.Generation
      • TerrainGenerationJob
    • TycoonTerrain.Core.Rendering
      • ChunkMesh
      • IMesh
      • NativeMeshData
      • RenderTerrainCliffChunkJob
      • RenderTerrainSurfaceChunkJob
      • RenderWaterChunkJob
      • RenderWaterCliffChunkJob
      • SubMeshTriangle
    • TycoonTerrain.Core.TerrainOperations
      • ClearWaterBodyOperation
      • CopyHeightMapOperation
      • CreateWaterBodyFloodOperation
      • DecreaseHeightCliffOperation
      • DecreaseHeightCorner
      • DecreaseHeightSmoothConnectedOperation
      • GetTilesInWaterBody
      • IncreaseHeightCliffOperation
      • IncreaseHeightCorner
      • IncreaseHeightSmoothConnectedOperation
      • ITerrainOperation
      • MaxHeightSmooth
      • OperationContext
      • OperationResult
      • SetHeightOperation
      • SetTileTypeInBoundsOperation
      • SetWaterLevelOperation
    • TycoonTerrain.Previewers
      • BuildingToolPreviewer
      • PreviewMeshes
      • TerrainPainterPreviewer
      • TerrainSelectionPreviewer
      • ToolPreviewerBase<T>
    • TycoonTerrain.Tools
      • BuildingTool
      • PainterTool
      • SceneryTool
      • SelectionToolBase
      • SnappingMode
      • TerraformingTool
      • ToolBase
      • WaterTool

    Class TycoonTileRaycastHit

    Represents a raycast hit on a TycoonTile terrain.

    Inheritance
    Object
    TycoonTileRaycastHit
    Namespace: TycoonTerrain.Core
    Assembly: TycoonTerrainAssembly.dll
    Syntax
    public class TycoonTileRaycastHit

    Properties

    IsCliff

    Indicates whether the raycast hit was hit on a tile cliff.

    Declaration
    public bool IsCliff { get; }
    Property Value
    Type Description
    Boolean

    true if the hit is a tile cliff, false if the hit is on a tile surface.

    IsSurface

    Indicates whether the raycast hit was hit on a tile surface.

    Declaration
    public bool IsSurface { get; }
    Property Value
    Type Description
    Boolean

    true if the hit is on a tile surface, false if the hit is a tile cliff.

    Normal

    Returns the normal at the hit position.

    Declaration
    public float3 Normal { get; }
    Property Value
    Type Description
    Unity.Mathematics.float3

    The hit normal.

    SurfacePosition

    Returns the surface position of the hit in world space.

    Declaration
    public float3 SurfacePosition { get; }
    Property Value
    Type Description
    Unity.Mathematics.float3

    The surface position at the hit position.

    Terrain

    The tile map instance that was hit by the raycast.

    Declaration
    public TycoonTileMap Terrain { get; }
    Property Value
    Type Description
    TycoonTileMap

    The tile map instance that was hit by the raycast.

    Tile

    The tile handle of the tile that was hit by the raycast.

    Declaration
    public TileHandle Tile { get; }
    Property Value
    Type Description
    TileHandle

    The tile handle of the tile that was hit by the raycast.

    TileLocalPosition

    The local tile position, where x (west to east) and y (south to north) are in the range [0,1].

    Declaration
    public float2 TileLocalPosition { get; }
    Property Value
    Type Description
    Unity.Mathematics.float2

    The local tile position.

    TilePosition

    The tile position of the tile that was hit.

    Declaration
    public int2 TilePosition { get; }
    Property Value
    Type Description
    Unity.Mathematics.int2

    The tile position of the tile that was hit.

    WorldPosition

    The world position of the hit.

    Declaration
    public float3 WorldPosition { get; }
    Property Value
    Type Description
    Unity.Mathematics.float3

    The world position of the hit.

    Methods

    FromCenter(float3)

    Returns the position of the ray hit tile center with an optional offset.

    Declaration
    public float3 FromCenter(float3 offset = default(float3))
    Parameters
    Type Name Description
    Unity.Mathematics.float3 offset

    The offset from the center.

    Returns
    Type Description
    Unity.Mathematics.float3

    The center position of the selected tile in map coordinate space.

    MapToWorldPosition(float3)

    Transforms the map position to the world position in the scene.

    Declaration
    public float3 MapToWorldPosition(float3 mapPosition)
    Parameters
    Type Name Description
    Unity.Mathematics.float3 mapPosition

    The map position.

    Returns
    Type Description
    Unity.Mathematics.float3

    The scene position in world space.

    SnapToCorners()

    Returns the ray hit position snapped to the closest tile corner.

    Declaration
    public float3 SnapToCorners()
    Returns
    Type Description
    Unity.Mathematics.float3

    The map position snapped to the tile corners.

    SnapToEdge(Single)

    Returns the ray hit position snapped to the closest tile edge. Optionally provide an horizontal offset.

    Declaration
    public float3 SnapToEdge(float offset = 0F)
    Parameters
    Type Name Description
    Single offset

    The horizontal offset. Negative offset moves the position further into the tile, a positive offset moves it further outwards.

    Returns
    Type Description
    Unity.Mathematics.float3

    The map position snapped to the closest edge of the selected tile.

    SnapToGrid(Int32)

    Returns the snapped ray hit position using the number of tile grid subdivisions.

    Declaration
    public float3 SnapToGrid(int numberOfSubdivisions)
    Parameters
    Type Name Description
    Int32 numberOfSubdivisions

    The number of sub divisions to snap to.

    Returns
    Type Description
    Unity.Mathematics.float3

    The map position snapped to the grid subdivided in the specified number of subdivisions.

    In This Article
    • Properties
      • IsCliff
      • IsSurface
      • Normal
      • SurfacePosition
      • Terrain
      • Tile
      • TileLocalPosition
      • TilePosition
      • WorldPosition
    • Methods
      • FromCenter(float3)
      • MapToWorldPosition(float3)
      • SnapToCorners()
      • SnapToEdge(Single)
      • SnapToGrid(Int32)
    Back to top Tycoon Tile documentation