mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-01 01:07:51 -04:00
add has_normals
This commit is contained in:
parent
fedbdb47cb
commit
fb79ed6314
@ -803,6 +803,27 @@ joint_has_primitives() const {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////
|
||||||
|
// Function: EggGroupNode::has_normals
|
||||||
|
// Access: Published, Virtual
|
||||||
|
// Description: Returns true if any of the primitives (e.g. polygons)
|
||||||
|
// defined within this group or below have either face
|
||||||
|
// or vertex normals defined, false otherwise.
|
||||||
|
////////////////////////////////////////////////////////////////////
|
||||||
|
bool EggGroupNode::
|
||||||
|
has_normals() const {
|
||||||
|
Children::const_iterator ci;
|
||||||
|
for (ci = _children.begin();
|
||||||
|
ci != _children.end();
|
||||||
|
++ci) {
|
||||||
|
if ((*ci)->has_normals()) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
// Function: EggGroupNode::update_under
|
// Function: EggGroupNode::update_under
|
||||||
// Access: Protected, Virtual
|
// Access: Protected, Virtual
|
||||||
|
@ -134,6 +134,7 @@ PUBLISHED:
|
|||||||
int remove_invalid_primitives();
|
int remove_invalid_primitives();
|
||||||
virtual bool has_primitives() const;
|
virtual bool has_primitives() const;
|
||||||
virtual bool joint_has_primitives() const;
|
virtual bool joint_has_primitives() const;
|
||||||
|
virtual bool has_normals() const;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual void update_under(int depth_offset);
|
virtual void update_under(int depth_offset);
|
||||||
|
@ -346,6 +346,18 @@ joint_has_primitives() const {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////
|
||||||
|
// Function: EggNode::has_normals
|
||||||
|
// Access: Published, Virtual
|
||||||
|
// Description: Returns true if any of the primitives (e.g. polygons)
|
||||||
|
// defined within this group or below have either face
|
||||||
|
// or vertex normals defined, false otherwise.
|
||||||
|
////////////////////////////////////////////////////////////////////
|
||||||
|
bool EggNode::
|
||||||
|
has_normals() const {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
// Function: EggNode::r_transform
|
// Function: EggNode::r_transform
|
||||||
|
@ -103,6 +103,7 @@ protected:
|
|||||||
virtual void adjust_under();
|
virtual void adjust_under();
|
||||||
virtual bool has_primitives() const;
|
virtual bool has_primitives() const;
|
||||||
virtual bool joint_has_primitives() const;
|
virtual bool joint_has_primitives() const;
|
||||||
|
virtual bool has_normals() const;
|
||||||
|
|
||||||
virtual void r_transform(const LMatrix4d &mat, const LMatrix4d &inv,
|
virtual void r_transform(const LMatrix4d &mat, const LMatrix4d &inv,
|
||||||
CoordinateSystem to_cs);
|
CoordinateSystem to_cs);
|
||||||
|
@ -356,6 +356,29 @@ joint_has_primitives() const {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////
|
||||||
|
// Function: EggPrimitive::has_normals
|
||||||
|
// Access: Published, Virtual
|
||||||
|
// Description: Returns true if any of the primitives (e.g. polygons)
|
||||||
|
// defined within this group or below have either face
|
||||||
|
// or vertex normals defined, false otherwise.
|
||||||
|
////////////////////////////////////////////////////////////////////
|
||||||
|
bool EggPrimitive::
|
||||||
|
has_normals() const {
|
||||||
|
if (has_normal()) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
const_iterator vi;
|
||||||
|
for (vi = begin(); vi != end(); ++vi) {
|
||||||
|
if ((*vi)->has_normal()) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
// Function: EggPrimitive::erase
|
// Function: EggPrimitive::erase
|
||||||
|
@ -102,6 +102,7 @@ PUBLISHED:
|
|||||||
void remove_nonunique_verts();
|
void remove_nonunique_verts();
|
||||||
virtual bool has_primitives() const;
|
virtual bool has_primitives() const;
|
||||||
virtual bool joint_has_primitives() const;
|
virtual bool joint_has_primitives() const;
|
||||||
|
virtual bool has_normals() const;
|
||||||
|
|
||||||
|
|
||||||
// The EggPrimitive itself appears to be an STL container of
|
// The EggPrimitive itself appears to be an STL container of
|
||||||
|
Loading…
x
Reference in New Issue
Block a user