/* Copyright (c) 2015 Alex Diener This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software. Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions: 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. 3. This notice may not be removed or altered from any source distribution. Alex Diener alex@ludobloom.com */ #include "collision/CollisionObject.h" #include #define stemobject_implementation CollisionObject stemobject_vtable_begin(); stemobject_vtable_entry(dispose); stemobject_vtable_entry(getShapeType); stemobject_vtable_entry(interpolate); stemobject_vtable_entry(isStationary); stemobject_vtable_entry(getCollisionBounds); stemobject_vtable_entry(setMasks); stemobject_vtable_end(); bool CollisionObject_init(CollisionObject * self, void * owner, CollisionObject_collisionCallback collisionCallback, CollisionObject_overlapCallback overlapCallback) { call_super(init, self); self->owner = owner; self->collisionCallback = collisionCallback; self->overlapCallback = overlapCallback; self->ownMask = 0x1; self->collidableMask = 0xFFFFFFFF; self->overlapMask = 0xFFFFFFFF; self->alwaysStatic = false; self->private_ivar(markedForRemoval) = false; self->private_ivar(unresolvable) = false; return true; } void CollisionObject_dispose(CollisionObject * self) { call_super(dispose, self); } CollisionObject_shapeType CollisionObject_getShapeType(CollisionObject * self) { return COLLISION_SHAPE_NONE; } void CollisionObject_interpolate(CollisionObject * self, fixed16_16 amount) { } bool CollisionObject_isStationary(CollisionObject * self) { return false; } Box6x CollisionObject_getCollisionBounds(CollisionObject * self) { return BOX6x(0x00000, 0x10000, 0x00000, 0x10000, 0x00000, 0x10000); } CollisionObject * CollisionObject_setMasks(CollisionObject * self, uint32_t ownMask, uint32_t collidableMask, uint32_t overlapMask) { self->ownMask = ownMask; self->collidableMask = collidableMask; self->overlapMask = overlapMask; return self; }