Skip to main content

Physics.FixedConstraint

Class

Fully constrain rotation and translation.

  • 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 v164

Index

Example

// Create a constraint on an object
var fixedConstraint = hingeObj.createComponent(ConstraintComponent.getTypeName());

// Set up options on that constraint
fixedConstraint.debugDrawEnabled = true;
fixedConstraint.constraint = Physics.Constraint.create(Physics.ConstraintType.Fixed);

Extends

Properties

constraintType

readonly constraintType: ConstraintType

The type of constraint that is applied.

Since

Lens Scripting Version 164

Inherited from

Constraint.constraintType

Methods

create()

static create(type): Constraint

Create a constraint of the given type, with default settings.

Parameters

ParameterType
typeConstraintType

Returns

Constraint

Since

Lens Scripting Version 164

Inherited from

Constraint.create


getTypeName()

static getTypeName(): TypeName<FixedConstraint>

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<FixedConstraint>

Since

Lens Scripting Version 164

Overrides

Constraint.getTypeName


getTypeName()

getTypeName(): string

Returns the name of this object's type.

Returns

string

Inherited from

Constraint.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

Constraint.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

Constraint.isSame

See also

ConstraintComponent.