WMO/Rendering: Difference between revisions
Jump to navigation
Jump to search
mNo edit summary |
|||
Line 28: | Line 28: | ||
World::TriData::nMatrices = 0; | World::TriData::nMatrices = 0; | ||
float | float hitT = 1.0; | ||
bool result; | bool result; | ||
result = CMapObjGroup::GetTris(group, seg, & | result = CMapObjGroup::GetTris(group, seg, &hitT, 0, 8, (int)&a2 + 3, 0); | ||
if (!result) { | if (!result) { | ||
Line 44: | Line 44: | ||
C3Vector point; | C3Vector point; | ||
point.x = seg->start.x + | point.x = seg->start.x + hitT * (seg->end.x - seg->start.x); | ||
point.y = seg->start.y + | point.y = seg->start.y + hitT * (seg->end.y - seg->start.y); | ||
point.z = seg->start.z + | point.z = seg->start.z + hitT * (seg->end.z - seg->start.z); | ||
unsigned __int16 v10 = word_CD8094; | unsigned __int16 v10 = word_CD8094; |
Revision as of 07:56, 4 October 2017
Lighting
CMapObj::QueryLighting
C3Vector
C3Segment
bool CMapObj::QueryLighting(CMapObj *this, unsigned int groupIndex, const C3Segment *seg, CImVector *color, bool *a5) {
bool v5 = this->unk6[16] == 0;
CMapObjGroup group = this->groupList[groupIndex];
if (v5 || !(group->unk14 & 1) || group->flags & (SMOGroup::EXTERIOR | SMOGroup::EXTERIOR_LIT)) {
return 0;
}
World::TriData::resultFlags = 0;
World::TriData::nBatches = 0;
World::TriData::nTriIndices = 0;
World::TriData::nVertexIndices = 0;
World::TriData::nMatrices = 0;
float hitT = 1.0;
bool result;
result = CMapObjGroup::GetTris(group, seg, &hitT, 0, 8, (int)&a2 + 3, 0);
if (!result) {
return 0;
}
// Obtain point matching intersection between segment and tri
C3Vector point;
point.x = seg->start.x + hitT * (seg->end.x - seg->start.x);
point.y = seg->start.y + hitT * (seg->end.y - seg->start.y);
point.z = seg->start.z + hitT * (seg->end.z - seg->start.z);
unsigned __int16 v10 = word_CD8094;
result = CMapObjGroup::QueryLighting(group, &point, v10, color, a5);
return result;
}