VoxelRaycastResult
Result of a raycast performed with VoxelTool.raycast
Result of a raycast performed with VoxelTool.Raycast
Declarations checked against C# SDK 1.0.0. Expand a name to see declarations and documentation.
Constructors1
VoxelRaycastResultConstructor
public VoxelRaycastResult();Properties4
DistanceProperty
public float Distance { get; }Distance between the origin of the ray and the surface of the cube representing the hit voxel.
NormalProperty
public Vector3 Normal { get; }Unit vector pointing away from the surface that was hit.
This is only available if VoxelTool was configured to compute normals. See VoxelTool.SetRaycastNormalEnabled.
With blocky voxels, this normal will be based on collision boxes rather than the mesh.
PositionProperty
public Vector3I Position { get; }Integer position of the voxel that was hit. In a blocky game, this would be the position of the voxel to interact with.
PreviousPositionProperty
public Vector3I PreviousPosition { get; }Integer position of the previous voxel along the ray before the final hit. In a blocky game, this would be the position of the voxel to place on top of the pointed one.
Methods4
GetDistancefloat
public float GetDistance();floatGetNormalVector3
public Vector3 GetNormal();Vector3GetPositionVector3I
public Vector3I GetPosition();Vector3IGetPreviousPositionVector3I
public Vector3I GetPreviousPosition();Vector3I