Hierarchy

  • PhysicsSystem

Methods

  • Apply a continuous force to the player from a given source entity. Multiple sources are accumulated: the registry sums all active forces and writes a single PBPhysicsCombinedForce component. Calling again with the same source replaces its previous force.

    Parameters

    • source: Entity

      Entity key identifying this force source

    • vector: Vector3Type

      single vector whose length encodes the strength or use overload for direction with a separate magnitude — the direction will be normalized before scaling.

    Returns void

  • Parameters

    Returns void

  • Apply a continuous force to the player for a limited duration. After duration seconds the force is automatically removed. Calling again with the same source resets the timer.

    Parameters

    • source: Entity

      Entity key identifying this force source

    • duration: number

      how long the force lasts, in seconds

    • vector: Vector3Type

      single vector whose length encodes the strength or use overload for direction with a separate magnitude — the direction will be normalized before scaling.

    Returns void

  • Parameters

    Returns void

  • Apply a one-shot impulse to the player entity. Multiple calls within the same frame are accumulated (summed).

    Parameters

    • vector: Vector3Type

      a single vector whose length encodes the strength. or use overload for direction with a separate magnitude — the direction will be normalized before scaling.

    Returns void

  • Parameters

    Returns void

  • Push the player away from a point. Computes direction from fromPosition to the player, applies falloff, and delegates to applyImpulseToPlayer.

    If the player is exactly at fromPosition, pushes upward.

    Parameters

    • fromPosition: Vector3Type

      world-space origin of the knockback (explosion center, enemy position, etc.)

    • magnitude: number

      base impulse strength

    • Optional radius: number

      max distance of effect (default: Infinity)

    • Optional falloff: KnockbackFalloff

      how force decreases with distance (default: CONSTANT)

    Returns void

  • Apply a continuous repulsion force that pushes the player away from a point, recalculating direction every tick as the player moves. Remove with removeForceFromPlayer(source).

    Negative magnitude = attraction (pulls toward the source).

    Parameters

    • source: Entity

      Entity key identifying this force source

    • fromPosition: Vector3Type

      world-space origin of repulsion

    • magnitude: number

      base force strength

    • Optional radius: number

      max distance of effect (default: Infinity)

    • Optional falloff: KnockbackFalloff

      how force decreases with distance (default: CONSTANT)

    Returns void

  • Remove a continuous force from the player. Remaining sources are re-summed; if none remain the force is cleared. No-op if the source is not registered.

    Parameters

    • source: Entity

      Entity key identifying the force source to remove

    Returns void