MCPcopy Create free account
hub / github.com/StrongPC123/Far-Cry-1-Source-Full / Draw

Method Draw

CryAnimation/AnimObject.cpp:111–144  ·  view source on GitHub ↗

/////////////////////////////////////////////////////////////////////

Source from the content-addressed store, hash-verified

109
110//////////////////////////////////////////////////////////////////////////
111void CAnimObject::Draw( const SRendParams &rp, const Vec3& t )
112{
113 SRendParams nodeRP = rp;
114 Matrix44 renderTM;
115 if (rp.pMatrix)
116 {
117 renderTM = *rp.pMatrix;
118 }
119 else
120 {
121 //renderTM.Identity();
122 //renderTM=GetTranslationMat(rp.vPos)*renderTM;
123 //renderTM=GetRotationZYX44(-gf_DEGTORAD*rp.vAngles )*renderTM; //NOTE: angles in radians and negated
124 //renderTM=GetScale33(Vec3(rp.fScale,rp.fScale,rp.fScale))*renderTM;
125
126 //OPTIMISED_BY_IVO
127 Matrix33diag diag = Vec3(rp.fScale,rp.fScale,rp.fScale); //use diag-matrix for scaling
128 Matrix34 rt34 = Matrix34::CreateRotationXYZ( Deg2Rad(rp.vAngles),rp.vPos ); //set rotation and translation in one function call
129 renderTM = rt34*diag; //optimised concatenation: m34*diag
130 renderTM=GetTransposed44(renderTM); //TODO: remove this after E3 and use Matrix34 instead of Matrix44
131 }
132 for (unsigned int i = 0; i < m_nodes.size(); i++)
133 {
134 Node *node = m_nodes[i];
135 if (node->m_object)
136 {
137 Matrix44 tm = GetNodeMatrix(node) * renderTM;
138 nodeRP.pMatrix = &tm;
139 nodeRP.dwFObjFlags |= FOB_TRANS_MASK;
140 m_nodes[i]->m_object->Render(nodeRP,Vec3(zero),0);
141 }
142 }
143 DrawBoundObjects( rp,renderTM,0 );
144}
145
146//////////////////////////////////////////////////////////////////////////
147//! Draw the character shadow volumes into the stencil buffer using a set of specified

Callers

nothing calls this directly

Calls 3

Deg2RadFunction · 0.85
sizeMethod · 0.45
RenderMethod · 0.45

Tested by

no test coverage detected