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#pragma once
4
5#include "BsPhysXPrerequisites.h"
6#include "Physics/BsPhysicsMaterial.h"
7#include "PxMaterial.h"
8
9namespace bs
10{
11 /** @addtogroup PhysX
12 * @{
13 */
14
15 /** PhysX implementation of a PhysicsMaterial. */
16 class PhysXMaterial : public PhysicsMaterial
17 {
18 public:
19 PhysXMaterial(physx::PxPhysics* physx, float staFric, float dynFriction, float restitution);
20 ~PhysXMaterial();
21
22 /** @copydoc PhysicsMaterial::setStaticFriction */
23 void setStaticFriction(float value) override;
24
25 /** @copydoc PhysicsMaterial::getStaticFriction */
26 float getStaticFriction() const override;
27
28 /** @copydoc PhysicsMaterial::setDynamicFriction */
29 void setDynamicFriction(float value) override;
30
31 /** @copydoc PhysicsMaterial::getDynamicFriction */
32 float getDynamicFriction() const override;
33
34 /** @copydoc PhysicsMaterial::setRestitutionCoefficient */
35 void setRestitutionCoefficient(float value) override;
36
37 /** @copydoc PhysicsMaterial::getRestitutionCoefficient */
38 float getRestitutionCoefficient() const override;
39
40 /** Returns the internal PhysX material. */
41 physx::PxMaterial* _getInternal() const { return mInternal; }
42
43 private:
44 physx::PxMaterial* mInternal;
45 };
46
47 /** @} */
48}