1) Removed ambient light.

2) Made all items 'not lighted' since they appear (without ambient lighting) very
   blocky.
3) Renamed 'isCollected' to collected (since isCollected sounds more like a boolean
   function returning if an item is collected or not).


git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/branches/irrlicht@3618 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
hikerstk
2009-06-19 00:02:17 +00:00
parent f6c37bd837
commit 8161ee32cc
6 changed files with 11 additions and 9 deletions

View File

@@ -44,10 +44,10 @@ BubbleGumItem::~BubbleGumItem()
* inactivates itself for 0.5 seconds, but disables the reappearing of
* the bubble gum.
*/
void BubbleGumItem::isCollected(float t)
void BubbleGumItem::collected(float t)
{
deactivate(0.5);
// Set the time till reappear to -1 seconds --> the item will
// reappear immediately.
Item::isCollected(-1);
Item::collected(-1);
} // isCollected

View File

@@ -36,7 +36,7 @@ public:
unsigned int item_id);
#endif
~BubbleGumItem ();
virtual void isCollected(float t);
virtual void collected(float t);
}
; // class Item

View File

@@ -29,7 +29,7 @@ Item::Item(ItemType type, const Vec3& xyz, const Vec3& normal,
scene::IMesh* mesh, unsigned int item_id, bool rotate)
{
m_rotate = rotate;
m_event_handler = NULL;
m_event_handler = NULL;
m_deactive_time = 0;
// Sets heading to 0, and sets pitch and roll depending on the normal. */
Vec3 hpr = Vec3(0, normal);
@@ -39,6 +39,9 @@ Item::Item(ItemType type, const Vec3& xyz, const Vec3& normal,
m_collected = false;
m_time_till_return = 0.0f; // not strictly necessary, see isCollected()
m_node = irr_driver->addMesh(mesh);
// If lighting would be enabled certain items (esp. bananas)
// don't look smooth, so for now generally disable lighting
m_node->setMaterialFlag(video::EMF_LIGHTING, false);
m_node->setPosition(xyz.toIrrVector());
m_node->grab();
} // Item
@@ -102,11 +105,11 @@ void Item::update(float delta)
* has been collected, and the time to return to the parameter.
* \param t Time till the object reappears (defaults to 2 seconds).
*/
void Item::isCollected(float t)
void Item::collected(float t)
{
m_collected = true;
// Note if the time is negative, in update the m_collected flag will
// be automatically set to false again.
m_time_till_return = t;
}
} // isCollected

View File

@@ -66,7 +66,7 @@ public:
bool rotate=true);
virtual ~Item ();
void update (float delta);
virtual void isCollected(float t=2.0f);
virtual void collected(float t=2.0f);
// ------------------------------------------------------------------------
/** Returns true if the Kart is close enough to hit this item, and

View File

@@ -168,7 +168,7 @@ Item* ItemManager::newItem(Item::ItemType type, const Vec3& xyz,
void ItemManager::collectedItem(int item_id, Kart *kart, int add_info)
{
Item *item=m_all_items[item_id];
item->isCollected();
item->collected();
kart->collectedItem(*item, add_info);
} // collectedItem

View File

@@ -1271,7 +1271,6 @@ void Track::loadTrackModel()
m_light = irr_driver->getSceneManager()->addLightSceneNode(0, sun_pos);
video::SLight light;
m_light->setLightData(light);
irr_driver->setAmbientLight(video::SColor(255, 255, 255, 255));
// Note: the physics world for irrlicht is created in loadMainTrack
createPhysicsModel();
if(user_config->m_track_debug)