本文整理汇总了C++中ActorList::push_back方法的典型用法代码示例。如果您正苦于以下问题:C++ ActorList::push_back方法的具体用法?C++ ActorList::push_back怎么用?C++ ActorList::push_back使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ActorList
的用法示例。
在下文中一共展示了ActorList::push_back方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: doPress
void CreateTreeTool::doPress(int x, int y, int flags, float pressure) {
Vector3 from;
if (!m_view->traceWorld(x, y, from, SelectPart::All)) {
return;
}
m_actor = new SpeedTree();
m_view->getContext()->setSelection(m_actor);
m_actor->setProperty("tree", m_mapContext->getMapState()->treeFilename);
if (m_mapContext->getMapState()->isSnapToGrid) {
from = Internal::snap(from, m_mapContext->getMapState()->snapToGrid);
}
m_actor->bindToGame();
GroupHis* grouphis = new GroupHis(m_context, "Create SpeedTree");
ActorList actorlist;
actorlist.push_back(m_actor);
UndeleteHis* undelhis = new UndeleteHis(m_context, "Create SpeedTree", actorlist);
History* selhis = m_view->getContext()->setSelectionHistoried(actorlist);
grouphis->append(undelhis);
grouphis->append(selhis);
m_context->addHistory(grouphis);
doDrag(x, y, flags, pressure);
}
示例2: setValue
// ----------------------------------------------------------------------------
//
bool ActorSelectField::setValue( LPCSTR value ) {
CString key( value );
ActorList actors;
int curPos = 0;
while ( true ) {
CString resToken = key.Tokenize( _T(" ,"), curPos );
if ( resToken.IsEmpty() )
break;
resToken.MakeUpper();
ActorSelectField::EntryMap::iterator it = m_entries.find( resToken );
if ( it == m_entries.end() )
throw FieldException( "Invalid fixture number %s", (LPCSTR)resToken );
actors.push_back( (*it).second.m_actor );
}
if ( actors.size() == 0 )
throw FieldException( "Select at least one fixture" );
if ( actors.size() > 1 && !m_allow_multiple )
throw FieldException( "Select a single fixture" );
m_selected_actors = actors;
return InputField::setValue( value );
}
示例3: InputField
// ----------------------------------------------------------------------------
//
ActorSelectField::ActorSelectField( LPCSTR field_label, Venue* venue, bool include_groups ) :
InputField( field_label, "" ),
m_venue( venue ),
m_allow_multiple( true )
{
FixturePtrArray fixtures = venue->getFixtures();
ActorList actors;
for ( FixturePtrArray::iterator it=fixtures.begin(); it != fixtures.end(); ++it )
actors.push_back( SceneActor( (*it) ) );
if ( include_groups ) {
FixtureGroupPtrArray fixture_groups = m_venue->getFixtureGroups();
for ( FixtureGroupPtrArray:: iterator it=fixture_groups.begin(); it != fixture_groups.end(); ++it )
actors.push_back( SceneActor( venue, (*it) ) );
}
ActorPtrArray actor_ptrs;
for ( size_t i=0; i < actors.size(); i++)
actor_ptrs.push_back( &actors[i] );
init( actor_ptrs, UIDArray() );
}
示例4: createConvexMesh
/*
boost::shared_ptr<PhysicsMesh> createConvexMesh(const char *filename, IStorm3D_Model_Object *object)
{
boost::shared_ptr<PhysicsMesh> mesh(new PhysicsMesh());
MeshData data;
data.mesh = mesh;
data.object = object;
data.filename = filename;
meshList.push_back(data);
return mesh;
}
*/
boost::shared_ptr<PhysicsActor> createActor(boost::shared_ptr<PhysicsMesh> &mesh, const VC3 &position, const QUAT &rotation, const VC3 &velocity, const VC3 &angularVelocity, float mass, int collisionGroup, int soundGroup)
{
boost::shared_ptr<PhysicsActor> actor(new PhysicsActor(position, rotation));
physicsActorList.push_back(actor.get());
ActorData data;
data.actor = actor;
data.mesh = mesh;
data.velocity = velocity;
data.angularVelocity = angularVelocity;
data.mass = mass;
data.collisionGroup = collisionGroup;
data.soundGroup = soundGroup;
actorList.push_back(data);
return actor;
}