Options
Menu

Interface IVoxels

Index

Methods

eraseVoxel

  • eraseVoxel(x: number, y: number, z: number, scale: number)
  • queues the deletion of a voxel, sent by calling process on the PacketSender

    Parameters

    • x: number

      the x-coordinate of the voxel (in meter units)

    • y: number

      the y-coordinate of the voxel (in meter units)

    • z: number

      the z-coordinate of the voxel (in meter units)

    • scale: number

      the scale of the voxel (in meter units)

findRayIntersection

  • If the scripting context has visible voxels, this will determine a ray intersection, the results may be inaccurate if the engine is unable to access the visible voxels, in which case result.accurate will be false.

    Parameters

    Returns IRayToVoxelIntersectionResult

findRayIntersectionBlocking

  • If the scripting context has visible voxels, this will determine a ray intersection, and will block in order to return an accurate result

    Parameters

    Returns IRayToVoxelIntersectionResult

getFaceVector

  • getFaceVector(face: string): IVec3
  • returns a voxel space axis aligned vector for the face, useful in doing voxel math

    Parameters

    • face: string

    Returns IVec3

getTreeScale

  • getTreeScale(): number
  • provide the world scale.

    Returns number

getVoxelAt

  • getVoxelAt(x: number, y: number, z: number, scale: number): IVoxelDetail
  • checks the local voxel tree for a voxel at the specified location and scale

    Parameters

    • x: number

      the x-coordinate of the voxel (in meter units)

    • y: number

      the y-coordinate of the voxel (in meter units)

    • z: number

      the z-coordinate of the voxel (in meter units)

    • scale: number

      the scale of the voxel (in meter units)

    Returns IVoxelDetail

getVoxelEnclosingPoint

  • checks the local voxel tree for the smallest voxel enclosing the point

    Parameters

    • point: IVec3

      the x,y,z coordinates of the point (in meter units)

    Returns IVoxelDetail

    VoxelDetail - if no voxel encloses the point then VoxelDetail items will be 0

getVoxelEnclosingPointBlocking

  • checks the local voxel tree for the smallest voxel enclosing the point and uses a blocking lock

    Parameters

    • point: IVec3

      the x,y,z coordinates of the point (in meter units)

    Returns IVoxelDetail

    VoxelDetail - if no voxel encloses the point then VoxelDetail items will be 0

setVoxel

  • setVoxel(x: number, y: number, z: number, scale: number, red: IUChar, green: IUChar, blue: IUChar)
  • queues the destructive creation of a voxel which will be sent by calling process on the PacketSender

    Parameters

    • x: number

      the x-coordinate of the voxel (in meter units)

    • y: number

      the y-coordinate of the voxel (in meter units)

    • z: number

      the z-coordinate of the voxel (in meter units)

    • scale: number

      the scale of the voxel (in meter units)

    • red: IUChar

      the R value for RGB color of voxel

    • green: IUChar

      the G value for RGB color of voxel

    • blue: IUChar

      the B value for RGB color of voxel

setVoxelNonDestructive

  • setVoxelNonDestructive(x: number, y: number, z: number, scale: number, red: IUChar, green: IUChar, blue: IUChar)
  • queues the creation of a voxel which will be sent by calling process on the PacketSender

    Parameters

    • x: number

      the x-coordinate of the voxel (in meter units)

    • y: number

      the y-coordinate of the voxel (in meter units)

    • z: number

      the z-coordinate of the voxel (in meter units)

    • scale: number

      the scale of the voxel (in meter units)

    • red: IUChar

      the R value for RGB color of voxel

    • green: IUChar

      the G value for RGB color of voxel

    • blue: IUChar

      the B value for RGB color of voxel

Generated using TypeDoc