How to use the @cocos/cannon.PointToPointConstraint 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-point-to-point-constraint.ts View on Github external
constructor (first: CannonSharedBody, firstPivot: Vec3, second: CannonSharedBody, secondPivot: Vec3, options?: any) {
        super(new CANNON.PointToPointConstraint(
            first.body,
            Vec3.copy(new CANNON.Vec3(), firstPivot),
            second.body,
            Vec3.copy(new CANNON.Vec3(), secondPivot),
            options === undefined ? undefined : options.maxForce));
    }
}