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.UnrealComponent;
9   import cz.cuni.amis.pogamut.unreal.t3dgenerator.annotations.UnrealProperty;
10  import cz.cuni.amis.pogamut.unreal.t3dgenerator.datatypes.Vector3D;
11  import cz.cuni.amis.pogamut.udk.t3dgenerator.elements.AbstractActor;
12  
13  /**
14   * A simple static mesh.
15   * @author Martin Cerny
16   * @see <a href="http://wiki.beyondunreal.com/UE3:StaticMeshActor_(UDK)">http://wiki.beyondunreal.com/UE3:StaticMeshActor_(UDK)</a>
17   */
18  public class StaticMeshActor extends AbstractActor {
19      /**
20       * Class name in unreal
21       */
22      public static final String CLASSNAME = "StaticMeshActor";
23  
24      @UnrealProperty
25      @UnrealComponent
26      private StaticMeshComponent staticMeshComponent;
27  
28      public StaticMeshActor(String meshName, Vector3D location){
29          this(new StaticMeshComponent(meshName),location);
30      }
31      
32      public StaticMeshActor(StaticMeshComponent meshComponent, Vector3D location) {
33          super(CLASSNAME);
34          init(location, meshComponent);
35      }
36  
37      
38      public StaticMeshActor(String archetypeName, StaticMeshComponent meshComponent, Vector3D location) {
39          super(CLASSNAME, archetypeName);
40          init(location, meshComponent);
41      }
42  
43      private void init(Vector3D location, StaticMeshComponent meshComponent) {
44          setLocation(location);
45          staticMeshComponent = meshComponent;
46          setCollisionComponent(meshComponent);
47      }
48  
49      public StaticMeshComponent getStaticMeshComponent() {
50          return staticMeshComponent;
51      }
52  
53  
54  
55  }