本文整理汇总了C++中IAnimatedMeshSceneNode::setAnimationSpeed方法的典型用法代码示例。如果您正苦于以下问题:C++ IAnimatedMeshSceneNode::setAnimationSpeed方法的具体用法?C++ IAnimatedMeshSceneNode::setAnimationSpeed怎么用?C++ IAnimatedMeshSceneNode::setAnimationSpeed使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IAnimatedMeshSceneNode
的用法示例。
在下文中一共展示了IAnimatedMeshSceneNode::setAnimationSpeed方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: init
pAnimatedSceneObject AnimatedSceneObject::init(pObject const& parent)
{
setupSceneAndManager(parent);
std::ostringstream oss;
oss << Conf::i().expand("rc/model/") << name_ << ".x";
IAnimatedMesh* mesh = smgr_->getMesh( oss.str().c_str() );
IAnimatedMeshSceneNode* temp = smgr_->addAnimatedMeshSceneNode( mesh, parent->body() );
temp->setAnimationSpeed(0);
body_ = temp;
body_->grab(); //added so its d'tor order is consistent with view::Object.
body_->getMaterial(0).Shininess = 0;
for( size_t i = 0; i < body_->getMaterialCount(); ++i ) {
body_->getMaterial(i).MaterialType = video::EMT_TRANSPARENT_ALPHA_CHANNEL;
body_->getMaterial(i).MaterialTypeParam = 0.01f;
body_->getMaterial(i).DiffuseColor.set(255, 255, 255, 255);
}
//test
body_->grab();
pAnimatedSceneObject self = static_pointer_cast<AnimatedSceneObject>( shared_from_this() );
scene()->addPickMapping( body_, self );
return self;
}
示例2: createNode
ISceneNode* Render::createNode(bool isMD2, IAnimatedMesh* mesh, ITexture* texture, bool light,core::vector3df scale, core::vector3df pos, core::vector3df rotation)
{
IAnimatedMeshSceneNode* node = smgr->addAnimatedMeshSceneNode(mesh, NULL, IDFlag_IsPickable);
if(node)
{
pos.Y += -node->getBoundingBox().MinEdge.Y * scale.Y;
node->setPosition(pos);
node->setRotation(rotation);
node->setScale(scale);
node->setAnimationSpeed(20.f);
scene::ITriangleSelector* selector = 0;
selector = smgr->createTriangleSelector(node);
node->setTriangleSelector(selector);
selector->drop();
//Autoscale
//f32 scale = 0.25f;
node->setScale(scale);
if (texture)
{
//node->setMaterialFlag(EMF_LIGHTING, false);
node->setMaterialTexture(0, texture);
}
node->setMD2Animation(EMAT_STAND);
}
return node;
}
示例3: createNode
IAnimatedMeshSceneNode* Level::createNode(
const LevelConfig::Model& model, u32 position)
{
IAnimatedMeshSceneNode* node = _game->getDevice()->getSceneManager(
)->addAnimatedMeshSceneNode(model.Mesh, _rootNode,
-1, _board->getPosition(position));
node->setAnimationSpeed(model.AnimationSpeed);
return node;
}
示例4: addNinja
static ISceneNode* addNinja(ISceneManager* smgr, core::vector3df pos)
{
IAnimatedMeshSceneNode* ninja = smgr->addAnimatedMeshSceneNode(
smgr->getMesh("Assets/model/ninja/ninja.b3d"));
ninja->setFrameLoop(182, 204);
ninja->setMaterialFlag(video::EMF_LIGHTING, false);
ninja->setAnimationSpeed(12);
ninja->setPosition(pos);
return ninja;
}
示例5: dns_cache_prune
void dns_cache_prune(DnsCache *c) {
usec_t t = 0;
assert(c);
/* Remove all entries that are past their TTL */
for (;;) {
_cleanup_(dns_resource_key_unrefp) DnsResourceKey *key = NULL;
DnsCacheItem *i;
i = prioq_peek(c->by_expiry);
if (!i)
break;
if (t <= 0)
t = now(CLOCK_BOOTTIME);
if (i->until > t)
break;
/* Take an extra reference to the key so that it
* doesn't go away in the middle of the remove call */
key = dns_resource_key_ref(i->key);
dns_cache_remove(c, key);
}
}
static int dns_cache_item_prioq_compare_func(const void *a, const void *b) {
const DnsCacheItem *x = a, *y = b;
if (x->until < y->until)
return -1;
if (x->until > y->until)
return 1;
return 0;
}
static int dns_cache_init(DnsCache *c) {
int r;
assert(c);
r = prioq_ensure_allocated(&c->by_expiry, dns_cache_item_prioq_compare_func);
if (r < 0)
return r;
r = hashmap_ensure_allocated(&c->by_key, &dns_resource_key_hash_ops);
if (r < 0)
return r;
return r;
}
static int dns_cache_link_item(DnsCache *c, DnsCacheItem *i) {
DnsCacheItem *first;
int r;
assert(c);
assert(i);
r = prioq_put(c->by_expiry, i, &i->prioq_idx);
if (r < 0)
return r;
first = hashmap_get(c->by_key, i->key);
if (first) {
LIST_PREPEND(by_key, first, i);
assert_se(hashmap_replace(c->by_key, first->key, first) >= 0);
} else {
r = hashmap_put(c->by_key, i->key, i);
if (r < 0) {
prioq_remove(c->by_expiry, i, &i->prioq_idx);
return r;
}
}
return 0;
}
static DnsCacheItem* dns_cache_get(DnsCache *c, DnsResourceRecord *rr) {
DnsCacheItem *i;
assert(c);
assert(rr);
LIST_FOREACH(by_key, i, hashmap_get(c->by_key, rr->key))
if (i->rr && dns_resource_record_equal(i->rr, rr) > 0)
return i;
return NULL;
}
static void dns_cache_item_update_positive(DnsCache *c, DnsCacheItem *i, DnsResourceRecord *rr, usec_t timestamp) {
assert(c);
assert(i);
assert(rr);
i->type = DNS_CACHE_POSITIVE;
//.........这里部分代码省略.........