Skip to main content

SphereShape

Class

A sphere collision shape.

  • Available on all platforms
Platform details: Snapchat, SPECS, Camera Kit Web, Camera Kit Mobile fully supported.

Platform details

  • Snapchat — Fully supported.

  • SPECS — Fully supported.

  • Camera Kit Web — Fully supported.

  • Camera Kit Mobile — Fully supported.

Since Lens Scripting v157

Index

Extends

Properties

radius

radius: number

Local radius of the sphere.

Since

Lens Scripting Version 157

Default Value

6

Methods

createBoxShape()

static createBoxShape(): BoxShape

Create a BoxShape with default settings.

Returns

BoxShape

Since

Lens Scripting Version 157

Inherited from

Shape.createBoxShape


createCapsuleShape()

static createCapsuleShape(): CapsuleShape

Create a CapsuleShape with default settings.

Returns

CapsuleShape

Since

Lens Scripting Version 157

Inherited from

Shape.createCapsuleShape


createConeShape()

static createConeShape(): ConeShape

Create a ConeShape with default settings.

Returns

ConeShape

Since

Lens Scripting Version 169

Inherited from

Shape.createConeShape


createCylinderShape()

static createCylinderShape(): CylinderShape

Create a CylinderShape with default settings.

Returns

CylinderShape

Since

Lens Scripting Version 169

Inherited from

Shape.createCylinderShape


createLevelsetShape()

static createLevelsetShape(): LevelsetShape

Create a LevelsetShape with default settings.

Returns

LevelsetShape

Since

Lens Scripting Version 157

Inherited from

Shape.createLevelsetShape


createMeshShape()

static createMeshShape(): MeshShape

Creates a new MeshShape.

Returns

MeshShape

Since

Lens Scripting Version 181

Example

// Change gravity in the root world.
Physics.getRootWorldSettings().gravity = new vec3(0.0, -100.0, 0.0);

Inherited from

Shape.createMeshShape


createSphereShape()

static createSphereShape(): SphereShape

Create a SphereShape with default settings.

Returns

SphereShape

Since

Lens Scripting Version 157

Inherited from

Shape.createSphereShape


getTypeName()

static getTypeName(): TypeName<SphereShape>

Returns the fully-qualified JavaScript type name for this class (for example, "Component.Camera"). This is a static accessor (no instance required) and returns the same value as the instance getTypeName().

Returns

TypeName<SphereShape>

Since

Lens Scripting Version 157

Overrides

Shape.getTypeName


getTypeName()

getTypeName(): string

Returns the name of this object's type.

Returns

string

Inherited from

Shape.getTypeName


isOfType()

isOfType(type): boolean

Returns true if the object matches or derives from the passed in type.

Parameters

ParameterType
typestring

Returns

boolean

Inherited from

Shape.isOfType


isSame()

isSame(other): boolean

Returns true if this object is the same as other. Useful for checking if two references point to the same thing.

Parameters

ParameterType
otherScriptObject

Returns

boolean

Inherited from

Shape.isSame