Panda3D
Functions
eggUtilities.I File Reference

PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University. More...

#include "eggGroup.h"
#include "eggPrimitive.h"
#include "eggVertexPool.h"
#include <algorithm>

Go to the source code of this file.

Functions

template<class FunctionObject >
void split_vertex (EggVertex *vert, const FunctionObject &sequence)
 Splits a vertex into two or more vertices, each an exact copy of the original and in the same vertex pool. More...
 

Detailed Description

PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.

All rights reserved.

All use of this software is subject to the terms of the revised BSD license. You should have received a copy of this license along with this source code in a file named "LICENSE."

Author
drose
Date
1999-02-10

Definition in file eggUtilities.I.

Function Documentation

◆ split_vertex()

template<class FunctionObject >
void split_vertex ( EggVertex vert,
const FunctionObject &  sequence 
)

Splits a vertex into two or more vertices, each an exact copy of the original and in the same vertex pool.

The splitting is based on some arbitrary property of the primitives that own the vertex. In the extreme, each primitive may get a different copy of the vertex, although it is also possible for some primitives to still share vertices.

This decision is made based on the function object 'sequence'. This object must define the following function:

int operator () (const EggPrimitive *prim) const;

This function returns a sequence number, which determines which primitives will share which vertices. The sequence number 0 refers to the original vertex pointer; other sequence numbers indicate new vertices. Other than that, the sequence number is totally arbitrary. Primitives for which the sequence number is the same will end up sharing the same copy of the vertex.

Definition at line 43 of file eggUtilities.I.

References EggVertexPool::add_vertex(), EggVertex::get_pool(), EggGroup::get_vertex_membership(), EggVertex::gref_begin(), EggVertex::gref_end(), EggVertex::pref_begin(), EggVertex::pref_end(), EggVertex::pref_size(), EggGroup::ref_vertex(), and ReferenceCount::test_ref_count_integrity().