Skip to content

Commit 89917e2

Browse files
committed
FreeviewComponent.setTarget and FreeviewComponent.setTargetSmooth with Entity as target
1 parent 3c1dc2f commit 89917e2

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

src/dagon/ui/freeview.d

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,13 +200,24 @@ class FreeviewComponent: EntityComponent
200200
void setTarget(Vector3f pos)
201201
{
202202
target = pos;
203-
smoothTarget = pos;
203+
smoothTarget = target;
204204
}
205205

206206
void setTargetSmooth(Vector3f pos)
207207
{
208208
target = pos;
209209
}
210+
211+
void setTarget(Entity e)
212+
{
213+
target = e.positionAbsolute;
214+
smoothTarget = target;
215+
}
216+
217+
void setTargetSmooth(Entity e)
218+
{
219+
target = e.positionAbsolute;
220+
}
210221

211222
void translateTarget(Vector3f pos)
212223
{

0 commit comments

Comments
 (0)