*/
virtual void set_pos(const Vector& pos)
{
+ dest.move(pos-get_pos());
bbox.set_pos(pos);
}
+ /**
+ * sets the moving object's bbox to a specific width. Be careful when
+ * using this function. There are no collision detection checks performed
+ * here so bad things could happen.
+ */
+ virtual void set_width(float w)
+ {
+ dest.set_width(w);
+ bbox.set_width(w);
+ }
+
+ /**
+ * sets the moving object's bbox to a specific size. Be careful when
+ * using this function. There are no collision detection checks performed
+ * here so bad things could happen.
+ */
+ virtual void set_size(float w, float h)
+ {
+ dest.set_size(w, h);
+ bbox.set_size(w, h);
+ }
+
CollisionGroup get_group() const
{
return group;
CollisionGroup group;
private:
- // this is only here for internal collision detection use
+ /**
+ * this is only here for internal collision detection use (don't touch this
+ * from outside collision detection code)
+ *
+ * This field holds the currently anticipated destination of the object
+ * during collision detection
+ */
Rect dest;
};