OpenGothic
Open source reimplementation of Gothic I and II
Loading...
Searching...
No Matches
physicmeshshape.cpp
Go to the documentation of this file.
1#include "physicmeshshape.h"
2
4#include "dynamicworld.h"
5
7 return frict;
8 }
9
11 uint32_t count = 0;
12 for(auto& i : packed.subMeshes)
13 if(!i.material.disable_collision && i.iboLength > 0) {
14 count++;
15 }
16 if(count == 0)
17 return nullptr;
18 return new PhysicMeshShape(std::move(packed));
19 }
20
22 :mesh(std::move(sPacked)), shape(&mesh, mesh.useQuantization(), true) {
23 for(auto& i:sPacked.subMeshes)
24 frict += DynamicWorld::materialFriction(i.material.group);
25 frict = frict/float(sPacked.subMeshes.size());
26 }
PhysicMeshShape(const PhysicMeshShape &)=delete
float friction() const
static PhysicMeshShape * load(PackedMesh &&packed)