Skip to content
On this page

Class: Collider

WebSG.Collider

The Collider class represents a shape that can be used for collision detection in a physics simulation.

Table of contents

Constructors

Constructors

constructor

new Collider(props)

Creates a new Collider instance with the specified properties.

Example

ts
// Create a new box Collider
const collider = world.createCollider({
  type: ColliderType.Box,
  size: [1, 1, 1],
});

Parameters

NameTypeDescription
propsColliderPropsThe properties of the Collider.

Defined in

websg.d.ts:162