Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #ifndef PHYSMAT_H
- #define PHYSMAT_H
- #pragma once
- #include "Libraries/Util.h"
- #include <string>
- namespace Leadwerks {
- class Material;
- class PhysicsMaterial {
- public:
- PhysicsMaterial(Material* mat);
- std::string GetSurfaceProperty();
- private:
- std::string surfaceProperty;
- };
- inline PhysicsMaterial* GetPhysicsFromMaterial(Material* mat) {
- if (mat->GetUserData() == NULL) {
- new PhysicsMaterial(mat); //HACK!! I know this makes it so when we retrieve the physics material it'll now generate the surface property, but this is at a slight performance hit... sort of improper, could be avoided with a material-was-created hook.
- }
- return static_cast<PhysicsMaterial*>(mat->GetUserData());
- }
- }
- #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement