Skip to content

Commit cc4e163

Browse files
authored
[src] Add USofaComponent classes architecture to use UActorComponent instead of UActor for each SOFA component (#30)
* backup investigation work * unactive message handler. Too unstable for now * Add more safe guard on memory corruption or double free * use better conversion from std string to FString, seems much more stable * avoid reusing any UE component in several call, even if it should be a copy. To avoid potential problem of memory free * small potential fix * start work adding different SOFA component but this time as actor components * backup work on SofaNode * Remove USofaComponent for now, too unstable * Improve component parsing in DAGNode * small potential fix * restore SofaActorComponent creation * Use component type as main info to be displayed
1 parent 0b37cb1 commit cc4e163

22 files changed

Lines changed: 736 additions & 48 deletions
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
// Fill out your copyright notice in the Description page of Project Settings.
2+
3+
4+
#include "Components/SofaCollisionModel.h"
5+
6+
// Sets default values for this component's properties
7+
USofaCollisionModel::USofaCollisionModel()
8+
{
9+
// Set this component to be initialized when the game starts, and to be ticked every frame. You can turn these features
10+
// off to improve performance if you don't need them.
11+
PrimaryComponentTick.bCanEverTick = true;
12+
13+
// ...
14+
}
15+
16+
17+
// Called when the game starts
18+
void USofaCollisionModel::BeginPlay()
19+
{
20+
Super::BeginPlay();
21+
22+
// ...
23+
24+
}
25+
26+
27+
// Called every frame
28+
void USofaCollisionModel::TickComponent(float DeltaTime, ELevelTick TickType, FActorComponentTickFunction* ThisTickFunction)
29+
{
30+
Super::TickComponent(DeltaTime, TickType, ThisTickFunction);
31+
32+
// ...
33+
}
34+
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
// Fill out your copyright notice in the Description page of Project Settings.
2+
3+
4+
#include "Components/SofaComponent.h"
5+
6+
// Sets default values for this component's properties
7+
USofaComponent::USofaComponent()
8+
{
9+
// Set this component to be initialized when the game starts, and to be ticked every frame. You can turn these features
10+
// off to improve performance if you don't need them.
11+
PrimaryComponentTick.bCanEverTick = true;
12+
13+
// ...
14+
}
15+
16+
17+
// Called when the game starts
18+
void USofaComponent::BeginPlay()
19+
{
20+
Super::BeginPlay();
21+
22+
}
23+
24+
25+
// Called every frame
26+
void USofaComponent::TickComponent(float DeltaTime, ELevelTick TickType, FActorComponentTickFunction* ThisTickFunction)
27+
{
28+
Super::TickComponent(DeltaTime, TickType, ThisTickFunction);
29+
}
30+
31+
void USofaComponent::setComponentType(const FString& type)
32+
{
33+
m_baseType = type;
34+
//RootComponent = CreateDefaultSubobject<USceneComponent>(*m_baseType);
35+
}
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
// Fill out your copyright notice in the Description page of Project Settings.
2+
3+
4+
#include "Components/SofaConstraint.h"
5+
6+
// Sets default values for this component's properties
7+
USofaConstraint::USofaConstraint()
8+
{
9+
// Set this component to be initialized when the game starts, and to be ticked every frame. You can turn these features
10+
// off to improve performance if you don't need them.
11+
PrimaryComponentTick.bCanEverTick = true;
12+
13+
// ...
14+
}
15+
16+
17+
// Called when the game starts
18+
void USofaConstraint::BeginPlay()
19+
{
20+
Super::BeginPlay();
21+
22+
// ...
23+
24+
}
25+
26+
27+
// Called every frame
28+
void USofaConstraint::TickComponent(float DeltaTime, ELevelTick TickType, FActorComponentTickFunction* ThisTickFunction)
29+
{
30+
Super::TickComponent(DeltaTime, TickType, ThisTickFunction);
31+
32+
// ...
33+
}
34+
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
// Fill out your copyright notice in the Description page of Project Settings.
2+
3+
4+
#include "Components/SofaFEMForceField.h"
5+
6+
// Sets default values for this component's properties
7+
USofaFEMForceField::USofaFEMForceField()
8+
{
9+
// Set this component to be initialized when the game starts, and to be ticked every frame. You can turn these features
10+
// off to improve performance if you don't need them.
11+
PrimaryComponentTick.bCanEverTick = true;
12+
13+
// ...
14+
}
15+
16+
17+
// Called when the game starts
18+
void USofaFEMForceField::BeginPlay()
19+
{
20+
Super::BeginPlay();
21+
22+
// ...
23+
24+
}
25+
26+
27+
// Called every frame
28+
void USofaFEMForceField::TickComponent(float DeltaTime, ELevelTick TickType, FActorComponentTickFunction* ThisTickFunction)
29+
{
30+
Super::TickComponent(DeltaTime, TickType, ThisTickFunction);
31+
32+
// ...
33+
}
34+
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
// Fill out your copyright notice in the Description page of Project Settings.
2+
3+
4+
#include "Components/SofaForceField.h"
5+
6+
// Sets default values for this component's properties
7+
USofaForceField::USofaForceField()
8+
{
9+
// Set this component to be initialized when the game starts, and to be ticked every frame. You can turn these features
10+
// off to improve performance if you don't need them.
11+
PrimaryComponentTick.bCanEverTick = true;
12+
13+
// ...
14+
}
15+
16+
17+
// Called when the game starts
18+
void USofaForceField::BeginPlay()
19+
{
20+
Super::BeginPlay();
21+
22+
// ...
23+
24+
}
25+
26+
27+
// Called every frame
28+
void USofaForceField::TickComponent(float DeltaTime, ELevelTick TickType, FActorComponentTickFunction* ThisTickFunction)
29+
{
30+
Super::TickComponent(DeltaTime, TickType, ThisTickFunction);
31+
32+
// ...
33+
}
34+
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
// Fill out your copyright notice in the Description page of Project Settings.
2+
3+
4+
#include "Components/SofaLoader.h"
5+
6+
// Sets default values for this component's properties
7+
USofaLoader::USofaLoader()
8+
{
9+
// Set this component to be initialized when the game starts, and to be ticked every frame. You can turn these features
10+
// off to improve performance if you don't need them.
11+
PrimaryComponentTick.bCanEverTick = true;
12+
13+
// ...
14+
}
15+
16+
17+
// Called when the game starts
18+
void USofaLoader::BeginPlay()
19+
{
20+
Super::BeginPlay();
21+
22+
// ...
23+
24+
}
25+
26+
27+
// Called every frame
28+
void USofaLoader::TickComponent(float DeltaTime, ELevelTick TickType, FActorComponentTickFunction* ThisTickFunction)
29+
{
30+
Super::TickComponent(DeltaTime, TickType, ThisTickFunction);
31+
32+
// ...
33+
}
34+
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
// Fill out your copyright notice in the Description page of Project Settings.
2+
3+
4+
#include "Components/SofaMapping.h"
5+
6+
// Sets default values for this component's properties
7+
USofaMapping::USofaMapping()
8+
{
9+
// Set this component to be initialized when the game starts, and to be ticked every frame. You can turn these features
10+
// off to improve performance if you don't need them.
11+
PrimaryComponentTick.bCanEverTick = true;
12+
13+
// ...
14+
}
15+
16+
17+
// Called when the game starts
18+
void USofaMapping::BeginPlay()
19+
{
20+
Super::BeginPlay();
21+
22+
// ...
23+
24+
}
25+
26+
27+
// Called every frame
28+
void USofaMapping::TickComponent(float DeltaTime, ELevelTick TickType, FActorComponentTickFunction* ThisTickFunction)
29+
{
30+
Super::TickComponent(DeltaTime, TickType, ThisTickFunction);
31+
32+
// ...
33+
}
34+
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
// Fill out your copyright notice in the Description page of Project Settings.
2+
3+
4+
#include "Components/SofaMass.h"
5+
6+
// Sets default values for this component's properties
7+
USofaMass::USofaMass()
8+
{
9+
// Set this component to be initialized when the game starts, and to be ticked every frame. You can turn these features
10+
// off to improve performance if you don't need them.
11+
PrimaryComponentTick.bCanEverTick = true;
12+
13+
// ...
14+
}
15+
16+
17+
// Called when the game starts
18+
void USofaMass::BeginPlay()
19+
{
20+
Super::BeginPlay();
21+
22+
// ...
23+
24+
}
25+
26+
27+
// Called every frame
28+
void USofaMass::TickComponent(float DeltaTime, ELevelTick TickType, FActorComponentTickFunction* ThisTickFunction)
29+
{
30+
Super::TickComponent(DeltaTime, TickType, ThisTickFunction);
31+
32+
// ...
33+
}
34+
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
// Fill out your copyright notice in the Description page of Project Settings.
2+
3+
4+
#include "Components/SofaMesh.h"
5+
6+
// Sets default values for this component's properties
7+
USofaMesh::USofaMesh()
8+
{
9+
// Set this component to be initialized when the game starts, and to be ticked every frame. You can turn these features
10+
// off to improve performance if you don't need them.
11+
PrimaryComponentTick.bCanEverTick = true;
12+
13+
// ...
14+
}
15+
16+
17+
// Called when the game starts
18+
void USofaMesh::BeginPlay()
19+
{
20+
Super::BeginPlay();
21+
22+
// ...
23+
24+
}
25+
26+
27+
// Called every frame
28+
void USofaMesh::TickComponent(float DeltaTime, ELevelTick TickType, FActorComponentTickFunction* ThisTickFunction)
29+
{
30+
Super::TickComponent(DeltaTime, TickType, ThisTickFunction);
31+
32+
// ...
33+
}
34+
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
// Fill out your copyright notice in the Description page of Project Settings.
2+
3+
4+
#include "Components/SofaSolver.h"
5+
6+
// Sets default values for this component's properties
7+
USofaSolver::USofaSolver()
8+
{
9+
// Set this component to be initialized when the game starts, and to be ticked every frame. You can turn these features
10+
// off to improve performance if you don't need them.
11+
PrimaryComponentTick.bCanEverTick = true;
12+
13+
// ...
14+
}
15+
16+
17+
// Called when the game starts
18+
void USofaSolver::BeginPlay()
19+
{
20+
Super::BeginPlay();
21+
22+
// ...
23+
24+
}
25+
26+
27+
// Called every frame
28+
void USofaSolver::TickComponent(float DeltaTime, ELevelTick TickType, FActorComponentTickFunction* ThisTickFunction)
29+
{
30+
Super::TickComponent(DeltaTime, TickType, ThisTickFunction);
31+
32+
// ...
33+
}
34+

0 commit comments

Comments
 (0)