-
Notifications
You must be signed in to change notification settings - Fork 82
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding gizmos for projected decal and camera entities
- Loading branch information
1 parent
33a71d0
commit 48c6adc
Showing
4 changed files
with
75 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
DelvEdit/src/com/interrupt/dungeoneer/editor/gizmos/CameraGizmo.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package com.interrupt.dungeoneer.editor.gizmos; | ||
|
||
import com.badlogic.gdx.math.Frustum; | ||
import com.interrupt.dungeoneer.editor.ui.Handles; | ||
import com.interrupt.dungeoneer.entities.Camera; | ||
import com.interrupt.dungeoneer.entities.Entity; | ||
|
||
@GizmoFor(target = Camera.class) | ||
public class CameraGizmo extends EntityGizmo { | ||
@Override | ||
public void draw(Entity entity) { | ||
super.draw(entity); | ||
Camera camera = (Camera) entity; | ||
Frustum frustum = camera.getCamera().frustum; | ||
Handles.drawWireFrustum(frustum); | ||
} | ||
} |
25 changes: 25 additions & 0 deletions
25
DelvEdit/src/com/interrupt/dungeoneer/editor/gizmos/ProjectedDecalGizmo.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package com.interrupt.dungeoneer.editor.gizmos; | ||
|
||
import com.badlogic.gdx.graphics.Camera; | ||
import com.badlogic.gdx.math.Frustum; | ||
import com.interrupt.dungeoneer.editor.ui.Handles; | ||
import com.interrupt.dungeoneer.entities.Entity; | ||
import com.interrupt.dungeoneer.entities.ProjectedDecal; | ||
|
||
@GizmoFor(target = ProjectedDecal.class) | ||
public class ProjectedDecalGizmo extends EntityGizmo { | ||
@Override | ||
public void draw(Entity entity) { | ||
super.draw(entity); | ||
|
||
ProjectedDecal decal = (ProjectedDecal) entity; | ||
Camera camera = decal.perspective; | ||
|
||
if (camera == null) { | ||
return; | ||
} | ||
|
||
Frustum frustum = camera.frustum; | ||
Handles.drawWireFrustum(frustum); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters