DB/Light: Difference between revisions

From wowdev
Jump to navigation Jump to search
Line 25: Line 25:




For the record, the convertion above translates doesnt translate light into world coordinates(the ones that are used in wow net protocol). Considering x is 0 at index in pos field, y is at index 1 and z is at index 2, the correct formulas would be     
For the record, the convertion above translates doesnt translate light into world coordinates(the ones that are used in wow net protocol). Considering x is at index 0 in pos field, y is at index 1 and z is at index 2, the correct formulas would be     
  pos.x = 17066.666 - pos.z / 36.0f;
  pos.x = 17066.666 - pos.z / 36.0f;
  pos.y = 17066.666 - pos.x / 36.0f;  
  pos.y = 17066.666 - pos.x / 36.0f;  

Revision as of 11:27, 8 February 2017

This is the starting file for what controls the lights, fogs, sky color, water color, and well other similar items. This information prior to 1.9 used to be stored in the .LIT files but in 1.9 was moved to Light.dbc and the other Light DBC files.

Structure

Column 	Field 		Type 		Notes
1 	ID		Integer 	
2 	iRefID_Map	Integer 	
3 	position	Float[3]
6 	falloffStart 	Float		If you are within the inner radius there shouldn't be any interpolation with other lights.
7 	falloffEnd 	Float		If you are outside the inner radius but inside the outer radius then this light can be interpolated with other lights.
8 	Sky & Fog	Integer 	standard -- These entries are all IDs in LightParams.dbc. (and in LightIntBand.dbc, LightFloatBand.dbc?)
9 	Water Settings 	Integer		standard underwater -- The different columns are for different settings. Water, death etc.
10 	SunsetParams 	Integer		stormy
11 	OtherParams 	Integer		stormy underwater
12 	DeathParams	Integer		death
13 	Unknown 	Integer		Only set for some entries in DeathknightStart, Northrend and NexusRaid. They have other values too!
14 	Unknown 	Integer		These may be for different phases.
15 	Unknown 	Integer		

LightRec::ConvertDBToGameCoords()

pos.x = 17066.666 - pos.x / 36.0f;
pos.y = 17066.666 - pos.y / 36.0f; 
pos.z = pos.z / 36.0f;
falloffStart = falloffStart / 36.0f;
falloffEnd = falloffEnd / 36.0f;


For the record, the convertion above translates doesnt translate light into world coordinates(the ones that are used in wow net protocol). Considering x is at index 0 in pos field, y is at index 1 and z is at index 2, the correct formulas would be

pos.x = 17066.666 - pos.z / 36.0f;
pos.y = 17066.666 - pos.x / 36.0f; 
pos.z = pos.y / 36.0f;

6.0.1.18179

struct LightRec {
  uint32_t m_ID;
  foreign_key<uint32_t, &MapRec::m_ID> m_continentID;
  float m_x; // (0,0,0) = global light, used as fallback if in no other light. If there is no (0,0,0) entry for a continent, use m_ID == 1 as fallback
  float m_y;
  float m_z;
  float m_falloffStart;
  float m_falloffEnd;
  enum {
    params_standard,
    params_standard_underwater,
    params_stormy,
    params_stormy_underwater,
    params_death,
    params_unk_5,
    params_unk_6,
    params_unk_7,
    params_num,
  };
  foreign_key<uint32_t, &LightParamsRec::m_ID> m_lightParamsID[params_num];
};