Advertisement
Codeblocks

PhysicsMaterial.cpp

Aug 9th, 2016
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.66 KB | None | 0 0
  1. #include "PhysicsMaterial.h"
  2. #include "Leadwerks.h"
  3.  
  4. namespace Leadwerks {
  5.     /*Static: DeletePhysicsMaterial*/
  6.     static void DeletePhysicsMaterial(Material* mat) {
  7.         delete GetPhysicsFromMaterial(mat);
  8.     }
  9.  
  10.     PhysicsMaterial::PhysicsMaterial(Material* mat) {
  11.         mat->SetUserData((void*)this);
  12.         mat->AddHook(Object::DeleteHook, DeletePhysicsMaterial);
  13.         if (mat->GetPath() == "") {
  14.             surfaceProperty = "default";
  15.         }
  16.         else {
  17.             surfaceProperty = Util::GetKeyValueFromFile(mat->GetPath(), "surfaceprop");
  18.         }
  19.     }
  20.  
  21.     std::string PhysicsMaterial::GetSurfaceProperty() {
  22.         if (surfaceProperty != "") {
  23.             return surfaceProperty;
  24.         }
  25.         return "default";
  26.     }
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement