[DEV] add convex hull parsing
This commit is contained in:
parent
e95323e974
commit
d4dfe30d23
@ -109,7 +109,7 @@ class ImportEMF(bpy.types.Operator, ImportHelper):
|
|||||||
('-Y', "-Y Forward", ""),
|
('-Y', "-Y Forward", ""),
|
||||||
('-Z', "-Z Forward", ""),
|
('-Z', "-Z Forward", ""),
|
||||||
),
|
),
|
||||||
default='-Z',
|
default='-X',
|
||||||
)
|
)
|
||||||
|
|
||||||
axis_up = EnumProperty(
|
axis_up = EnumProperty(
|
||||||
@ -121,7 +121,7 @@ class ImportEMF(bpy.types.Operator, ImportHelper):
|
|||||||
('-Y', "-Y Up", ""),
|
('-Y', "-Y Up", ""),
|
||||||
('-Z', "-Z Up", ""),
|
('-Z', "-Z Up", ""),
|
||||||
),
|
),
|
||||||
default='Y',
|
default='Z',
|
||||||
)
|
)
|
||||||
|
|
||||||
def execute(self, context):
|
def execute(self, context):
|
||||||
|
@ -64,7 +64,7 @@ def out_quaternion_z_up( q ):
|
|||||||
return "%g %g %g %g" % ( q.w, q.x, q.y, q.z )
|
return "%g %g %g %g" % ( q.w, q.x, q.y, q.z )
|
||||||
|
|
||||||
|
|
||||||
def getPhysicsShape(obj, mainObjScale, use_y_up=True):
|
def getPhysicsShape(obj, mainObjScale, use_y_up=False):
|
||||||
shape = ""
|
shape = ""
|
||||||
props = { }
|
props = { }
|
||||||
name = obj.name.lower()
|
name = obj.name.lower()
|
||||||
|
2
external/ege
vendored
2
external/ege
vendored
@ -1 +1 @@
|
|||||||
Subproject commit eefbe48546e8f0b6f35de975d66e921b041d4dc7
|
Subproject commit 327367b1a73be036a447c1f0b5e43f3af43ca0c2
|
@ -16,11 +16,28 @@ bool ewol::PhysicsConvexHull::Parse(const char* _line)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if(0==strncmp(_line, "points : ", 8) ) {
|
if(0==strncmp(_line, "points : ", 8) ) {
|
||||||
EWOL_TODO("convex hull point parsing ...");
|
//EWOL_DEBUG("convex hull point parsing " << _line);
|
||||||
|
char* base = (char*)(&_line[8]);
|
||||||
|
char* tmp= strchr(base, '|');
|
||||||
|
vec3 pos(0,0,0);
|
||||||
|
while (tmp != NULL) {
|
||||||
|
*tmp = '\0';
|
||||||
|
sscanf(base, "%f %f %f", &pos.m_floats[0], &pos.m_floats[1], &pos.m_floats[2] );
|
||||||
|
m_points.PushBack(pos);
|
||||||
|
base = tmp+1;
|
||||||
|
tmp= strchr(base, '|');
|
||||||
|
}
|
||||||
|
sscanf(base, "%f %f %f", &pos.m_floats[0], &pos.m_floats[1], &pos.m_floats[2] );
|
||||||
|
m_points.PushBack(pos);
|
||||||
|
/*
|
||||||
|
for (int32_t iii=0; iii<m_points.Size(); iii++) {
|
||||||
|
EWOL_DEBUG(" parsed " << m_points[iii]);
|
||||||
|
}
|
||||||
|
*/
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if(0==strncmp(_line, "scale : ", 8) ) {
|
if(0==strncmp(_line, "scale : ", 8) ) {
|
||||||
sscanf(&_line[8], "%f", &m_scale );
|
sscanf(&_line[8], "%f %f %f", &m_scale.m_floats[0], &m_scale.m_floats[1], &m_scale.m_floats[2] );
|
||||||
EWOL_DEBUG(" scale=" << m_scale);
|
EWOL_DEBUG(" scale=" << m_scale);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -32,13 +32,8 @@ namespace ewol
|
|||||||
vec3 GetScale(void) const { return m_scale; };
|
vec3 GetScale(void) const { return m_scale; };
|
||||||
private:
|
private:
|
||||||
etk::Vector<vec3> m_points;
|
etk::Vector<vec3> m_points;
|
||||||
/*
|
public:
|
||||||
mesh = obj.to_mesh( bpy.context.scene, True, 'PREVIEW' )
|
const etk::Vector<vec3>& GetPointList(void) const { return m_points; };
|
||||||
props["points"] = ""
|
|
||||||
for v in mesh.vertices:
|
|
||||||
props["points"] += "" + out_point3( v.co ) + "|"
|
|
||||||
props["points"] = props["points"].rstrip("|")
|
|
||||||
*/
|
|
||||||
public:
|
public:
|
||||||
virtual const PhysicsConvexHull* ToConvexHull(void) const { return this; };
|
virtual const PhysicsConvexHull* ToConvexHull(void) const { return this; };
|
||||||
virtual PhysicsConvexHull* ToConvexHull(void) { return this; };
|
virtual PhysicsConvexHull* ToConvexHull(void) { return this; };
|
||||||
|
Loading…
x
Reference in New Issue
Block a user