How to use the @cocos/cannon.DistanceConstraint function in @cocos/cannon

To help you get started, we’ve selected a few @cocos/cannon examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github cocos-creator / engine / cocos / physics / cannon / constraint / cannon-distance-constraint.ts View on Github external
constructor (first: any, second: any, distance?: number, options?: IDistanceConstraintOptions) {
        super(new CANNON.DistanceConstraint(
            first.impl,
            second.impl,
            distance!,
            options === undefined ? undefined : options.maxForce));
    }
}
github cocos-creator / engine / cocos / physics / cannon / constraint / cannon-lock-constraint.ts View on Github external
constructor (first: CannonSharedBody, second: CannonSharedBody, distance?: number, options?: IDistanceConstraintOptions) {
        super(new CANNON.DistanceConstraint(
            first.body,
            second.body,
            distance!,
            options === undefined ? undefined : options.maxForce));
    }
}