| 1 | //************************************ bs::framework - Copyright 2018 Marko Pintera **************************************// |
|---|---|
| 2 | //*********** Licensed under the MIT license. See LICENSE.md for full terms. This notice is not to be removed. ***********// |
| 3 | #include "BsPhysXMaterial.h" |
| 4 | #include "PxPhysics.h" |
| 5 | |
| 6 | namespace bs |
| 7 | { |
| 8 | PhysXMaterial::PhysXMaterial(physx::PxPhysics* physx, float staFric, float dynFriction, float restitution) |
| 9 | :mInternal(nullptr) |
| 10 | { |
| 11 | mInternal = physx->createMaterial(staFric, dynFriction, restitution); |
| 12 | } |
| 13 | |
| 14 | PhysXMaterial::~PhysXMaterial() |
| 15 | { |
| 16 | mInternal->release(); |
| 17 | } |
| 18 | |
| 19 | void PhysXMaterial::setStaticFriction(float value) |
| 20 | { |
| 21 | mInternal->setStaticFriction(value); |
| 22 | } |
| 23 | |
| 24 | float PhysXMaterial::getStaticFriction() const |
| 25 | { |
| 26 | return mInternal->getStaticFriction(); |
| 27 | } |
| 28 | |
| 29 | void PhysXMaterial::setDynamicFriction(float value) |
| 30 | { |
| 31 | mInternal->setDynamicFriction(value); |
| 32 | } |
| 33 | |
| 34 | float PhysXMaterial::getDynamicFriction() const |
| 35 | { |
| 36 | return mInternal->getDynamicFriction(); |
| 37 | } |
| 38 | |
| 39 | void PhysXMaterial::setRestitutionCoefficient(float value) |
| 40 | { |
| 41 | mInternal->setRestitution(value); |
| 42 | } |
| 43 | |
| 44 | float PhysXMaterial::getRestitutionCoefficient() const |
| 45 | { |
| 46 | return mInternal->getRestitution(); |
| 47 | } |
| 48 | } |