current_world->addObject(new SceneObject(shader1, translate(vec3(-5.f, 3.f, 0.f)), vec4(3.0f, 3.f, 0.4f, 1.5f), "SkyBox.dae", "model_SkyBox_2D.png"));
//current_world->addObject(new EventBox(translate(vec3(3.f, .4f, 0.f)),EB_LOSTZONE));
- //current_world->addObject(new EventBox(translate(vec3(3.f, .4f, -15.f)), EB_WINZONE));
+ current_world->addObject(new EventBox(translate(vec3(3.f, .4f, -15.f)), EB_WINZONE));
}
SceneObject(Graphix::shader_BBox, _modelMat, vec4(0.f), Model::getBBoxModel(), ""),
eb_type(_EB_TYPE)
{
+ collide_group = COL_EVENT;
+ collide_with = COL_MARVIN;
+
+ btTransform btModelMat;
+ btModelMat.setFromOpenGLMatrix(value_ptr(modelMat));
+
+ btDefaultMotionState* MotionState =
+ new btDefaultMotionState(btModelMat);
+ btRigidBody::btRigidBodyConstructionInfo RigidBodyCI(0, MotionState, *model, btVector3(0, 0, 0));
+
+ bt_rigid_body = new btRigidBody(RigidBodyCI);
+
+ btTransform tmp;
+ tmp.setFromOpenGLMatrix(value_ptr(modelMat));
+ bt_collision_object->setWorldTransform(tmp);
}
SceneObject(_shader, _modelMat, vec4(7.0f, 0.7f, 1.0f, 3.0f), "Player.dae", "model_player_2D.png")
{
collide_group = COL_MARVIN;
- collide_with = COL_LEVEL | COL_ENEMY;
+ collide_with = COL_LEVEL | COL_ENEMY | COL_EVENT;
}
COL_LEVEL = BIT(0), //<Collide with LEVEL
COL_MARVIN = BIT(1), //<Collide with Marvin
COL_ENEMY = BIT(2), //<Collide with Enemies
- COL_KEY = BIT(3) //<Collide with Key's
+ COL_KEY = BIT(3), //<Collide with Key's
+ COL_EVENT = BIT(4)
};
//class string;