* BnacLog.java: changed logger class from org.apache.log4j.Logger to
[bnac-common.git] / src / cl.uchile.dcc.bnac / Door.java
blob4dac6ea9243eca949d6e9a69e03ca0832f89b880
1 /*
2 * bnac : virtual museum environment creation/manipulation project
3 * Copyright (C) 2010 Felipe CaƱas Sabat
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, either version 3 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
19 package cl.uchile.dcc.bnac;
21 import javax.vecmath.Point2f;
22 import javax.vecmath.Point3f;
24 public class Door
26 protected String id;
27 protected Point2f dims;
28 protected Point2f pos;
29 /** Angle, in radians. */
30 protected float angle;
31 protected float scale;
33 public Door (String id)
35 this(id, new Point2f(1.4f, 2.5f), new Point2f(0.7f, 1.25f),
36 0.0f, 1.0f);
39 public Door (String id, Point2f dims, Point2f pos,
40 float a, float s)
42 BnacLog.trace("new Door %s, %.02fx%.02f," +
43 " @(%.02f,%.02f), ang %.02f, sca %.02f",
44 id, dims.x, dims.y, pos.x, pos.y, Math.toDegrees(a), s);
45 this.id = id;
46 this.dims = new Point2f(dims);
47 this.pos = new Point2f(pos);
48 angle = a;
49 scale = s;
52 public void setDimensions (float w, float h) { dims.set(w, h); }
53 public void setPosition (float x, float y) { pos.set(x, y); }
54 public Point2f getDimensions () { return dims; }
55 public Point2f getPosition () { return pos; }
56 public Point3f getPosition3f ()
58 return new Point3f(pos.x, pos.y, 0.0f);
60 public void setAngle (float angle) { this.angle = angle; }
61 public float getAngle () { return angle; }
62 public void setScale (float scale) { this.scale = scale; }
63 public float getScale () { return scale; }
65 public String getId () { return id; }