Leviathan  0.8.0.0
Leviathan game engine
Leviathan::PhysicalMaterial Class Reference

#include <PhysicalMaterial.h>

Public Member Functions

DLLEXPORT PhysicalMaterial (const std::string &name)
 
DLLEXPORT PhysicalMaterial (std::shared_ptr< ObjectFileObject > fileobject)
 
DLLEXPORT ~PhysicalMaterial ()
 
DLLEXPORT PhysMaterialDataPairFormPairWith (const PhysicalMaterial &other)
 
DLLEXPORT int GetMaterialIDIfLoaded (NewtonWorld *world)
 
DLLEXPORT std::string GetName () const
 

Detailed Description

Definition at line 104 of file PhysicalMaterial.h.

Constructor & Destructor Documentation

◆ PhysicalMaterial() [1/2]

DLLEXPORT Leviathan::PhysicalMaterial::PhysicalMaterial ( const std::string &  name)

Definition at line 9 of file PhysicalMaterial.cpp.

9  :
10  Name(name), EngineID(IDFactory::GetID())
11 {
12 }
static int GetID()
Definition: IDFactory.h:17

◆ PhysicalMaterial() [2/2]

DLLEXPORT Leviathan::PhysicalMaterial::PhysicalMaterial ( std::shared_ptr< ObjectFileObject fileobject)

Definition at line 14 of file PhysicalMaterial.cpp.

15  :
16  EngineID(IDFactory::GetID())
17 {
18  throw std::exception();
19 }
static int GetID()
Definition: IDFactory.h:17

◆ ~PhysicalMaterial()

DLLEXPORT Leviathan::PhysicalMaterial::~PhysicalMaterial ( )

Definition at line 21 of file PhysicalMaterial.cpp.

22 {
23  // Material ID cannot be removed unless the world is empty, so just let smart ptrs do
24  // their magic
25 }

Member Function Documentation

◆ FormPairWith()

DLLEXPORT PhysMaterialDataPair & Leviathan::PhysicalMaterial::FormPairWith ( const PhysicalMaterial other)

Definition at line 27 of file PhysicalMaterial.cpp.

29 {
30  InterractionVariables.push_back(std::make_shared<PhysMaterialDataPair>(other.Name));
31 
32  // Return last element in the list //
33  return *InterractionVariables.back().get();
34 }

◆ GetMaterialIDIfLoaded()

DLLEXPORT int Leviathan::PhysicalMaterial::GetMaterialIDIfLoaded ( NewtonWorld *  world)

Definition at line 36 of file PhysicalMaterial.cpp.

37 {
38  auto iter = NewtonWorldAndID.find(world);
39 
40  if(iter != NewtonWorldAndID.end()) {
41 
42  return iter->second;
43  }
44  // None loaded //
45  return -1;
46 }

◆ GetName()

DLLEXPORT std::string Leviathan::PhysicalMaterial::GetName ( ) const
inline

Definition at line 120 of file PhysicalMaterial.h.

121  {
122  return Name;
123  }

The documentation for this class was generated from the following files: