Class Collision.Probe
Represents a collision probe in the game world.
Provides collision information from a reference world position.
Functions
| Probe(pos, [roomNumber]) | Create a probe at a specified world position in a room. |
| Probe(pos, roomNumber, dir, dist) | Create a probe that casts from an origin world position in a room in a given direction for a specified distance. |
| Probe(pos, roomNumber, rot, dist) | Create a probe that casts from an origin world position in a room in the direction of a given rotation for a specified distance. |
| Probe(pos, roomNumber, rot, relOffset) | Create a probe that casts from an origin world position, where a given relative offset is rotated according to a given rotation. |
| Probe:GetPosition() | Get the world position of this probe. |
| Probe:GetRoom() | Get the room object of this probe. |
| Probe:GetRoomName() | Get the room name of this probe. |
| Probe:GetRoomNumber() | Get the room number of this probe. |
| Probe:GetFloorHeight() | Get the floor height at this probe. |
| Probe:GetCeilingHeight() | Get the ceiling height at this probe. |
| Probe:GetWaterSurfaceHeight() | Get the water surface height at this probe. |
| Probe:GetFloorNormal() | Get the normal of the floor at this probe. |
| Probe:GetCeilingNormal() | Get the normal of the ceiling at this probe. |
| Probe:GetFloorMaterialType() | Get the material type of the floor at this probe. |
| Probe:GetCeilingMaterialType() | Get the material type of the ceiling at this probe. |
| Probe:IsSteepFloor() | Check if the floor at this probe is steep. |
| Probe:IsSteepCeiling() | Check if the ceiling at this probe is steep. |
| Probe:IsWall() | Check if the probe is inside a wall. |
| Probe:IsInsideSolidGeometry() | Check if this probe is inside solid geometry (below a floor, above a ceiling, inside a bridge, or inside a wall). |
| Probe:IsClimbableWall(headingAngle) | Check if there is a climbable wall in the given heading angle at this probe. |
| Probe:IsMonkeySwing() | Check if there is a monkey swing sector at this probe. |
| Probe:IsDeath() | Check if there is a death sector at this probe. |
| Probe:Preview() | Preview this Probe in the Collision Stats debug page. |
Functions
- Probe(pos, [roomNumber])
-
Create a probe at a specified world position in a room.
Parameters:
- pos Vec3 World position.
- roomNumber int Room number. Must be used if probing a position in an overlapping room. Optional.
Returns:
-
Probe
A new probe object.
- Probe(pos, roomNumber, dir, dist)
-
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.
Parameters:
- pos Vec3 Origin world position to cast from.
- roomNumber int Origin room number.
- dir Vec3 Direction in which to cast.
- dist float Distance to cast.
Returns:
-
Probe
A new probe object.
- Probe(pos, roomNumber, rot, dist)
-
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.
Parameters:
- pos Vec3 Origin world position to cast from.
- roomNumber int Origin room number.
- rot Rotation Rotation defining the direction in which to cast.
- dist float Distance to cast.
Returns:
-
Probe
A new Probe.
- Probe(pos, roomNumber, rot, relOffset)
-
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.
Parameters:
- pos Vec3 Origin world position to cast from.
- roomNumber int Origin room number.
- rot Rotation Rotation according to which the input relative offset is rotated.
- relOffset Vec3 Relative offset to cast.
Returns:
-
Probe
A new Probe.
- Probe:GetPosition()
-
Get the world position of this probe.
Returns:
-
Vec3
World position.
- Probe:GetRoom()
-
Get the room object of this probe.
Returns:
-
Room
Room object.
- Probe:GetRoomName()
-
Get the room name of this probe.
Returns:
-
string
Room name.
- Probe:GetRoomNumber()
-
Get the room number of this probe.
Returns:
-
int
Room number.
- Probe:GetFloorHeight()
-
Get the floor height at this probe.
Returns:
-
int
Floor height. nil: no floor exists.
- Probe:GetCeilingHeight()
-
Get the ceiling height at this probe.
Returns:
-
int
Ceiling height. nil: no ceiling exists.
- Probe:GetWaterSurfaceHeight()
-
Get the water surface height at this probe.
Returns:
-
int
Water surface height. nil: no water surface exists.
- Probe:GetFloorNormal()
-
Get the normal of the floor at this probe.
Returns:
-
Vec3
Floor normal. nil: no floor exists.
- Probe:GetCeilingNormal()
-
Get the normal of the ceiling at this probe.
Returns:
-
Vec3
Ceiling normal. nil: no ceiling exists.
- Probe:GetFloorMaterialType()
-
Get the material type of the floor at this probe.
Returns:
-
MaterialType
Floor material type. nil: no floor exists.
- Probe:GetCeilingMaterialType()
-
Get the material type of the ceiling at this probe.
Returns:
-
MaterialType
Ceiling material type. nil: no ceiling exists.
- Probe:IsSteepFloor()
-
Check if the floor at this probe is steep.
Returns:
-
bool
Steep floor status. true: is a steep floor, false: isn't a steep floor, nil: no floor exists.
- Probe:IsSteepCeiling()
-
Check if the ceiling at this probe is steep.
Returns:
-
bool
Steep ceiling status. true: is a steep ceiling, false: isn't a steep ceiling, nil: no ceiling exists.
- Probe:IsWall()
-
Check if the probe is inside a wall. Can be used to determine if a wall and ceiling exist.
Returns:
-
bool
Wall status. true: is a wall, false: isn't a wall.
- Probe:IsInsideSolidGeometry()
-
Check if this probe is inside solid geometry (below a floor, above a ceiling, inside a bridge, or inside a wall).
Returns:
-
bool
Inside geometry status. true: is inside, false: is outside.
- Probe:IsClimbableWall(headingAngle)
-
Check if there is a climbable wall in the given heading angle at this probe.
Parameters:
- headingAngle float Heading angle at which to check for a climbable wall.
Returns:
-
bool
Climbable wall status. true: wall is climbable , false: wall isn't climbable.
- Probe:IsMonkeySwing()
-
Check if there is a monkey swing sector at this probe.
Returns:
-
bool
Monkey swing sector status. true: is a monkey swing, false: isn't a monkey swing.
- Probe:IsDeath()
-
Check if there is a death sector at this probe.
Returns:
-
bool
Death sector status. true: is a death sector, false: isn't a death sector.
- Probe:Preview()
- Preview this Probe in the Collision Stats debug page.