Networking Overhaul: Modern packets, buffers, handshake, dispatch & security hardening
See Readme
This commit is contained in:
@@ -90,90 +90,6 @@ bool CGrannyModelInstance::Intersect(const D3DXMATRIX * c_pMatrix,
|
||||
|
||||
return true;
|
||||
|
||||
/*
|
||||
TBoundBox* boundBoxs = s_boundBoxPool.base();
|
||||
for (int i = 0; i < s_boundBoxPool.size(); ++i)
|
||||
{
|
||||
TBoundBox& rcurBoundBox=boundBoxs[i];
|
||||
|
||||
if (!IntersectBoundBox(c_pMatrix, rcurBoundBox, &u, &v, &t))
|
||||
continue;
|
||||
|
||||
granny_matrix_4x4* pgrnMatCompositeBuffer = GrannyGetWorldPoseComposite4x4Array(m_pgrnWorldPose);
|
||||
const CGrannyMesh* c_pMesh = m_pModel->GetMeshPointer(rcurBoundBox.meshIndex);
|
||||
const granny_mesh* c_pgrnMesh = c_pMesh->GetGrannyMeshPointer();
|
||||
|
||||
if (!GrannyMeshIsRigid(c_pgrnMesh))
|
||||
{
|
||||
//continue;
|
||||
ret = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
D3DXMATRIX matMesh;
|
||||
int* toBoneIndices = c_pMesh->GetBoneIndices();
|
||||
D3DXMatrixMultiply(&matMesh, (D3DXMATRIX*) pgrnMatCompositeBuffer[toBoneIndices[0]], c_pMatrix);
|
||||
|
||||
granny_tri_material_group* pgrnTriGroups = GrannyGetMeshTriangleGroups(c_pgrnMesh);
|
||||
int mtrlCount = c_pMesh->GetGrannyMeshPointer()->MaterialBindingCount;
|
||||
int vtxCount = GrannyGetMeshVertexCount(c_pgrnMesh);
|
||||
int groupCount = GrannyGetMeshTriangleGroupCount(c_pgrnMesh);
|
||||
|
||||
TIndex* modelIndices;
|
||||
TPNTVertex* modelVertices;
|
||||
|
||||
if (m_pModel->LockVertices((void**)&modelIndices, (void**)&modelVertices))
|
||||
{
|
||||
TIndex* meshIndices = modelIndices + c_pMesh->GetIndexBasePosition();
|
||||
TPNTVertex* meshVertices = modelVertices + c_pMesh->GetVertexBasePosition();
|
||||
|
||||
for (int i = 0; i < groupCount; ++i)
|
||||
{
|
||||
granny_tri_material_group& rgrnTriGroup = pgrnTriGroups[i];
|
||||
|
||||
if (rgrnTriGroup.MaterialIndex < 0 || rgrnTriGroup.MaterialIndex >= mtrlCount)
|
||||
continue;
|
||||
|
||||
if (IntersectMesh(&matMesh,
|
||||
meshVertices,
|
||||
sizeof(TPNTVertex),
|
||||
vtxCount,
|
||||
meshIndices,
|
||||
GrannyGetMeshIndexCount(c_pgrnMesh),
|
||||
ms_vtPickRayOrig,
|
||||
ms_vtPickRayDir,
|
||||
&u, &v, &t))
|
||||
{
|
||||
ret = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
m_pModel->UnlockVertices();
|
||||
}
|
||||
}
|
||||
|
||||
if (ret)
|
||||
{
|
||||
*pu = u;
|
||||
*pv = v;
|
||||
*pt = -t;
|
||||
|
||||
if (c_szModelName)
|
||||
{
|
||||
if (!strncmp(c_pgrnMesh->Name, c_szModelName, strlen(c_szModelName)))
|
||||
return ret;
|
||||
|
||||
ret = false;
|
||||
continue;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
return (ret);
|
||||
*/
|
||||
}
|
||||
|
||||
#include "EterBase/Timer.h"
|
||||
@@ -226,42 +142,3 @@ bool CGrannyModelInstance::GetMeshMatrixPointer(int iMesh, const D3DXMATRIX ** c
|
||||
return true;
|
||||
}
|
||||
|
||||
/*
|
||||
void CGraphicThingInstance::DrawBoundBox()
|
||||
{
|
||||
if (!mc_pMeshVector)
|
||||
return;
|
||||
|
||||
if (!m_pgrnWorldPose)
|
||||
return;
|
||||
|
||||
D3DXVECTOR3 vtMin;
|
||||
D3DXVECTOR3 vtMax;
|
||||
|
||||
SetDiffuseColor(0.0f, 1.0f, 0.0f);
|
||||
// 캐릭터 꽉차는 바운딩 박스
|
||||
//GetBoundBox(&vtMin, &vtMax);
|
||||
//DrawLineCube(vtMin.x, vtMin.y, vtMin.z, vtMax.x, vtMax.y, vtMax.z);
|
||||
//const CThing::TMeshVector& rmeshVector=mc_pModel->meshVector;
|
||||
ms_lpd3dMatStack->LoadMatrix(&m_Matrix);
|
||||
|
||||
for (size_t m=0; m<mc_pMeshVector->size(); ++m)
|
||||
{
|
||||
const CThing::TMesh& rmesh=mc_pMeshVector->at(m);
|
||||
|
||||
for (int b=0; b<rmesh.pgrnMesh->BoneBindingCount; ++b)
|
||||
{
|
||||
granny_bone_binding& rgrnBoneBinding=rmesh.pgrnMesh->BoneBindings[b];
|
||||
|
||||
int* toBoneIndices=GrannyGetMeshBindingToBoneIndices(rmesh.pgrnMeshBinding);
|
||||
|
||||
D3DXMATRIX* pmat=(D3DXMATRIX*)GrannyGetWorldPose4x4(m_pgrnWorldPose, toBoneIndices[b]);
|
||||
|
||||
D3DXVec3TransformCoord(&vtMin, &D3DXVECTOR3(rgrnBoneBinding.OBBMin), pmat);
|
||||
D3DXVec3TransformCoord(&vtMax, &D3DXVECTOR3(rgrnBoneBinding.OBBMax), pmat);
|
||||
|
||||
DrawLineCube(vtMin.x, vtMin.y, vtMin.z, vtMax.x, vtMax.y, vtMax.z);
|
||||
}
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user