Clean up to the cross platform support in DirectX plugin.
This commit is contained in:
@@ -145,7 +145,7 @@ osg::Geode* ReaderWriterDirectX::convertFromDX(DX::Object& obj,
|
||||
*
|
||||
* - Polys are CW oriented
|
||||
*/
|
||||
std::vector<osg::Geometry*> geomList;
|
||||
vector<osg::Geometry*> geomList;
|
||||
|
||||
unsigned int i;
|
||||
for (i = 0; i < meshMaterial->material.size(); i++) {
|
||||
@@ -220,7 +220,12 @@ osg::Geode* ReaderWriterDirectX::convertFromDX(DX::Object& obj,
|
||||
geom->addPrimitiveSet(new osg::DrawArrayLengths(osg::PrimitiveSet::POLYGON));
|
||||
}
|
||||
|
||||
assert(mesh->faces.size() == meshMaterial->faceIndices.size());
|
||||
if (mesh->faces.size() != meshMaterial->faceIndices.size())
|
||||
{
|
||||
osg::notify(osg::FATAL)<<"Error: internal error in DirectX .x loader,"<<std::endl;
|
||||
osg::notify(osg::FATAL)<<" mesh->faces.size() == meshMaterial->faceIndices.size()"<<std::endl;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
// Add faces to Geometry
|
||||
for (i = 0; i < meshMaterial->faceIndices.size(); i++) {
|
||||
|
||||
@@ -24,6 +24,8 @@
|
||||
#ifndef _DIRECTX_H_
|
||||
#define _DIRECTX_H_
|
||||
|
||||
#include <osg/Math>
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <fstream>
|
||||
@@ -40,7 +42,7 @@ namespace DX {
|
||||
float x,y,z;
|
||||
|
||||
inline void normalize() {
|
||||
float lenRecip = 1.0f / (float) sqrt(x * x + y * y + z * z);
|
||||
float lenRecip = 1.0f / sqrtf(x * x + y * y + z * z);
|
||||
x *= lenRecip;
|
||||
y *= lenRecip;
|
||||
z *= lenRecip;
|
||||
|
||||
Reference in New Issue
Block a user