本文整理汇总了C++中GetModel函数的典型用法代码示例。如果您正苦于以下问题:C++ GetModel函数的具体用法?C++ GetModel怎么用?C++ GetModel使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了GetModel函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetModel
//-----------------------------------------------------------------------------
// implements these so ragdolls can handle frustum culling & leaf visibility
//-----------------------------------------------------------------------------
void C_DynamicProp::GetRenderBounds( Vector& theMins, Vector& theMaxs )
{
if ( m_bUseHitboxesForRenderBox )
{
if ( GetModel() )
{
studiohdr_t *pStudioHdr = modelinfo->GetStudiomodel( GetModel() );
if ( !pStudioHdr || GetSequence() == -1 )
{
theMins = vec3_origin;
theMaxs = vec3_origin;
return;
}
// Only recompute if it's a new frame
if ( gpGlobals->framecount != m_iCachedFrameCount )
{
ComputeEntitySpaceHitboxSurroundingBox( &m_vecCachedRenderMins, &m_vecCachedRenderMaxs );
m_iCachedFrameCount = gpGlobals->framecount;
}
theMins = m_vecCachedRenderMins;
theMaxs = m_vecCachedRenderMaxs;
return;
}
}
BaseClass::GetRenderBounds( theMins, theMaxs );
}
示例2:
void setup1_qm::UpdateAtomFlags(void)
{
for (iter_al it1 = GetModel()->GetAtomsBegin();it1 != GetModel()->GetAtomsEnd();it1++)
{
(* it1).flags |= ATOMFLAG_IS_QM_ATOM;
}
}
示例3: FindEnvironment
void CSamplingInfEngine::
FindEnvironment( intVecVector *chlds )
{
const CGraph *pGraph = m_pGraphicalModel->GetGraph();
int i;
if( GetModel()->GetModelType() != mtBNet )
{
int nnodes;
nnodes = GetModel()->GetNumberOfNodes();
chlds->resize( nnodes );
const CMNet* pMNet = static_cast<const CMNet*>( m_pGraphicalModel );
for( i = 0; i < nnodes; i++ )
{
pMNet->GetClqsNumsForNode( i, &(*chlds)[i] );
}
}
else
{
intVector ndsForSampling;
GetNdsForSampling( &ndsForSampling );
chlds->resize( ndsForSampling.size() );
for( i = 0; i < ndsForSampling.size(); i++ )
{
pGraph->GetChildren( ndsForSampling[i], &(*chlds)[i] );
(*chlds)[i].push_back( ndsForSampling[i]) ;
}
}
}
示例4: GetModel
void CAht::UpdateModelProperty( int id )
{
// プロパティの参照データを更新する
//
int i;
int target;
int a;
AHTMODEL *model;
AHTMODEL *m;
AHTPROP *p;
AHTPROP *p2;
char *res;
CStrNote note;
char *list;
char tmp[256];
model = GetModel( id );
if ( model == NULL ) return;
target = id;
for(i=0;i<model->GetPropCount();i++) {
p = model->GetProperty( i );
switch( p->ahttype ) {
case AHTTYPE_PARTS_INT:
res = p->newval;
if ( res == NULL ) {
list = SearchModelByClassName( p->defval2 );
note.Select( list );
note.GetLine( tmp, 0, 255 );
p->SetNewVal( tmp );
}
target = p->GetValueInt();
break;
case AHTTYPE_PARTS_PROP_STRING:
a = target;if ( *p->defval3 == 'm' ) a = id; // 自分を参照するオプション
m = GetModel( a );
if ( m != NULL ) {
p2 = m->GetProperty( p->defval2 );
//Alertf( "%d:%d:%s:%s:%x",i,a,p->defval, p->defval2,p2 );
if ( p2 != NULL ) {
res = p2->GetValue();
p->SetNewVal( res );
}
}
break;
case AHTTYPE_PARTS_OPT_STRING:
a = target;if ( *p->defval3 == 'm' ) a = id; // 自分を参照するオプション
m = GetModel( a );
if ( m != NULL ) {
res = m->GetAHTOption( p->defval2 );
if ( res != NULL ) {
p->SetNewVal( res );
}
}
break;
default:
break;
}
}
}
示例5: GetStore
void DataModelListCtrl::Fill()
{
#if USE_DATALISTVIEW
GetStore()->Reset(GetItemCount());
#else
SetItemCount(GetModel() ? GetModel()->GetRowCount() : 0);
Refresh();
#endif
}
示例6: GetModel
void Ship::Render(Graphics::Renderer *renderer, const Camera *camera, const vector3d &viewCoords, const matrix4x4d &viewTransform)
{
if (IsDead()) return;
m_shipFlavour.ApplyTo(GetModel());
//angthrust negated, for some reason
GetModel()->SetThrust(vector3f(m_thrusters), -vector3f(m_angThrusters));
if (m_landingGearAnimation)
m_landingGearAnimation->SetProgress(m_wheelState);
//strncpy(params.pText[0], GetLabel().c_str(), sizeof(params.pText));
RenderModel(renderer, viewCoords, viewTransform);
// draw shield recharge bubble
if (m_stats.shield_mass_left < m_stats.shield_mass) {
const float shield = 0.01f*GetPercentShields();
renderer->SetBlendMode(Graphics::BLEND_ADDITIVE);
glPushMatrix();
matrix4x4f trans = matrix4x4f::Identity();
trans.Translate(viewCoords.x, viewCoords.y, viewCoords.z);
trans.Scale(GetPhysRadius());
renderer->SetTransform(trans);
//fade based on strength
Sfx::shieldEffect->GetMaterial()->diffuse =
Color((1.0f-shield),shield,0.0,0.33f*(1.0f-shield));
Sfx::shieldEffect->Draw(renderer);
glPopMatrix();
renderer->SetBlendMode(Graphics::BLEND_SOLID);
}
if (m_ecmRecharge > 0.0f) {
// ECM effect: a cloud of particles for a sparkly effect
vector3f v[100];
for (int i=0; i<100; i++) {
const double r1 = Pi::rng.Double()-0.5;
const double r2 = Pi::rng.Double()-0.5;
const double r3 = Pi::rng.Double()-0.5;
v[i] = vector3f(viewTransform * (
GetPosition() + GetPhysRadius() *
vector3d(r1, r2, r3).Normalized()
));
}
Color c(0.5,0.5,1.0,1.0);
float totalRechargeTime = GetECMRechargeTime();
if (totalRechargeTime >= 0.0f) {
c.a = m_ecmRecharge / totalRechargeTime;
}
Sfx::ecmParticle->diffuse = c;
renderer->SetBlendMode(Graphics::BLEND_ALPHA_ONE);
renderer->DrawPointSprites(100, v, Sfx::ecmParticle, 50.f);
}
}
示例7: wxCHECK_RET
void wxDataViewCtrl::AddChildren(wxDataViewItem const& parentItem)
{
int noOfChildren;
wxDataViewItemArray items;
wxCHECK_RET(GetModel() != NULL,"Model pointer not initialized.");
noOfChildren = GetModel()->GetChildren(parentItem,items);
(void) GetModel()->ItemsAdded(parentItem,items);
}
示例8: DynamicBody
Ship::Ship(const ShipType::Id &shipId): DynamicBody(),
m_flightState(FLYING),
m_alertState(ALERT_NONE),
m_controller(0),
m_thrusterFuel(1.0),
m_reserveFuel(0.0),
m_landingGearAnimation(nullptr)
{
Properties().Set("flightState", EnumStrings::GetString("ShipFlightState", m_flightState));
Properties().Set("alertStatus", EnumStrings::GetString("ShipAlertStatus", m_alertState));
m_lastAlertUpdate = 0.0;
m_lastFiringAlert = 0.0;
m_shipNear = false;
m_shipFiring = false;
m_testLanded = false;
m_launchLockTimeout = 0;
m_wheelTransition = 0;
m_wheelState = 0;
m_dockedWith = nullptr;
m_dockedWithPort = 0;
SetShipId(shipId);
m_thrusters.x = m_thrusters.y = m_thrusters.z = 0;
m_angThrusters.x = m_angThrusters.y = m_angThrusters.z = 0;
InitEquipSet();
m_hyperspace.countdown = 0;
m_hyperspace.now = false;
for (int i=0; i<ShipType::GUNMOUNT_MAX; i++) {
m_gun[i].state = 0;
m_gun[i].recharge = 0;
m_gun[i].temperature = 0;
}
m_ecmRecharge = 0;
m_shieldCooldown = 0.0f;
m_curAICmd = 0;
m_aiMessage = AIERROR_NONE;
m_decelerating = false;
SetModel(m_type->modelName.c_str());
SetLabel("UNLABELED_SHIP");
m_skin.SetRandomColors(Pi::rng);
m_skin.SetDecal(m_type->manufacturer);
m_skin.Apply(GetModel());
if(GetModel()->SupportsPatterns())
GetModel()->SetPattern(Pi::rng.Int32(0, GetModel()->GetNumPatterns()-1));
Init();
SetController(new ShipController());
}
示例9: Settings_Reset
void Settings_Reset()
{
settings.remoteExtendingDisabled = FALSE;
if ( GetModel() == TF5800 && GetModel() == TF5810t || GetModel() == TF5800t )
{
settings.mheg = TRUE;
}
else
{
settings.mheg = FALSE;
}
settings.quickAspectBlocker = FALSE;
}
示例10: GetModel
void CGibbsSamplingInfEngine::Initialization()
{
int nFactors = GetModel()->GetNumberOfFactors();
pFactorVector *currentFactors = GetCurrentFactors();
currentFactors->resize(nFactors);
int i;
for( i = 0; i < nFactors; i++ )
{
(*currentFactors)[i] = GetModel()->GetFactor(i);
}
}
示例11: GetModel
bool CSamplingInfEngine::CheckIsAllNdsTab() const
{
const CStaticGraphicalModel *pGrModel = GetModel();
int nnodes = pGrModel->GetNumberOfNodes();
const CModelDomain *pMD = GetModel()->GetModelDomain();
int i;
for( i = 0; i < nnodes; i++ )
{
if(! pMD->GetVariableType(i)->IsDiscrete())
{
return false;
}
}
return true;
}
示例12: rand
void SpaceStation::InitStation()
{
m_adjacentCity = 0;
for(int i=0; i<NUM_STATIC_SLOTS; i++) m_staticSlot[i] = false;
Random rand(m_sbody->GetSeed());
const bool ground = m_sbody->GetType() == SystemBody::TYPE_STARPORT_ORBITAL ? false : true;
m_type = SpaceStationType::RandomStationType(rand, ground);
if(m_shipDocking.empty()) {
m_shipDocking.reserve(m_type->NumDockingPorts());
for (unsigned int i=0; i<m_type->NumDockingPorts(); i++) {
m_shipDocking.push_back(shipDocking_t());
}
// only (re)set these if we've not come from the ::Load method
m_doorAnimationStep = m_doorAnimationState = 0.0;
}
assert(m_shipDocking.size() == m_type->NumDockingPorts());
// This SpaceStation's bay ports are an instance of...
m_ports = m_type->Ports();
SetStatic(ground); // orbital stations are dynamic now
// XXX hack. if we loaded a game then ModelBody::Load already restored the
// model and we shouldn't overwrite it
if (!GetModel())
SetModel(m_type->ModelName().c_str());
SceneGraph::Model *model = GetModel();
m_navLights.reset(new NavLights(model, 2.2f));
m_navLights->SetEnabled(true);
if (ground) SetClipRadius(CITY_ON_PLANET_RADIUS); // overrides setmodel
m_doorAnimation = model->FindAnimation("doors");
SceneGraph::ModelSkin skin;
skin.SetDecal("pioneer");
if (model->SupportsPatterns()) {
skin.SetRandomColors(rand);
skin.Apply(model);
model->SetPattern(rand.Int32(0, model->GetNumPatterns()));
} else {
skin.Apply(model);
}
}
示例13: Spawn
void CBaseTrainDoor :: Spawn( void )
{
Precache();
pev->movetype = MOVETYPE_PUSH;
pev->solid = SOLID_BSP;
SET_MODEL( edict(), GetModel( ));
// is mapper forget set angles?
if( pev->movedir == g_vecZero )
{
pev->movedir = Vector( 1, 0, 0 );
SetLocalAngles( g_vecZero );
}
// save initial angles
m_vecOldAngles = GetLocalAngles(); // ???
m_vecPosition1 = GetLocalOrigin(); // member the initial position
if( !pev->speed )
pev->speed = 100;
m_pUserData = WorldPhysic->CreateKinematicBodyFromEntity( this );
door_state = TD_CLOSED;
SetTouch( NULL );
SetThink( &CBaseTrainDoor :: FindTrain );
SetNextThink( 0.1 );
}
示例14: SetOrient
void SpaceStation::TimeStepUpdate(const float timeStep)
{
// rotate the thing
double len = m_type->angVel * timeStep;
if (!is_zero_exact(len)) {
matrix3x3d r = matrix3x3d::RotateY(-len); // RotateY is backwards
SetOrient(r * GetOrient());
}
m_oldAngDisplacement = len;
// reposition the ships that are docked or docking here
for (int i=0; i<m_type->numDockingPorts; i++) {
const shipDocking_t &dt = m_shipDocking[i];
if (!dt.ship) { //free
m_navLights->SetColor(i+1, NavLights::NAVLIGHT_GREEN);
continue;
}
if (dt.stage == 1) //reserved
m_navLights->SetColor(i+1, NavLights::NAVLIGHT_YELLOW);
if (dt.ship->GetFlightState() == Ship::FLYING)
continue;
PositionDockedShip(dt.ship, i);
m_navLights->SetColor(i+1, NavLights::NAVLIGHT_RED); //docked
}
if (m_doorAnimation)
GetModel()->UpdateAnimations();
}
示例15: KeyValues
//------------------------------------------------------------------------------
// Purpose:
//------------------------------------------------------------------------------
bool CNPC_Furniture::CreateVPhysics( void )
{
#ifndef HL2_DLL
return false;
#endif
if ( !m_BoneFollowerManager.GetNumBoneFollowers() )
{
KeyValues *modelKeyValues = new KeyValues("");
if ( modelKeyValues->LoadFromBuffer( modelinfo->GetModelName( GetModel() ), modelinfo->GetModelKeyValueText( GetModel() ) ) )
{
// Do we have a bone follower section?
KeyValues *pkvBoneFollowers = modelKeyValues->FindKey("bone_followers");
if ( pkvBoneFollowers )
{
// Loop through the list and create the bone followers
KeyValues *pBone = pkvBoneFollowers->GetFirstSubKey();
while ( pBone )
{
// Add it to the list
const char *pBoneName = pBone->GetString();
m_BoneFollowerManager.AddBoneFollower( this, pBoneName );
pBone = pBone->GetNextKey();
}
}
}
modelKeyValues->deleteThis();
}
return true;
}