Exemplo n.º 1
0
void ModelBody::RenderModel(Graphics::Renderer *r, const vector3d &viewCoords, const matrix4x4d &viewTransform)
{
    matrix4x4d m2 = GetInterpOrient();
    m2.SetTranslate(GetInterpPosition());
    matrix4x4d t = viewTransform * m2;
    glPushMatrix();				// Otherwise newmodels leave a dirty matrix
    matrix4x4f trans;
    for (int i=0; i<12; i++) trans[i] = float(t[i]);
    trans[12] = viewCoords.x;
    trans[13] = viewCoords.y;
    trans[14] = viewCoords.z;
    trans[15] = 1.0f;

    m_model->Render(trans);
    glPopMatrix();
}
Exemplo n.º 2
0
void ModelBody::RenderModel(Graphics::Renderer *r, const Camera *camera, const vector3d &viewCoords, const matrix4x4d &viewTransform, const bool setLighting)
{
	std::vector<Graphics::Light> oldLights;
	Color oldAmbient;
	if (setLighting)
		SetLighting(r, camera, oldLights, oldAmbient);

	matrix4x4d m2 = GetInterpOrient();
	m2.SetTranslate(GetInterpPosition());
	matrix4x4d t = viewTransform * m2;
	glPushMatrix();				// Otherwise newmodels leave a dirty matrix
	matrix4x4f trans;
	for (int i=0; i<12; i++) trans[i] = float(t[i]);
	trans[12] = viewCoords.x;
	trans[13] = viewCoords.y;
	trans[14] = viewCoords.z;
	trans[15] = 1.0f;

	m_model->Render(trans);
	glPopMatrix();

	if (setLighting)
		ResetLighting(r, oldLights, oldAmbient);
}
Exemplo n.º 3
0
matrix3x3d Body::GetInterpOrientRelTo(const Frame *relTo) const
{
	matrix3x3d forient = m_frame->GetInterpOrientRelTo(relTo);
	return forient * GetInterpOrient();
}