Path: blob/master/thirdparty/jolt_physics/Jolt/Physics/Collision/PhysicsMaterialSimple.h
9912 views
// Jolt Physics Library (https://github.com/jrouwe/JoltPhysics)1// SPDX-FileCopyrightText: 2021 Jorrit Rouwe2// SPDX-License-Identifier: MIT34#pragma once56#include <Jolt/Physics/Collision/PhysicsMaterial.h>78JPH_NAMESPACE_BEGIN910/// Sample implementation of PhysicsMaterial that just holds the needed properties directly11class JPH_EXPORT PhysicsMaterialSimple : public PhysicsMaterial12{13JPH_DECLARE_SERIALIZABLE_VIRTUAL(JPH_EXPORT, PhysicsMaterialSimple)1415public:16/// Constructor17PhysicsMaterialSimple() = default;18PhysicsMaterialSimple(const string_view &inName, ColorArg inColor) : mDebugName(inName), mDebugColor(inColor) { }1920// Properties21virtual const char * GetDebugName() const override { return mDebugName.c_str(); }22virtual Color GetDebugColor() const override { return mDebugColor; }2324// See: PhysicsMaterial::SaveBinaryState25virtual void SaveBinaryState(StreamOut &inStream) const override;2627protected:28// See: PhysicsMaterial::RestoreBinaryState29virtual void RestoreBinaryState(StreamIn &inStream) override;3031private:32String mDebugName; ///< Name of the material, used for debugging purposes33Color mDebugColor = Color::sGrey; ///< Color of the material, used to render the shapes34};3536JPH_NAMESPACE_END373839