Package-level declarations

Types

Link copied to clipboard
interface Hitbox

Represents a hitbox.

Link copied to clipboard
class Hitbox2D(val minX: Float, val minY: Float, val maxX: Float, val maxY: Float, val inside: (ERROR CLASS: Symbol not found for Pair<kotlin/Float, kotlin/Float>) -> Boolean) : Hitbox

A 2D hitbox for collision detection.

Link copied to clipboard
class Hitbox3D(val minX: Float, val minY: Float, val minZ: Float, val maxX: Float, val maxY: Float, val maxZ: Float, val inside: (ERROR CLASS: Symbol not found for Triple<kotlin/Float, kotlin/Float, kotlin/Float>) -> Boolean) : Hitbox

A 3D hitbox for collision detection.

Properties

Link copied to clipboard

The x-component of the 2D acceleration of the Positionable2D object.

The x-component of the 3D acceleration of the Positionable3D object.

Link copied to clipboard

The y-component of the 2D acceleration of the Positionable2D object.

The y-component of the 3D acceleration of the Positionable3D object.

Link copied to clipboard

The z-component of the 3D acceleration of the Positionable3D object.

Link copied to clipboard

The size of each cell in the spatial grid used for collision detection.

Link copied to clipboard

The precision used for collision detection sampling. This number is the number of samples taken along each axis within a spatial grid cell.

Link copied to clipboard

A set of all 2D sprites that are currently colliding with this sprite. Uses spatial hashing for O(n) average case complexity.

A set of all 3D sprites that are currently colliding with this sprite. Uses spatial hashing for O(n) average case complexity.

Link copied to clipboard

The default friction coefficient used in physics calculations. The default value is 0.5.

Link copied to clipboard

The default restitution coefficient used in physics calculations.

Link copied to clipboard

The friction coefficient of the Positionable object. This is used in physics calculations to determine the frictional force acting on the object. The default value is defaultFrictionCoefficient.

Link copied to clipboard

The gravitational acceleration constant used in physics calculations. The default value is 9.81 m/s².

Link copied to clipboard

The y-coordinate representing the ground level in the physics simulation. Objects should not fall below this y-coordinate.

Link copied to clipboard

The mass multiplier of the Positionable object. This is used in physics calculations to determine the effective mass of the object. The default value is 1.0.

Link copied to clipboard
var maxX: Float

The maximum x-coordinate boundary in the physics simulation.

Link copied to clipboard
var maxZ: Float

The maximum z-coordinate boundary in the physics simulation.

Link copied to clipboard
var minX: Float

The minimum x-coordinate boundary in the physics simulation.

Link copied to clipboard
var minZ: Float

The minimum z-coordinate boundary in the physics simulation.

Link copied to clipboard
const val NORMAL_THRESHOLD: Double = 0.05

The normal threshold for vector values.

Link copied to clipboard

The restitution coefficient of the Positionable object. This is used in physics calculations to determine how bouncy the object is after collisions. The default value is defaultRestitutionCoefficient.

Link copied to clipboard

The spin decay factor per frame. Higher values = slower decay.

Link copied to clipboard

The spin factor of the Positionable object.

Link copied to clipboard
var Sprite3D.storedRotation: ERROR CLASS: Symbol not found for Triple<kotlin/Float, kotlin/Float, kotlin/Float>

The stored rotation of the 3D sprite as Euler angles (pitch, yaw, roll) in radians. This is the source of truth for rotation, separate from the transform matrix.

Link copied to clipboard
var Sprite3D.targetRotation: ERROR CLASS: Symbol not found for Triple<kotlin/Float, kotlin/Float, kotlin/Float>

The target rotation steps to move toward then on the ground.

Link copied to clipboard

The terminal velocity of all objects in the engine.

Link copied to clipboard

The x-component of the 2D velocity of the Positionable2D object.

The x-component of the 3D velocity of the Positionable3D object.

Link copied to clipboard

The y-component of the 2D velocity of the Positionable2D object

The y-component of the 3D velocity of the Positionable3D object.

Link copied to clipboard

The z-component of the 3D velocity of the Positionable3D object.

Functions

Link copied to clipboard

Advances the physics engine by one tick, updating the positions and velocities of all non-static objects based on the applied forces such as gravity and friction.

Link copied to clipboard
fun Sprite3D.lerpRotation(pitch: Float, yaw: Float, roll: Float)

Adds rotation to a 3D sprite that will be applied gradually over multiple frames.

Link copied to clipboard
fun Sprite2D.lerpSpin(degrees: Float)

Adds spin to a sprite that will be applied gradually over multiple frames.

Link copied to clipboard

Sets both the x and y components of the 2D acceleration of the Positionable2D object.

Sets the x, y, and z components of the 3D acceleration of the Positionable3D object.

Link copied to clipboard

Sets both the x and y components of the 2D velocity of the Positionable2D object.

Sets the x, y, and z components of the 3D velocity of the Positionable3D object.