Hi Jorrit,

Thursday, September 14, 2006, 8:49:57 PM, you wrote:

> What about AddLeavesMesh? Is that handling the clip flags correctly?

here are the Add* methods, the problem is actually most visible with
branch mesh. I really have no idea what might be wrong...

void ttoSpeedTreeMeshObject::AddBillboardMesh (int clip_portal, int clip_plane,
                                               int clip_z_plane,iRenderView* 
rview,
                                               const csReversibleTransform 
&o2wt,
                                               const csVector3& wo, size_t i)
{
  bool rmCreated;
  csRenderMesh*& meshPtr = rmHolder.GetUnusedMesh (rmCreated,
    rview->GetCurrentFrameNumber ());

  meshPtr->mixmode = CS_FX_MESH;
  meshPtr->z_buf_mode = CS_ZBUF_USE;
  meshPtr->clip_portal = clip_portal;
  meshPtr->clip_plane = clip_plane;
  meshPtr->clip_z_plane = clip_z_plane;
  meshPtr->do_mirror = !rview->GetCamera ()->IsMirrored ();
  meshPtr->meshtype = CS_MESHTYPE_QUADS;
  meshPtr->indexstart = 0;
  meshPtr->indexend = 4;        
  meshPtr->material = factory->billboard_mat;
  meshPtr->worldspace_origin = wo;
  if (rmCreated)
  {
    meshPtr->variablecontext = variableContext;
  }
  meshPtr->buffers = factory->billboard_buffer_holder;
  meshPtr->geometryInstance = (void*)factory;
  csReversibleTransform trans = o2wt;

  meshPtr->object2world = o2wt;

  rmeshes[i] = meshPtr;
}

void ttoSpeedTreeMeshObject::AddBranchMesh (int clip_portal, int clip_plane, 
int clip_z_plane,
                                            iRenderView* rview, 
                                            const csReversibleTransform &o2wt,
                                            const csVector3& wo, size_t i)
{
  bool rmCreated;
  csRenderMesh*& meshPtr = rmHolder.GetUnusedMesh (rmCreated,
    rview->GetCurrentFrameNumber ());

  meshPtr->mixmode = CS_FX_MESH;
  meshPtr->z_buf_mode = CS_ZBUF_USE;
  meshPtr->clip_portal = clip_portal;
  meshPtr->clip_plane = clip_plane;
  meshPtr->clip_z_plane = clip_z_plane;
  meshPtr->do_mirror = rview->GetCamera ()->IsMirrored ();
  meshPtr->meshtype = CS_MESHTYPE_TRIANGLESTRIP;
  meshPtr->indexstart = 0;
  meshPtr->indexend = branches_indices_cnt;     
  meshPtr->material = factory->branch_mat;
  meshPtr->worldspace_origin = wo;
  if (rmCreated)
  {
    meshPtr->variablecontext = variableContext;
  }
  meshPtr->buffers = branch_buffer_holder;
  meshPtr->geometryInstance = (void*)factory;
  meshPtr->object2world = o2wt;

  rmeshes[i] = meshPtr;
}

void ttoSpeedTreeMeshObject::AddFrondsMesh (int clip_portal, int clip_plane, 
int clip_z_plane, 
                                            iRenderView* rview, 
                                            const csReversibleTransform &o2wt,
                                            const csVector3& wo, size_t i)
{
  bool rmCreated;
  csRenderMesh*& meshPtr = rmHolder.GetUnusedMesh (rmCreated,
    rview->GetCurrentFrameNumber ());

  meshPtr->mixmode = CS_FX_MESH;
  meshPtr->z_buf_mode = CS_ZBUF_USE;
  meshPtr->clip_portal = clip_portal;
  meshPtr->clip_plane = clip_plane;
  meshPtr->clip_z_plane = clip_z_plane;
  meshPtr->do_mirror = rview->GetCamera ()->IsMirrored ();
  meshPtr->meshtype = CS_MESHTYPE_TRIANGLESTRIP;
  meshPtr->indexstart = 0;
  meshPtr->indexend = fronds_indices_cnt;
  meshPtr->material = factory->fronds_mat; 
  meshPtr->worldspace_origin = wo;
  if (rmCreated)
  {
    meshPtr->variablecontext = variableContext;
  }
  meshPtr->buffers = fronds_buffer_holder;
  meshPtr->geometryInstance = (void*)factory;
  meshPtr->object2world = o2wt;

  rmeshes[i] = meshPtr;
}

void ttoSpeedTreeMeshObject::AddLeavesMesh (int clip_portal, int clip_plane, 
int clip_z_plane, 
                                            iRenderView* rview, 
                                            const csReversibleTransform &o2wt,
                                            const csVector3& wo, size_t i)
{
  bool rmCreated;
  csRenderMesh*& meshPtr = rmHolder.GetUnusedMesh (rmCreated,
    rview->GetCurrentFrameNumber ());

  meshPtr->mixmode = CS_FX_MESH;
  meshPtr->z_buf_mode = CS_ZBUF_USE;
  meshPtr->clip_portal = clip_portal;
  meshPtr->clip_plane = clip_plane;
  meshPtr->clip_z_plane = clip_z_plane;
  meshPtr->indexstart = 0;
  meshPtr->indexend = leaves_indices_cnt;
  meshPtr->do_mirror = !rview->GetCamera ()->IsMirrored ();
  meshPtr->meshtype = CS_MESHTYPE_QUADS;        
  meshPtr->material = factory->leaves_mat; 
  meshPtr->worldspace_origin = wo;
  if (rmCreated)
  {
    meshPtr->variablecontext = variableContext;
  }
  meshPtr->buffers = leaves_buffer_holder;
  meshPtr->geometryInstance = (void*)factory;
  meshPtr->object2world = o2wt;


  rmeshes[i] = meshPtr;
}

-- 
greetings,
 Piotr Obrzut                           mailto:[EMAIL PROTECTED]


-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Crystal-main mailing list
Crystal-main@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/crystal-main
Unsubscribe: mailto:[EMAIL PROTECTED]

Reply via email to