-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrbrs_Destroy.asv
36 lines (32 loc) · 1.17 KB
/
rbrs_Destroy.asv
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
function [ ObjectsCoords, generatedObjects ] = rbrs_Destroy(ObjectsCoords, generatedObjects)%codegen
global border projectile
limit=length(ObjectsCoords);
i=2;
if(limit>2)
while i<=limit
n=[0 1 0]/norm([0 1 0]);
if(checkObjectSidePlane([border.X(1,1) border.Y(1,1) border.Z(1,1)],...
[ObjectsCoords(i).X(1,1), ObjectsCoords(i).Y(1,1), ObjectsCoords(i).Z(1,1)],n))
[ObjectsCoords, generatedObjects] = removeElementByIndex( ObjectsCoords, generatedObjects, i );
limit=limit-1;
% if ObjectsCoords(i).X ~= zeros(length(ObjectsCoords(i).X))
% generatedObjects = generatedObjects - 1;
% if(i==1)
% ObjectsCoords=ObjectsCoords(2:limit);
% elseif i==limit
% ObjectsCoords=ObjectsCoords(1:limit-1);
% else
% temp1=ObjectsCoords(i+1:limit);
% ObjectsCoords=ObjectsCoords(1:i-1);
% ObjectsCoords(i:limit-1)=temp1;
% end
% limit=limit-1;
% end
end
i=i+1;
end
end
for i=1:length(projectile)
if(checkObjectSidePlane(
end
end