Go Back   EQEmulator Home > EQEmulator Forums > General > General::General Discussion

General::General Discussion General discussion about EverQuest(tm), EQEMu, and related topics.
Do not post support topics here.

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #5  
Old 11-24-2010, 02:55 PM
Derision
Developer
 
Join Date: Feb 2004
Location: UK
Posts: 1,540
Default

The code in azone2 might help you out.

The placeable object locations are defined in Type 0x15 fragments in the .wld. The relevant code that processes them is in utils\azone2\wld.cpp ...
Code:
FRAG_CONSTRUCTOR(Data15) {
  struct_Data15 *hdr = (struct_Data15 *) buf;
  Placeable *plac = new Placeable;
  Placeable **pl;

  plac->x = hdr->trans[0];
  plac->y = hdr->trans[1];
  plac->z = hdr->trans[2];

  plac->rx = hdr->rot[2] / 512.f * 360.f;
  plac->ry = hdr->rot[1] / 512.f * 360.f;
  plac->rz = hdr->rot[0] / 512.f * 360.f;

  plac->scale[0] = hdr->scale[2];
  plac->scale[1] = hdr->scale[1];
  plac->scale[2] = hdr->scale[1];

  plac->model = (int) &wld->sHash[-(int)hdr->ref]; // Object name, e.g. LADDER20_ACTORDEF

  pl = new Placeable *[wld->model_data.plac_count + 1];
  memcpy(pl, wld->model_data.placeable, sizeof(Placeable *) * wld->model_data.plac_count);
  if(wld->model_data.plac_count)
    delete[] wld->model_data.placeable;
  pl[wld->model_data.plac_count] = plac;
  wld->model_data.placeable = pl;
  ++wld->model_data.plac_count;
}
As you can see, the type 0x15 fragment contains the location, rotation, scale and also the name of the object model.

The actual mesh for the object is defined in a type 0x36 fragment, so if you look in wld.cpp, under the code for FRAG_CONSTRUCTOR(Data36), you will see that the mesh is also
assigned a name:
Code:
model->name = (char *) &wld->sHash[-frag_name];
So to draw the placeable objects, you need to iterate through the list of 0x15 fragments, use the model name in the 0x15 fragment to find the mesh/polygons for that object
in the list of 0x36 fragments, and then apply the translation/rotation/scale values in the 0x15 fragment to each polygon.

void QTBuilder::AddPlaceable(... in utils\azone2\azone.cpp has the code to apply the transformations in the correct order.

The ladder and gate models that you highlight in your video are these two (output from azone2):
Code:
Processing azone.ini for placeable models.
azone.ini entry found for this zone. Including 2 models.
Including Placeable Object   17 using model   15 (MISTGATE_DMSPRITEDEF).
Including Placeable Object   18 using model   15 (MISTGATE_DMSPRITEDEF).
Including Placeable Object   77 using model   13 (LADDER20_DMSPRITEDEF).
Including Placeable Object   78 using model   13 (LADDER20_DMSPRITEDEF).
Reply With Quote
 

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

   

All times are GMT -4. The time now is 06:05 PM.


 

Everquest is a registered trademark of Daybreak Game Company LLC.
EQEmulator is not associated or affiliated in any way with Daybreak Game Company LLC.
Except where otherwise noted, this site is licensed under a Creative Commons License.
       
Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3