Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
set material (mat: PhysicMaterial) {
if (mat == null) {
(this._shape!.material as unknown) = null;
} else {
if (CannonShape.idToMaterial[mat._uuid] == null) {
CannonShape.idToMaterial[mat._uuid] = new CANNON.Material(mat._uuid);
}
this._shape!.material = CannonShape.idToMaterial[mat._uuid];
this._shape!.material.friction = mat.friction;
this._shape!.material.restitution = mat.restitution;
}
}