PeriDyno 1.0.0
Loading...
Searching...
No Matches
ContactsUnion.cpp
Go to the documentation of this file.
1#include "ContactsUnion.h"
2
3namespace dyno
4{
6
7 template<typename TDataType>
9 {
10 auto inDataA = this->inContactsA()->getDataPtr();
11 auto inDataB = this->inContactsB()->getDataPtr();
12
13 uint total_size = 0;
14 if (inDataA != nullptr)
15 total_size += inDataA->size();
16
17 if (inDataB != nullptr)
18 total_size += inDataB->size();
19
20 if (this->outContacts()->size() != total_size)
21 this->outContacts()->resize(total_size);
22
23 auto& outData = this->outContacts()->getData();
24
25 if (inDataA != nullptr)
26 outData.assign(*inDataA, inDataA->size());
27
28 if (inDataB != nullptr)
29 outData.assign(*inDataB, inDataB->size(), inDataA == nullptr ? 0 : inDataA->size(), 0);
30 }
31
32
33 template<typename TDataType>
35 {
36 bool ret = this->inContactsA()->isEmpty() && this->inContactsB()->isEmpty();
37 if (ret)
38 {
39 this->outContacts()->resize(0);
40 }
41 return !ret;
42 }
43
45}
#define DEFINE_CLASS(name)
Definition Object.h:140
#define IMPLEMENT_TCLASS(name, T1)
Definition Object.h:103
void compute() override
bool validateInputs() override
This is an implementation of AdditiveCCD based on peridyno.
Definition Array.h:25
unsigned int uint
Definition VkProgram.h:14