View Javadoc

1   /*
2    * To change this template, choose Tools | Templates
3    * and open the template in the editor.
4    */
5   
6   package cz.cuni.amis.pogamut.udk.t3dgenerator.elements.map;
7   
8   import cz.cuni.amis.pogamut.unreal.t3dgenerator.annotations.UnrealChild;
9   import cz.cuni.amis.pogamut.unreal.t3dgenerator.annotations.UnrealComponent;
10  import cz.cuni.amis.pogamut.unreal.t3dgenerator.datatypes.Vector3D;
11  import cz.cuni.amis.pogamut.unreal.t3dgenerator.datatypes.Rotation3D;
12  import cz.cuni.amis.pogamut.unreal.t3dgenerator.datatypes.StaticReference;
13  import cz.cuni.amis.pogamut.unreal.t3dgenerator.datatypes.UnrealReference;
14  import cz.cuni.amis.pogamut.udk.t3dgenerator.elements.AbstractActor;
15  
16  /**
17   * An instance of a Prefab.
18   * The T3D generator is unable to create prefabs with it's subojbects (this seems to be a limitation in T3D) 
19   * so this objects has no children.
20   * @author Martin Cerny
21   * @see <a href="http://wiki.beyondunreal.com/UE3:PrefabInstance_%28UDK%29">http://wiki.beyondunreal.com/UE3:PrefabInstance_%28UDK%29</a>
22   * @see <a href="http://forums.epicgames.com/threads/809530-T3D-Import-Export-working-strangely-with-Prefabs-Kismet">http://forums.epicgames.com/threads/809530-T3D-Import-Export-working-strangely-with-Prefabs-Kismet</a>
23   */
24  public class PrefabInstance extends AbstractActor {
25      private UnrealReference templatePrefab;
26  
27      @UnrealComponent
28      private PrefabSpriteComponent spriteComponent = new PrefabSpriteComponent();
29      
30      public PrefabInstance(String prefabName, Vector3D location) {
31          this(prefabName,location,new Rotation3D(0, 0, 0));
32      }
33  
34      public PrefabInstance(String prefabName, Vector3D location, Rotation3D rotation) {
35          super("PrefabInstance", "Engine.Default__PrefabInstance");
36          templatePrefab = new StaticReference("Prefab", prefabName);
37          setLocation(location);
38          setRotation(rotation);
39      }
40  
41      public UnrealReference getTemplatePrefab() {
42          return templatePrefab;
43      }
44  
45      public PrefabSpriteComponent getSpriteComponent() {
46          return spriteComponent;
47      }
48  
49  
50  
51  }