FT collision part1: AABB.
This commit is contained in:
1 parent
17f11bd428
commit
2d6f2c14e5
26 files changed
+132
-113
No files matched your search
@@ -33,15 +33,10 @@ TEdgeSegment* TEdgeSegment::install_wall(float* floatArr, TCollisionComponent* c
|
||||
center.Y = floatArr[2];
|
||||
auto radius = offset + floatArr[3];
|
||||
auto circle = new TCircle(collComp, activeFlagPtr, collisionGroup, ¢er, radius);
|
||||
edge = circle;
|
||||
|
||||
if (circle)
|
||||
{
|
||||
circle->WallValue = reinterpret_cast<void*>(wallValue);
|
||||
circle->place_in_grid();
|
||||
}
|
||||
|
||||
circle->WallValue = reinterpret_cast<void*>(wallValue);
|
||||
circle->place_in_grid(&collComp->AABB);
|
||||
collComp->EdgeList.push_back(circle);
|
||||
edge = circle;
|
||||
break;
|
||||
}
|
||||
case wall_type::Line:
|
||||
@@ -51,15 +46,11 @@ TEdgeSegment* TEdgeSegment::install_wall(float* floatArr, TCollisionComponent* c
|
||||
end.X = floatArr[3];
|
||||
end.Y = floatArr[4];
|
||||
auto line = new TLine(collComp, activeFlagPtr, collisionGroup, start, end);
|
||||
line->WallValue = reinterpret_cast<void*>(wallValue);
|
||||
line->Offset(offset);
|
||||
line->place_in_grid(&collComp->AABB);
|
||||
collComp->EdgeList.push_back(line);
|
||||
edge = line;
|
||||
|
||||
if (line)
|
||||
{
|
||||
line->WallValue = reinterpret_cast<void*>(wallValue);
|
||||
line->Offset(offset);
|
||||
line->place_in_grid();
|
||||
collComp->EdgeList.push_back(line);
|
||||
}
|
||||
break;
|
||||
}
|
||||
default:
|
||||
@@ -99,13 +90,9 @@ TEdgeSegment* TEdgeSegment::install_wall(float* floatArr, TCollisionComponent* c
|
||||
{
|
||||
float radius = offset * 1.001f;
|
||||
auto circle = new TCircle(collComp, activeFlagPtr, collisionGroup, ¢er, radius);
|
||||
|
||||
if (circle)
|
||||
{
|
||||
circle->WallValue = reinterpret_cast<void*>(wallValue);
|
||||
circle->place_in_grid();
|
||||
collComp->EdgeList.push_back(circle);
|
||||
}
|
||||
circle->WallValue = reinterpret_cast<void*>(wallValue);
|
||||
circle->place_in_grid(&collComp->AABB);
|
||||
collComp->EdgeList.push_back(circle);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -114,16 +101,12 @@ TEdgeSegment* TEdgeSegment::install_wall(float* floatArr, TCollisionComponent* c
|
||||
end.X = floatArrPtr[2];
|
||||
end.Y = floatArrPtr[3];
|
||||
auto line = new TLine(collComp, activeFlagPtr, collisionGroup, start, end);
|
||||
line->WallValue = reinterpret_cast<void*>(wallValue);
|
||||
line->Offset(offset);
|
||||
line->place_in_grid(&collComp->AABB);
|
||||
collComp->EdgeList.push_back(line);
|
||||
|
||||
edge = line;
|
||||
|
||||
if (line)
|
||||
{
|
||||
line->WallValue = reinterpret_cast<void*>(wallValue);
|
||||
line->Offset(offset);
|
||||
line->place_in_grid();
|
||||
collComp->EdgeList.push_back(line);
|
||||
}
|
||||
|
||||
prevCenter = center;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user