Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
// addContactMaterial (contactMaterial: ContactMaterial) {
// this._cannonWorld.addContactMaterial(contactMaterial._getImpl());
// }
addConstraint (constraint: CannonConstraint) {
this._world.addConstraint(constraint.impl);
}
removeConstraint (constraint: CannonConstraint) {
this._world.removeConstraint(constraint.impl);
}
}
const from = new CANNON.Vec3();
const to = new CANNON.Vec3();
function setupFromAndTo (worldRay: ray, distance: number) {
Vec3.copy(from, worldRay.o);
worldRay.computeHit(to, distance);
}
const raycastOpt: CANNON.IRaycastOptions = {
'checkCollisionResponse': false,
'collisionFilterGroup': -1,
'collisionFilterMask': -1,
'skipBackFaces': false
}
}
// addContactMaterial (contactMaterial: ContactMaterial) {
// this._cannonWorld.addContactMaterial(contactMaterial._getImpl());
// }
addConstraint (constraint: CannonConstraint) {
this._world.addConstraint(constraint.impl);
}
removeConstraint (constraint: CannonConstraint) {
this._world.removeConstraint(constraint.impl);
}
}
const from = new CANNON.Vec3();
const to = new CANNON.Vec3();
function setupFromAndTo (worldRay: ray, distance: number) {
Vec3.copy(from, worldRay.o);
worldRay.computeHit(to, distance);
}
const raycastOpt: CANNON.IRaycastOptions = {
'checkCollisionResponse': false,
'collisionFilterGroup': -1,
'collisionFilterMask': -1,
'skipBackFaces': false
}
}
const CollisionEventObject = {
type: 'onCollisionEnter' as ICollisionEventType,
selfCollider: null,
otherCollider: null,
// selfRigidBody: null,
// otherRigidBody: null,
contacts: [] as any,
};
const contactsPool = [] as any;
const _tCannonV1 = new CANNON.Vec3();
const _tCannonV2 = new CANNON.Vec3();
}
}
const CollisionEventObject = {
type: 'onCollisionEnter' as ICollisionEventType,
selfCollider: null,
otherCollider: null,
// selfRigidBody: null,
// otherRigidBody: null,
contacts: [] as any,
};
const contactsPool = [] as any;
const _tCannonV1 = new CANNON.Vec3();
const _tCannonV2 = new CANNON.Vec3();
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));
}
}