RSX Code Reference
    Preparing search index...
    • rsx
    • PhysicsScene

    Class PhysicsSceneAbstract

    Physical representation of a scene, allowing creation of new physical objects in the scene and queries against those objects. Objects created in different scenes cannot physically interact with each other.

    Index
    • Parameters

      • OptionalisInternalConstructor: boolean

      Returns PhysicsScene

    • Performs a sweep into the scene using a box and returns the closest found hit, if any.

      Parameters

      • box: Immutable<AABox>

        Box to sweep through the scene.

      • rotation: Immutable<Quaternion>

        Orientation of the box.

      • unitDir: Immutable<Vector3>

        Unit direction towards which to perform the sweep.

      • Optionallayer: rsx.LayerMask

        Layers to consider for the query. This allows you to ignore certain groups of objects.

      • OptionalmaximumDistance: number

        Maximum distance at which to perform the query. Hits past this distance will not be detected.

      Returns PhysicsQueryHit

      True if something was hit, false otherwise.

    • Performs a sweep into the scene using a box and returns all found hits.

      Parameters

      • box: Immutable<AABox>

        Box to sweep through the scene.

      • rotation: Immutable<Quaternion>

        Orientation of the box.

      • unitDir: Immutable<Vector3>

        Unit direction towards which to perform the sweep.

      • Optionallayer: rsx.LayerMask

        Layers to consider for the query. This allows you to ignore certain groups of objects.

      • OptionalmaximumDistance: number

        Maximum distance at which to perform the query. Hits past this distance will not be detected.

      Returns PhysicsQueryHit[]

      List of all detected hits.

    • Performs a sweep into the scene using a box and checks if it has hit anything. This can be significantly more efficient than other types of cast* calls.

      Parameters

      • box: Immutable<AABox>

        Box to sweep through the scene.

      • rotation: Immutable<Quaternion>

        Orientation of the box.

      • unitDir: Immutable<Vector3>

        Unit direction towards which to perform the sweep.

      • Optionallayer: rsx.LayerMask

        Layers to consider for the query. This allows you to ignore certain groups of objects.

      • OptionalmaximumDistance: number

        Maximum distance at which to perform the query. Hits past this distance will not be detected.

      Returns boolean

      True if something was hit, false otherwise.

    • Checks if the provided box overlaps any other collider in the scene.

      Parameters

      Returns boolean

      True if there is overlap with another object, false otherwise.

    • Performs a sweep into the scene using a capsule and returns the closest found hit, if any.

      Parameters

      • capsule: Immutable<Capsule>

        Capsule to sweep through the scene.

      • rotation: Immutable<Quaternion>

        Orientation of the capsule.

      • unitDir: Immutable<Vector3>

        Unit direction towards which to perform the sweep.

      • Optionallayer: rsx.LayerMask

        Layers to consider for the query. This allows you to ignore certain groups of objects.

      • OptionalmaximumDistance: number

        Maximum distance at which to perform the query. Hits past this distance will not be detected.

      Returns PhysicsQueryHit

      True if something was hit, false otherwise.

    • Performs a sweep into the scene using a capsule and returns all found hits.

      Parameters

      • capsule: Immutable<Capsule>

        Capsule to sweep through the scene.

      • rotation: Immutable<Quaternion>

        Orientation of the capsule.

      • unitDir: Immutable<Vector3>

        Unit direction towards which to perform the sweep.

      • Optionallayer: rsx.LayerMask

        Layers to consider for the query. This allows you to ignore certain groups of objects.

      • OptionalmaximumDistance: number

        Maximum distance at which to perform the query. Hits past this distance will not be detected.

      Returns PhysicsQueryHit[]

      List of all detected hits.

    • Performs a sweep into the scene using a capsule and checks if it has hit anything. This can be significantly more efficient than other types of cast* calls.

      Parameters

      • capsule: Immutable<Capsule>

        Capsule to sweep through the scene.

      • rotation: Immutable<Quaternion>

        Orientation of the capsule.

      • unitDir: Immutable<Vector3>

        Unit direction towards which to perform the sweep.

      • Optionallayer: rsx.LayerMask

        Layers to consider for the query. This allows you to ignore certain groups of objects.

      • OptionalmaximumDistance: number

        Maximum distance at which to perform the query. Hits past this distance will not be detected.

      Returns boolean

      True if something was hit, false otherwise.

    • Checks if the provided capsule overlaps any other collider in the scene.

      Parameters

      • capsule: Immutable<Capsule>

        Capsule to check for overlap.

      • rotation: Immutable<Quaternion>

        Orientation of the capsule.

      • Optionallayer: rsx.LayerMask

        Layers to consider for the query. This allows you to ignore certain groups of objects.

      Returns boolean

      True if there is overlap with another object, false otherwise.

    • Performs a sweep into the scene using a convex mesh and checks if it has hit anything. This can be significantly more efficient than other types of cast* calls.

      Parameters

      • mesh: PhysicsMesh | ResourceHandle<PhysicsMesh>

        Mesh to sweep through the scene. Must be convex.

      • position: Immutable<Vector3>

        Starting position of the mesh.

      • rotation: Immutable<Quaternion>

        Orientation of the mesh.

      • unitDir: Immutable<Vector3>

        Unit direction towards which to perform the sweep.

      • Optionallayer: rsx.LayerMask

        Layers to consider for the query. This allows you to ignore certain groups of objects.

      • OptionalmaximumDistance: number

        Maximum distance at which to perform the query. Hits past this distance will not be detected.

      Returns boolean

      True if something was hit, false otherwise.

    • Casts a ray into the scene and returns the closest found hit, if any.

      Parameters

      • ray: Immutable<Ray>

        Ray to cast into the scene.

      • Optionallayer: rsx.LayerMask

        Layers to consider for the query. This allows you to ignore certain groups of objects.

      • OptionalmaximumDistance: number

        Maximum distance at which to perform the query. Hits past this distance will not be detected.

      Returns PhysicsQueryHit

      True if something was hit, false otherwise.

    • Casts a ray into the scene and returns the closest found hit, if any.

      Parameters

      • origin: Immutable<Vector3>
      • unitDir: Immutable<Vector3>
      • Optionallayer: rsx.LayerMask

        Layers to consider for the query. This allows you to ignore certain groups of objects.

      • OptionalmaximumDistance: number

        Maximum distance at which to perform the query. Hits past this distance will not be detected.

      Returns PhysicsQueryHit

      True if something was hit, false otherwise.

    • Casts a ray into the scene and returns all found hits.

      Parameters

      • ray: Immutable<Ray>

        Ray to cast into the scene.

      • Optionallayer: rsx.LayerMask

        Layers to consider for the query. This allows you to ignore certain groups of objects.

      • OptionalmaximumDistance: number

        Maximum distance at which to perform the query. Hits past this distance will not be detected.

      Returns PhysicsQueryHit[]

      List of all detected hits.

    • Casts a ray into the scene and returns all found hits.

      Parameters

      • origin: Immutable<Vector3>

        Origin of the ray to cast into the scene.

      • unitDir: Immutable<Vector3>

        Unit direction of the ray to cast into the scene.

      • Optionallayer: rsx.LayerMask

        Layers to consider for the query. This allows you to ignore certain groups of objects.

      • OptionalmaximumDistance: number

        Maximum distance at which to perform the query. Hits past this distance will not be detected.

      Returns PhysicsQueryHit[]

      List of all detected hits.

    • Casts a ray into the scene and checks if it has hit anything. This can be significantly more efficient than other types of cast* calls.

      Parameters

      • ray: Immutable<Ray>

        Ray to cast into the scene.

      • Optionallayer: rsx.LayerMask

        Layers to consider for the query. This allows you to ignore certain groups of objects.

      • OptionalmaximumDistance: number

        Maximum distance at which to perform the query. Hits past this distance will not be detected.

      Returns boolean

      True if something was hit, false otherwise.

    • Casts a ray into the scene and checks if it has hit anything. This can be significantly more efficient than other types of cast* calls.

      Parameters

      • origin: Immutable<Vector3>

        Origin of the ray to cast into the scene.

      • unitDir: Immutable<Vector3>

        Unit direction of the ray to cast into the scene.

      • Optionallayer: rsx.LayerMask

        Layers to consider for the query. This allows you to ignore certain groups of objects.

      • OptionalmaximumDistance: number

        Maximum distance at which to perform the query. Hits past this distance will not be detected.

      Returns boolean

      True if something was hit, false otherwise.

    • Performs a sweep into the scene using a sphere and returns the closest found hit, if any.

      Parameters

      • sphere: Immutable<Sphere>

        Sphere to sweep through the scene.

      • unitDir: Immutable<Vector3>

        Unit direction towards which to perform the sweep.

      • Optionallayer: rsx.LayerMask

        Layers to consider for the query. This allows you to ignore certain groups of objects.

      • OptionalmaximumDistance: number

        Maximum distance at which to perform the query. Hits past this distance will not be detected.

      Returns PhysicsQueryHit

      True if something was hit, false otherwise.

    • Performs a sweep into the scene using a sphere and returns all found hits.

      Parameters

      • sphere: Immutable<Sphere>

        Sphere to sweep through the scene.

      • unitDir: Immutable<Vector3>

        Unit direction towards which to perform the sweep.

      • Optionallayer: rsx.LayerMask

        Layers to consider for the query. This allows you to ignore certain groups of objects.

      • OptionalmaximumDistance: number

        Maximum distance at which to perform the query. Hits past this distance will not be detected.

      Returns PhysicsQueryHit[]

      List of all detected hits.

    • Performs a sweep into the scene using a sphere and checks if it has hit anything. This can be significantly more efficient than other types of cast* calls.

      Parameters

      • sphere: Immutable<Sphere>

        Sphere to sweep through the scene.

      • unitDir: Immutable<Vector3>

        Unit direction towards which to perform the sweep.

      • Optionallayer: rsx.LayerMask

        Layers to consider for the query. This allows you to ignore certain groups of objects.

      • OptionalmaximumDistance: number

        Maximum distance at which to perform the query. Hits past this distance will not be detected.

      Returns boolean

      True if something was hit, false otherwise.

    • Returns a list of all colliders in the scene that overlap the provided sphere.

      Parameters

      • sphere: Immutable<Sphere>

        Sphere to check for overlap.

      • Optionallayer: rsx.LayerMask

        Layers to consider for the query. This allows you to ignore certain groups of objects.

      Returns Collider[]

      List of all colliders that overlap the sphere.

    • Checks if the provided sphere overlaps any other collider in the scene.

      Parameters

      • sphere: Immutable<Sphere>

        Sphere to check for overlap.

      • Optionallayer: rsx.LayerMask

        Layers to consider for the query. This allows you to ignore certain groups of objects.

      Returns boolean

      True if there is overlap with another object, false otherwise.