-- TEN 1.11.1.1 API -- This file is auto-generated and for IntelliSense purposes only! -- Any changes made here will not be reflected in the engine. ---@meta ---Collision module for Tomb Engine ---@class Collision Collision = {} ---Constants for the type of intersection checks. ---To be used with Collision.Ray class. ---@enum IntersectionType IntersectionType = { ---No intersection checks. NONE = "NONE", ---Bounding box intersection checks. BOX = "BOX", ---Bounding box and sphere intersection checks. BOX_AND_SPHERE = "BOX_AND_SPHERE", } ---Module-prefixed alias for IntersectionType Collision.IntersectionType = IntersectionType ---Constants for material types. ---Corresponds to Tomb Editor texture sound material types. ---To be used with Collision.Probe.GetFloorMaterialType and Collision.Probe.GetCeilingMaterialType. ---@enum MaterialType MaterialType = { ---Mud material type. MUD = "MUD", ---Snow material type. SNOW = "SNOW", ---Sand material type. SAND = "SAND", ---Gravel material type. GRAVEL = "GRAVEL", ---Ice material type. ICE = "ICE", ---Water material type. WATER = "WATER", ---Stone material type. STONE = "STONE", ---Wood material type. WOOD = "WOOD", ---Metal material type. METAL = "METAL", ---Marble material type. MARBLE = "MARBLE", ---Grass material type. GRASS = "GRASS", ---Concrete material type. CONCRETE = "CONCRETE", ---Old wood material type. OLD_WOOD = "OLD_WOOD", ---Old metal material type. OLD_METAL = "OLD_METAL", ---Custom material type 1. CUSTOM_1 = "CUSTOM_1", ---Custom material type 2. CUSTOM_2 = "CUSTOM_2", ---Custom material type 3. CUSTOM_3 = "CUSTOM_3", ---Custom material type 4. CUSTOM_4 = "CUSTOM_4", ---Custom material type 5. CUSTOM_5 = "CUSTOM_5", ---Custom material type 6. CUSTOM_6 = "CUSTOM_6", ---Custom material type 7. CUSTOM_7 = "CUSTOM_7", ---Custom material type 8. CUSTOM_8 = "CUSTOM_8", } ---Module-prefixed alias for MaterialType Collision.MaterialType = MaterialType ---Casts a collision ray in the game world. ---Provides collision information for collided rooms, moveables, and statics. ---@class Ray Ray = {} ---Module-prefixed alias for Ray Collision.Ray = Ray ---Create a ray at a specified world position, direction, and distance in a room. ---@param pos Vec3 # World position. ---@param roomNumber integer # Origin room number. ---@param direction Vec3 # Direction vector. ---@param dist number # Maximum distance the ray can travel. ---@param hitMoveables IntersectionType? # Collide with moveables. Disable when not needed or required to optimize performance. (default: `Collision.IntersectionType.BOX`) ---@param hitStatics IntersectionType? # Collide with static meshes. Disable when not needed or required to optimize performance. (default: `Collision.IntersectionType.BOX`) ---@param penetrate boolean? # Continue the ray test after the first hit. Enable this when you need to collect all collision information beyond the first occlusion point. (default: `false`) ---@return Ray # A new ray object. function Ray.new(pos, roomNumber, direction, dist, hitMoveables, hitStatics, penetrate) end ---Create a ray at a specified world position, direction, and distance in a room. ---@param pos Vec3 # World position. ---@param roomNumber integer # Origin room number. ---@param direction Vec3 # Direction vector. ---@param dist number # Maximum distance the ray can travel. ---@param hitMoveables IntersectionType? # Collide with moveables. Disable when not needed or required to optimize performance. (default: `Collision.IntersectionType.BOX`) ---@param hitStatics IntersectionType? # Collide with static meshes. Disable when not needed or required to optimize performance. (default: `Collision.IntersectionType.BOX`) ---@param penetrate boolean? # Continue the ray test after the first hit. Enable this when you need to collect all collision information beyond the first occlusion point. (default: `false`) ---@return Ray # A new ray object. function Collision.Ray.new(pos, roomNumber, direction, dist, hitMoveables, hitStatics, penetrate) end ---Get the room hit by the ray. ---@return Room # Room object. _nil: no room was hit._ function Ray:GetRoom() end ---Get the position of the room geometry where the ray hit. ---@return Vec3 # Hit position. _nil: no room was hit._ function Ray:GetRoomPosition() end ---Get the distance from the ray origin point to the room hit position. ---@return number # Hit distance. _nil: no room was hit._ function Ray:GetRoomDistance() end ---Get the surface normal of the room geometry where the ray hit. ---@return Vec3 # Surface normal. _nil: no room was hit, or no valid room geometry was hit._ function Ray:GetRoomNormal() end ---Get the first moveable hit by the ray. ---Moveable hits will be detected only if `hitMoveables` setting was enabled while creating a ray. ---@return Moveable # Moveable object. _nil: no moveable was hit._ function Ray:GetMoveable() end ---Gets all moveables hit by the ray. ---Multiple moveable hits will be detected only if `hitMoveables` and `penetrate` settings were enabled while creating a ray. ---@return table # Table of moveables hit by the ray. _nil: no moveables were hit._ function Ray:GetMoveables() end ---Get the position of the moveable where the ray hit. ---Valid position will be returned only if `hitMoveables` setting was enabled while creating a ray. ---@return Vec3 # Hit position. _nil: no moveable was hit._ function Ray:GetMoveablePosition() end ---Get the distance from the ray origin to the first moveable hit position. ---Valid distance will be returned only if `hitMoveables` setting was enabled while creating a ray. ---@return number # Hit distance. _nil: no moveable was hit._ function Ray:GetMoveableDistance() end ---Get the first static mesh hit by the ray. ---Static mesh hits will be detected only if `hitStatics` setting was enabled while creating a ray. ---@return Static # Static mesh object. _nil: no static mesh was hit._ function Ray:GetStatic() end ---Gets all statics hit by the ray. ---Multiple statics hits will be detected only if `hitStatics` and `penetrate` settings were enabled while creating a ray. ---@return table # Table of statics hit by the ray. _nil: no statics were hit._ function Ray:GetStatics() end ---Get the position of the first static mesh hit by the ray. ---Valid position will be returned only if `hitStatics` setting was enabled while creating a ray. ---@return Vec3 # Hit position. _nil: no static mesh was hit._ function Ray:GetStaticPosition() end ---Get the distance from the ray origin to the first static mesh hit position. ---Valid distance will be returned only if `hitStatics` setting was enabled while creating a ray. ---@return number # Hit distance. _nil: no static mesh was hit._ function Ray:GetStaticDistance() end ---Check if the ray hit a room. ---If a room name is provided, returns `true` only when the hit occurs with the relevant room geometry. ---@param name string? # Name of the room to check for. (optional) ---@return boolean # Room hit status. _true if a room was hit, false otherwise._ function Ray:HitRoom(name) end ---Check if the ray hit a moveable. ---Moveable hits will be detected only if `hitMoveables` setting was enabled while creating a ray. ---If a moveable name is provided, returns `true` only when the hit occurs with the relevant moveable. ---@param name string? # Name of the moveable to check for. (optional) ---@return boolean # Moveable hit status. _true if a moveable was hit, false otherwise._ function Ray:HitMoveable(name) end ---Check if the ray hit a static mesh. ---Static mesh hits will be detected only if `hitStatics` setting was enabled while creating a ray. ---If a static mesh name is provided, returns `true` only when the hit occurs with the relevant static mesh. ---@param name string? # Name of the static mesh to check for. (optional) ---@return boolean # Static mesh hit status. _true if a static mesh was hit, false otherwise._ function Ray:HitStatic(name) end ---Preview this ray in the Collision Stats debug page. function Ray:Preview() end ---Constructor function for Ray (alias for Ray.new) ---@param pos Vec3 # World position. ---@param roomNumber integer # Origin room number. ---@param direction Vec3 # Direction vector. ---@param dist number # Maximum distance the ray can travel. ---@param hitMoveables IntersectionType? # Collide with moveables. Disable when not needed or required to optimize performance. (default: `Collision.IntersectionType.BOX`) ---@param hitStatics IntersectionType? # Collide with static meshes. Disable when not needed or required to optimize performance. (default: `Collision.IntersectionType.BOX`) ---@param penetrate boolean? # Continue the ray test after the first hit. Enable this when you need to collect all collision information beyond the first occlusion point. (default: `false`) ---@return Ray # A new ray object. function Ray(pos, roomNumber, direction, dist, hitMoveables, hitStatics, penetrate) end ---Constructor function for Collision.Ray (alias for Collision.Ray.new) ---@param pos Vec3 # World position. ---@param roomNumber integer # Origin room number. ---@param direction Vec3 # Direction vector. ---@param dist number # Maximum distance the ray can travel. ---@param hitMoveables IntersectionType? # Collide with moveables. Disable when not needed or required to optimize performance. (default: `Collision.IntersectionType.BOX`) ---@param hitStatics IntersectionType? # Collide with static meshes. Disable when not needed or required to optimize performance. (default: `Collision.IntersectionType.BOX`) ---@param penetrate boolean? # Continue the ray test after the first hit. Enable this when you need to collect all collision information beyond the first occlusion point. (default: `false`) ---@return Ray # A new ray object. function Collision.Ray(pos, roomNumber, direction, dist, hitMoveables, hitStatics, penetrate) end ---Represents a collision probe in the game world. ---Provides collision information from a reference world position. ---@class Probe Probe = {} ---Module-prefixed alias for Probe Collision.Probe = Probe ---Create a probe at a specified world position in a room. ---@param pos Vec3 # World position. ---@param roomNumber integer? # Room number. Must be used if probing a position in an overlapping room. (optional) ---@return Probe # A new probe object. function Probe.new(pos, roomNumber) end ---Create a probe at a specified world position in a room. ---@param pos Vec3 # World position. ---@param roomNumber integer? # Room number. Must be used if probing a position in an overlapping room. (optional) ---@return Probe # A new probe object. function Collision.Probe.new(pos, roomNumber) end ---Create a probe that casts from an origin world position in a room in a given direction for a specified distance. ---Required to correctly traverse between rooms. ---@param pos Vec3 # Origin world position to cast from. ---@param roomNumber integer # Origin room number. ---@param dir Vec3 # Direction in which to cast. ---@param dist number # Distance to cast. ---@return Probe # A new probe object. function Probe.new(pos, roomNumber, dir, dist) end ---Create a probe that casts from an origin world position in a room in a given direction for a specified distance. ---Required to correctly traverse between rooms. ---@param pos Vec3 # Origin world position to cast from. ---@param roomNumber integer # Origin room number. ---@param dir Vec3 # Direction in which to cast. ---@param dist number # Distance to cast. ---@return Probe # A new probe object. function Collision.Probe.new(pos, roomNumber, dir, dist) end ---Create a probe that casts from an origin world position in a room in the direction of a given rotation for a specified distance. ---Required to correctly traverse between rooms. ---@param pos Vec3 # Origin world position to cast from. ---@param roomNumber integer # Origin room number. ---@param rot Rotation # Rotation defining the direction in which to cast. ---@param dist number # Distance to cast. ---@return Probe # A new Probe. function Probe.new(pos, roomNumber, rot, dist) end ---Create a probe that casts from an origin world position in a room in the direction of a given rotation for a specified distance. ---Required to correctly traverse between rooms. ---@param pos Vec3 # Origin world position to cast from. ---@param roomNumber integer # Origin room number. ---@param rot Rotation # Rotation defining the direction in which to cast. ---@param dist number # Distance to cast. ---@return Probe # A new Probe. function Collision.Probe.new(pos, roomNumber, rot, dist) end ---Create a probe that casts from an origin world position, where a given relative offset is rotated according to a given rotation. ---Required to correctly traverse between rooms. ---@param pos Vec3 # Origin world position to cast from. ---@param roomNumber integer # Origin room number. ---@param rot Rotation # Rotation according to which the input relative offset is rotated. ---@param relOffset Vec3 # Relative offset to cast. ---@return Probe # A new Probe. function Probe.new(pos, roomNumber, rot, relOffset) end ---Create a probe that casts from an origin world position, where a given relative offset is rotated according to a given rotation. ---Required to correctly traverse between rooms. ---@param pos Vec3 # Origin world position to cast from. ---@param roomNumber integer # Origin room number. ---@param rot Rotation # Rotation according to which the input relative offset is rotated. ---@param relOffset Vec3 # Relative offset to cast. ---@return Probe # A new Probe. function Collision.Probe.new(pos, roomNumber, rot, relOffset) end ---Get the world position of this probe. ---@return Vec3 # World position. function Probe:GetPosition() end ---Get the room object of this probe. ---@return Room # Room object. function Probe:GetRoom() end ---Get the room name of this probe. ---@return string # Room name. function Probe:GetRoomName() end ---Get the room number of this probe. ---@return integer # Room number. function Probe:GetRoomNumber() end ---Get the floor height at this probe. ---@return integer # Floor height. _nil: no floor exists._ function Probe:GetFloorHeight() end ---Get the ceiling height at this probe. ---@return integer # Ceiling height. _nil: no ceiling exists._ function Probe:GetCeilingHeight() end ---Get the water surface height at this probe. ---@return integer # Water surface height. _nil: no water surface exists._ function Probe:GetWaterSurfaceHeight() end ---Get the normal of the floor at this probe. ---@return Vec3 # Floor normal. _nil: no floor exists._ function Probe:GetFloorNormal() end ---Get the normal of the ceiling at this probe. ---@return Vec3 # Ceiling normal. _nil: no ceiling exists._ function Probe:GetCeilingNormal() end ---Get the material type of the floor at this probe. ---@return MaterialType # Floor material type. _nil: no floor exists._ function Probe:GetFloorMaterialType() end ---Get the material type of the ceiling at this probe. ---@return MaterialType # Ceiling material type. _nil: no ceiling exists._ function Probe:GetCeilingMaterialType() end ---Check if the floor at this probe is steep. ---@return boolean # Steep floor status. _true: is a steep floor, false: isn't a steep floor, nil: no floor exists._ function Probe:IsSteepFloor() end ---Check if the ceiling at this probe is steep. ---@return boolean # Steep ceiling status. _true: is a steep ceiling, false: isn't a steep ceiling, nil: no ceiling exists._ function Probe:IsSteepCeiling() end ---Check if the probe is inside a wall. ---Can be used to determine if a wall and ceiling exist. ---@return boolean # Wall status. _true: is a wall, false: isn't a wall._ function Probe:IsWall() end ---Check if this probe is inside solid geometry (below a floor, above a ceiling, inside a bridge, or inside a wall). ---@return boolean # Inside geometry status. _true: is inside, false: is outside._ function Probe:IsInsideSolidGeometry() end ---Check if there is a climbable wall in the given heading angle at this probe. ---@param headingAngle number # Heading angle at which to check for a climbable wall. ---@return boolean # Climbable wall status. _true: wall is climbable , false: wall isn't climbable._ function Probe:IsClimbableWall(headingAngle) end ---Check if there is a monkey swing sector at this probe. ---@return boolean # Monkey swing sector status. _true: is a monkey swing, false: isn't a monkey swing._ function Probe:IsMonkeySwing() end ---Check if there is a death sector at this probe. ---@return boolean # Death sector status. _true: is a death sector, false: isn't a death sector._ function Probe:IsDeath() end ---Preview this Probe in the Collision Stats debug page. function Probe:Preview() end ---Constructor function for Probe (alias for Probe.new) ---@param pos Vec3 # World position. ---@param roomNumber integer? # Room number. Must be used if probing a position in an overlapping room. (optional) ---@return Probe # A new probe object. function Probe(pos, roomNumber) end ---@param pos Vec3 # Origin world position to cast from. ---@param roomNumber integer # Origin room number. ---@param dir Vec3 # Direction in which to cast. ---@param dist number # Distance to cast. ---@return Probe # A new probe object. function Probe(pos, roomNumber, dir, dist) end ---@param pos Vec3 # Origin world position to cast from. ---@param roomNumber integer # Origin room number. ---@param rot Rotation # Rotation defining the direction in which to cast. ---@param dist number # Distance to cast. ---@return Probe # A new Probe. function Probe(pos, roomNumber, rot, dist) end ---@param pos Vec3 # Origin world position to cast from. ---@param roomNumber integer # Origin room number. ---@param rot Rotation # Rotation according to which the input relative offset is rotated. ---@param relOffset Vec3 # Relative offset to cast. ---@return Probe # A new Probe. function Probe(pos, roomNumber, rot, relOffset) end ---Constructor function for Collision.Probe (alias for Collision.Probe.new) ---@param pos Vec3 # World position. ---@param roomNumber integer? # Room number. Must be used if probing a position in an overlapping room. (optional) ---@return Probe # A new probe object. function Collision.Probe(pos, roomNumber) end ---@param pos Vec3 # Origin world position to cast from. ---@param roomNumber integer # Origin room number. ---@param dir Vec3 # Direction in which to cast. ---@param dist number # Distance to cast. ---@return Probe # A new probe object. function Collision.Probe(pos, roomNumber, dir, dist) end ---@param pos Vec3 # Origin world position to cast from. ---@param roomNumber integer # Origin room number. ---@param rot Rotation # Rotation defining the direction in which to cast. ---@param dist number # Distance to cast. ---@return Probe # A new Probe. function Collision.Probe(pos, roomNumber, rot, dist) end ---@param pos Vec3 # Origin world position to cast from. ---@param roomNumber integer # Origin room number. ---@param rot Rotation # Rotation according to which the input relative offset is rotated. ---@param relOffset Vec3 # Relative offset to cast. ---@return Probe # A new Probe. function Collision.Probe(pos, roomNumber, rot, relOffset) end return Collision